Skip to content

[sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch#5868

Open
xiazhahe wants to merge 1 commit intoverl-project:mainfrom
xiazhahe:main
Open

[sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch#5868
xiazhahe wants to merge 1 commit intoverl-project:mainfrom
xiazhahe:main

Conversation

@xiazhahe
Copy link
Copy Markdown
Contributor

@xiazhahe xiazhahe commented Apr 2, 2026

What does this PR do?

The latest main branch of SGLang has wrapped the _launch_subprocesses function inside the Engine class. Adapt and add the use of _launch_subprocesses to the latest SGLang branch.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, veomni, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward, fully_async, one_step_off
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@xiazhahe xiazhahe requested a review from chenhaiq as a code owner April 2, 2026 13:05
@xiazhahe xiazhahe changed the title [sglang] Adapting the use of _launch_subprocesses to the latest SGLan… [sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch Apr 2, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces compatibility for newer versions of SGLang (post-0.5.9) by implementing a feature check for the Engine class. It updates the server launch logic to use Engine._launch_subprocesses when available, while maintaining backward compatibility for older versions through a fallback mechanism. I have no feedback to provide.

@xiazhahe xiazhahe changed the title [sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch [fix][sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch Apr 3, 2026
@xiazhahe xiazhahe changed the title [fix][sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch [sglang] Adapting the use of _launch_subprocesses to the latest SGLang branch Apr 3, 2026
sglang.srt.entrypoints.engine._set_envs_and_config = _set_envs_and_config
os.environ["SGLANG_BLOCK_NONZERO_RANK_CHILDREN"] = "0"
server_args = ServerArgs(**args)
if version.parse(sglang.__version__) >= version.parse("0.5.7"):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果在这里判断SGLangr version newer than 0.5.9,然后再导包的话 感觉代码形式上稍微解耦一点

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants