-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[sglang] feat: add native sgl server #3090
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
wuxibin89
merged 14 commits into
volcengine:main
from
SwordFaith:feat/native_sgl_server_new
Aug 28, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
967e0a6
add
ChangyiYang 91bcebc
add abort request
ChangyiYang 4edf261
fix
ChangyiYang d797d91
pre commit
ChangyiYang 0c90ce5
change config name
ChangyiYang c7e341b
move conftest location, clean up test
ChangyiYang 0d75e79
Merge branch 'main' into feat/native_sgl_server_new
ChangyiYang 82fa1aa
clean up log
ChangyiYang 3853f45
Merge branch 'feat/native_sgl_server_new' of github.com:SwordFaith/ve…
ChangyiYang 446f30e
add try catch block
ChangyiYang 40a6fc7
add async mark
ChangyiYang 577bb2b
Merge branch 'main' into feat/native_sgl_server_new
ChangyiYang 899fe4d
pre commit
ChangyiYang a160231
nothing
ChangyiYang 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
28 changes: 28 additions & 0 deletions
28
examples/sglang_multiturn/config/gsm8k_multiturn_grpo_server.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,28 @@ | ||
| hydra: | ||
| searchpath: | ||
| - file://verl/trainer/config | ||
|
|
||
| defaults: | ||
| - ppo_trainer | ||
| - _self_ | ||
|
|
||
| data: | ||
| max_prompt_length: 1024 | ||
| max_response_length: 1024 | ||
| train_batch_size: 256 | ||
| return_raw_chat: True | ||
|
|
||
| actor_rollout_ref: | ||
| hybrid_engine: True | ||
| rollout: | ||
| name: sglang | ||
| multi_turn: | ||
| enable: True | ||
| max_assistant_turns: 5 | ||
| sglang_rollout_mode: server | ||
| server: | ||
| timeout: 60 | ||
| max_attempts: 3 | ||
| retry_delay: 2 | ||
| max_connections: 1000 | ||
| max_start_wait_time: 300.0 |
60 changes: 60 additions & 0 deletions
60
examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn_4xgpu_server.sh
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,60 @@ | ||
| # run on 4xH100 | ||
| # make sure your current working directory is the root of the project | ||
|
|
||
| set -x | ||
| export HYDRA_FULL_ERROR=1 | ||
| ulimit -n 65535 | ||
|
|
||
| PROJECT_DIR="$(pwd)" | ||
| CONFIG_PATH="$PROJECT_DIR/examples/sglang_multiturn/config" | ||
|
|
||
| python3 -m verl.trainer.main_ppo \ | ||
| --config-path="$CONFIG_PATH" \ | ||
| --config-name='gsm8k_multiturn_grpo_server' \ | ||
| algorithm.adv_estimator=grpo \ | ||
| data.train_batch_size=256 \ | ||
| data.max_prompt_length=1024 \ | ||
| data.max_response_length=1024 \ | ||
| data.filter_overlong_prompts=True \ | ||
| data.truncation='error' \ | ||
| data.return_raw_chat=True \ | ||
| actor_rollout_ref.model.path=Qwen/Qwen2.5-3B-Instruct \ | ||
| actor_rollout_ref.actor.optim.lr=1e-6 \ | ||
| actor_rollout_ref.model.use_remove_padding=True \ | ||
| actor_rollout_ref.actor.ppo_mini_batch_size=256 \ | ||
| actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.actor.use_kl_loss=True \ | ||
| actor_rollout_ref.actor.kl_loss_coef=0.001 \ | ||
| actor_rollout_ref.actor.kl_loss_type=low_var_kl \ | ||
| actor_rollout_ref.actor.entropy_coeff=0 \ | ||
| actor_rollout_ref.model.enable_gradient_checkpointing=True \ | ||
| actor_rollout_ref.actor.fsdp_config.param_offload=False \ | ||
| actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \ | ||
| actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.rollout.tensor_model_parallel_size=4 \ | ||
| actor_rollout_ref.rollout.name=sglang \ | ||
| actor_rollout_ref.rollout.gpu_memory_utilization=0.6 \ | ||
| actor_rollout_ref.rollout.n=16 \ | ||
| actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.ref.fsdp_config.param_offload=True \ | ||
| algorithm.use_kl_in_reward=False \ | ||
| trainer.critic_warmup=0 \ | ||
| trainer.logger='["console", "wandb"]' \ | ||
| trainer.project_name='gsm8k_async_rl_server' \ | ||
| trainer.experiment_name='qwen2.5-3b_function_rm-gsm8k-async-sgl-multi-w-tool-verify-n16-4cards' \ | ||
| trainer.n_gpus_per_node=4 \ | ||
| trainer.nnodes=1 \ | ||
| trainer.save_freq=-1 \ | ||
| trainer.test_freq=20 \ | ||
| trainer.total_epochs=15 \ | ||
| actor_rollout_ref.actor.ppo_max_token_len_per_gpu=8192 \ | ||
| actor_rollout_ref.rollout.log_prob_max_token_len_per_gpu=8192 \ | ||
| actor_rollout_ref.ref.log_prob_max_token_len_per_gpu=8192 \ | ||
| critic.ppo_max_token_len_per_gpu=8192 \ | ||
| critic.forward_max_token_len_per_gpu=8192 \ | ||
| data.train_files=$HOME/data/gsm8k/train.parquet \ | ||
| data.val_files=$HOME/data/gsm8k/test.parquet \ | ||
| actor_rollout_ref.rollout.multi_turn.tool_config_path="$PROJECT_DIR/examples/sglang_multiturn/config/tool_config/gsm8k_tool_config.yaml" \ | ||
| actor_rollout_ref.rollout.multi_turn.interaction_config_path="$PROJECT_DIR/examples/sglang_multiturn/config/interaction_config/gsm8k_interaction_config.yaml" \ | ||
| actor_rollout_ref.rollout.multi_turn.max_user_turns=1 \ | ||
| $@ | ||
63 changes: 63 additions & 0 deletions
63
examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn_server.sh
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,63 @@ | ||
| # run on 8xH100 | ||
| # make sure your current working directory is the root of the project | ||
|
|
||
| set -x | ||
|
|
||
| ulimit -n 65535 | ||
|
|
||
| PROJECT_DIR="$(pwd)" | ||
| CONFIG_PATH="$PROJECT_DIR/examples/sglang_multiturn/config" | ||
|
|
||
| function now() { | ||
| date '+%d-%H-%M' | ||
| } | ||
|
|
||
| EXPERIMENT_NAME="qwen2.5-3b_baseline_$(now)" | ||
|
|
||
| python3 -m verl.trainer.main_ppo \ | ||
| --config-path="$CONFIG_PATH" \ | ||
| --config-name='gsm8k_multiturn_grpo_server' \ | ||
| algorithm.adv_estimator=grpo \ | ||
| data.train_batch_size=256 \ | ||
| data.max_prompt_length=1024 \ | ||
| data.max_response_length=1024 \ | ||
| data.filter_overlong_prompts=True \ | ||
| data.truncation='error' \ | ||
| data.return_raw_chat=True \ | ||
| actor_rollout_ref.model.path=Qwen/Qwen2.5-3B-Instruct \ | ||
| actor_rollout_ref.actor.optim.lr=1e-6 \ | ||
| actor_rollout_ref.model.use_remove_padding=True \ | ||
| actor_rollout_ref.actor.ppo_mini_batch_size=256 \ | ||
| actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.actor.use_kl_loss=True \ | ||
| actor_rollout_ref.actor.kl_loss_coef=0.001 \ | ||
| actor_rollout_ref.actor.kl_loss_type=low_var_kl \ | ||
| actor_rollout_ref.actor.entropy_coeff=0 \ | ||
| actor_rollout_ref.model.enable_gradient_checkpointing=True \ | ||
| actor_rollout_ref.actor.fsdp_config.param_offload=False \ | ||
| actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \ | ||
| actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.rollout.tensor_model_parallel_size=1 \ | ||
| actor_rollout_ref.rollout.name=sglang \ | ||
| actor_rollout_ref.rollout.gpu_memory_utilization=0.85 \ | ||
| actor_rollout_ref.rollout.multi_stage_wake_up=True \ | ||
| actor_rollout_ref.rollout.n=16 \ | ||
| actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=32 \ | ||
| actor_rollout_ref.ref.fsdp_config.param_offload=True \ | ||
| actor_rollout_ref.rollout.over_sample_rate=0 \ | ||
| algorithm.use_kl_in_reward=False \ | ||
| trainer.critic_warmup=0 \ | ||
| trainer.logger='["console","wandb"]' \ | ||
| trainer.project_name='multi-turn-grpo-qwen2.5-3b-sglang' \ | ||
| trainer.experiment_name=$EXPERIMENT_NAME \ | ||
| trainer.n_gpus_per_node=8 \ | ||
| trainer.nnodes=1 \ | ||
| trainer.save_freq=-1 \ | ||
| trainer.test_freq=20 \ | ||
| trainer.val_before_train=True \ | ||
| data.train_files=$HOME/data/gsm8k/train.parquet \ | ||
| data.val_files=$HOME/data/gsm8k/test.parquet \ | ||
| actor_rollout_ref.rollout.multi_turn.tool_config_path="$PROJECT_DIR/examples/sglang_multiturn/config/tool_config/gsm8k_tool_config.yaml" \ | ||
| trainer.total_epochs=15 \ | ||
| actor_rollout_ref.rollout.update_weights_bucket_megabytes=512 $@ | ||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment to say this would use the server.