Skip to content

[sglang] chore: Upgrade SGLang 0.4.9 with multi-stage awake feature#2187

Closed
hebiao064 wants to merge 34 commits intoverl-project:mainfrom
hebiao064:upgrade_sglang
Closed

[sglang] chore: Upgrade SGLang 0.4.9 with multi-stage awake feature#2187
hebiao064 wants to merge 34 commits intoverl-project:mainfrom
hebiao064:upgrade_sglang

Conversation

@hebiao064
Copy link
Copy Markdown
Collaborator

@hebiao064 hebiao064 commented Jun 24, 2025

What does this PR do?

Upgrade SGLang 0.4.8 with multi-stage awake function

I build the sglang docker file based on the https://github.com/volcengine/verl/blob/main/docker/verl0.5-cu126-torch2.7.1-fa2.8.0/Dockerfile.app.sglang.mcore0.12

(Only 2 line change about bumping sglang from 0.4.8 to 0.4.9)

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

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, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • 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

GRPO Test with SGLang works as expected

(TaskRunner pid=3043098) step:5 - global_seqlen/min:53826.000 - global_seqlen/max:59368.000 - global_seqlen/minmax_diff:5542.000 - global_seqlen/balanced_min:55522.000 - global_seqlen/balanced_max:55551.000 - global_seqlen/mean:55525.625 - actor/entropy:0.152 - actor/kl_loss:0.003 - actor/kl_coef:0.001 - actor/pg_loss:0.039 - actor/pg_clipfrac:0.000 - actor/ppo_kl:0.000 - actor/pg_clipfrac_lower:0.000 - actor/grad_norm:0.098 - perf/mfu/actor:0.332 - perf/max_memory_allocated_gb:25.143 - perf/max_memory_reserved_gb:44.846 - perf/cpu_memory_used_gb:79.942 - actor/lr:0.000 - val-core/openai/gsm8k/reward/mean@1:0.895 - training/global_step:5.000 - training/epoch:0.000 - critic/score/mean:0.925 - critic/score/max:1.000 - critic/score/min:0.000 - critic/rewards/mean:0.925 - critic/rewards/max:1.000 - critic/rewards/min:0.000 - critic/advantages/mean:-0.008 - critic/advantages/max:1.789 - critic/advantages/min:-1.789 - critic/returns/mean:-0.008 - critic/returns/max:1.789 - critic/returns/min:-1.789 - response_length/mean:247.129 - response_length/max:878.000 - response_length/min:93.000 - response_length/clip_ratio:0.000 - prompt_length/mean:99.906 - prompt_length/max:256.000 - prompt_length/min:66.000 - prompt_length/clip_ratio:0.000 - timing_s/generate_sequences:5.777 - timing_s/reshard:1.795 - timing_s/gen:8.290 - timing_s/reward:0.225 - timing_s/old_log_prob:1.973 - timing_s/ref:1.997 - timing_s/adv:0.021 - timing_s/update_actor:7.820 - timing_s/testing:10.669 - timing_s/step:31.018 - timing_per_token_ms/gen:0.026 - timing_per_token_ms/adv:0.000 - timing_per_token_ms/ref:0.004 - timing_per_token_ms/update_actor:0.018 - perf/total_num_tokens:444205.000 - perf/time_per_step:31.018 - perf/throughput:1790.105

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

High-Level Design

Demonstrate the high-level design if this PR is complex.

Specific Changes

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.

Copy link
Copy Markdown
Collaborator

@eric-haibin-lin eric-haibin-lin left a comment

Choose a reason for hiding this comment

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

does installing sglang now require nvcc?

@hebiao064
Copy link
Copy Markdown
Collaborator Author

hebiao064 commented Jun 26, 2025

does installing sglang now require nvcc?

The newer version of SGLang relies on the flashinfer 0.2.6, which didn't provide aot binary as previous version did flashinfer-ai/flashinfer#1064

Hence we may need nvcc to make sure flashinfer works, I think vllm also need flashinfer, is it possible to bake nvcc into the CI?

Copy link
Copy Markdown
Collaborator

@zhaochenyang20 zhaochenyang20 left a comment

Choose a reason for hiding this comment

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

Great

Copy link
Copy Markdown
Collaborator

@eric-haibin-lin eric-haibin-lin left a comment

Choose a reason for hiding this comment

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

good to go as long as CI tests pass

@zhaochenyang20
Copy link
Copy Markdown
Collaborator

Wait for us to fix Megatron of VLM

@hebiao064 hebiao064 requested a review from SwordFaith as a code owner July 3, 2025 18:04
@zhaochenyang20
Copy link
Copy Markdown
Collaborator

Great job so far.

@hebiao064 hebiao064 changed the title [sglang] chore: Upgrade SGLang 0.4.8 with multi-stage awake feature [sglang] chore: Upgrade SGLang 0.4.9 with multi-stage awake feature Jul 7, 2025
Comment thread setup.py
@hebiao064
Copy link
Copy Markdown
Collaborator Author

hebiao064 commented Jul 7, 2025

Given flash-attn 2.8.0.post2 (required by torch 2.7) has some issues for apply rotary kernel, huggingface/transformers#39167 (comment)

I'll disable the CI for qwen2.5vl sglang test: e2e_ppo_trainer_sglang_vlm

@hebiao064
Copy link
Copy Markdown
Collaborator Author

duplicated with #2794

@hebiao064 hebiao064 closed this Jul 29, 2025
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.

4 participants