Repository navigation
feat(sglang): megatron backend weight refit for sglang rollouts #3612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
2560488
build(sglang): pin the sglang-miles branch, drop the TMS cuda-graph p…
xiuhu17 4a1bb34
feat(sglang): megatron backend weight refit for sglang rollouts
xiuhu17 b6d6513
fix(sglang): keep the SGLang refit dispatch out of the policy workers
Kh4L 9b8eabc
fix(sglang): avoid ncclCommSplit hang in the refit weight-update group
xiuhu17 9032cc6
refactor(sglang): route every SGLang refit through the weight synchro…
xiuhu17 ffa0eaa
build(sglang): align the sglang extra with the sglang-miles pins
xiuhu17 2da3210
test(sglang): add 1n4g sglang recipes for megatron and fsdp2
xiuhu17 25fb320
chore(sglang): satisfy the repo-pinned ruff formatter
Kh4L b1f3b50
test(sglang): register the 1n4g sglang recipes in the GB200 nightly s…
Kh4L 2bdfacb
build(sglang): regenerate uv.lock and keep main's outlines override
Kh4L d46ab64
fix(sglang): resolve the self-review findings on the refit path
Kh4L e1f1355
fix(sglang): resolve the four inline self-review findings on this PR
Kh4L 926da96
fix(sglang): address refit review feedback
Kh4L e692e90
fix(sglang): reject unsupported KV scales explicitly
Kh4L 2b970db
fix(sglang): initialize refit integrations before first use
Kh4L b0d92b3
fix(sglang): address latest refit review feedback
Kh4L 15b117d
refactor(sglang): initialize refit transport state lazily and reuse t…
terrykong d2a0f64
refactor(sglang): spell the lazy state helper plainly and keep the ex…
terrykong 0586eda
fix(sglang): resolve remaining refit review feedback
Kh4L a1dbe69
build: regenerate lock with CI uv version
Kh4L 765b0f3
build: install Rust for SGLang extensions
Kh4L 9c5dda7
build: install protoc for SGLang extensions
Kh4L 0b56ace
build(sglang): isolate the Transformers dependency
Kh4L b7aa61c
fix(sglang): address final review blockers
Kh4L cc8a54e
fix(sglang): disable prefill graphs with memory saver
Kh4L 3b75899
test(sglang): open refit sessions in weight-update roundtrips
Kh4L 09c4efc
apply suggestion
yuki-97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
examples/configs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-1n4g-fsdp2tp1-sglang.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| defaults: ./grpo-qwen2.5-math-1.5b-instruct-2n8g-fsdp2tp1-sglang.yaml | ||
|
|
||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-1n4g-fsdp2tp1-sglang | ||
|
|
||
| policy: | ||
| generation: | ||
| sglang_cfg: | ||
| tp_size: 1 | ||
| sglang_server_config: | ||
| num_gpus: 4 | ||
|
|
||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-1n4g-fsdp2tp1-sglang | ||
| wandb: | ||
| name: grpo-qwen2.5-math-1.5b-instruct-1n4g-fsdp2tp1-sglang | ||
|
|
||
| cluster: | ||
| gpus_per_node: 4 | ||
| num_nodes: 1 |
20 changes: 20 additions & 0 deletions
20
examples/configs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-1n4g-megatrontp1-sglang.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| defaults: ./grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang.yaml | ||
|
|
||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-1n4g-megatrontp1-sglang | ||
|
|
||
| policy: | ||
| generation: | ||
| sglang_cfg: | ||
| tp_size: 1 | ||
| sglang_server_config: | ||
| num_gpus: 4 | ||
|
|
||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-1n4g-megatrontp1-sglang | ||
| wandb: | ||
| name: grpo-qwen2.5-math-1.5b-instruct-1n4g-megatrontp1-sglang | ||
|
|
||
| cluster: | ||
| gpus_per_node: 4 | ||
| num_nodes: 1 |
54 changes: 0 additions & 54 deletions
54
examples/configs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-1n8g-fsdp2tp1-sglang.yaml
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...igs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-2n4g-megatrontp1-sglang-noncolocated.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| defaults: ./grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang-noncolocated.yaml | ||
|
|
||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-2n4g-megatrontp1-sglang-noncolocated | ||
|
|
||
| policy: | ||
| generation: | ||
| colocated: | ||
| resources: | ||
| gpus_per_node: 4 | ||
| sglang_cfg: | ||
| tp_size: 1 | ||
| sglang_server_config: | ||
| num_gpus: 4 | ||
|
|
||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-2n4g-megatrontp1-sglang-noncolocated | ||
| wandb: | ||
| name: grpo-qwen2.5-math-1.5b-instruct-2n4g-megatrontp1-sglang-noncolocated | ||
|
|
||
| cluster: | ||
| gpus_per_node: 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...igs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang-noncolocated.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| defaults: ../../grpo_math_1B_sglang.yaml | ||
| grpo: | ||
| max_num_steps: 450 | ||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang-noncolocated | ||
| policy: | ||
| model_name: Qwen/Qwen2.5-Math-1.5B-Instruct | ||
| tokenizer: | ||
| name: Qwen/Qwen2.5-Math-1.5B-Instruct | ||
| optimizer: null | ||
| megatron_cfg: | ||
| enabled: true | ||
| scheduler: | ||
| lr_warmup_iters: 50 | ||
| dtensor_cfg: | ||
| enabled: false | ||
| dynamic_batching: | ||
| enabled: true | ||
| sequence_packing: | ||
| enabled: false | ||
| make_sequence_length_divisible_by: 1 | ||
| generation: | ||
| max_new_tokens: 512 | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| gpus_per_node: 8 | ||
| num_nodes: 1 | ||
| sglang_cfg: | ||
| tp_size: 2 | ||
| sglang_server_config: | ||
| num_gpus: 8 | ||
| sglang_router_config: | ||
| use_distributed_post: true | ||
| data: | ||
| max_input_seq_length: 512 | ||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang-noncolocated | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang-noncolocated | ||
| cluster: | ||
| gpus_per_node: 8 | ||
| num_nodes: 2 |
40 changes: 40 additions & 0 deletions
40
examples/configs/recipes/llm/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| defaults: ../../grpo_math_1B_sglang.yaml | ||
| grpo: | ||
| max_num_steps: 450 | ||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang | ||
| policy: | ||
| model_name: Qwen/Qwen2.5-Math-1.5B-Instruct | ||
| tokenizer: | ||
| name: Qwen/Qwen2.5-Math-1.5B-Instruct | ||
| optimizer: null | ||
| megatron_cfg: | ||
| enabled: true | ||
| scheduler: | ||
| lr_warmup_iters: 50 | ||
| dtensor_cfg: | ||
| enabled: false | ||
| dynamic_batching: | ||
| enabled: true | ||
| sequence_packing: | ||
| enabled: false | ||
| make_sequence_length_divisible_by: 1 | ||
| generation: | ||
| max_new_tokens: 512 | ||
| sglang_cfg: | ||
| tp_size: 4 | ||
| sglang_server_config: | ||
| num_gpus: 16 | ||
| sglang_router_config: | ||
| use_distributed_post: true | ||
| data: | ||
| max_input_seq_length: 512 | ||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-qwen2.5-math-1.5b-instruct-2n8g-megatrontp1-sglang | ||
| cluster: | ||
| gpus_per_node: 8 | ||
| num_nodes: 2 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.