-
Notifications
You must be signed in to change notification settings - Fork 905
[grpo] Optimize vLLM weight synchronization & update buitin accuracy reward #5773
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
51 commits
Select commit
Hold shift + click to select a range
6301476
support only sync lora weight
hjh0119 c7be012
fix wip
hjh0119 22042fc
wip
hjh0119 1081caa
fix colocate lora
hjh0119 4c04d36
add lora for server wip
hjh0119 1982e9e
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 5fe3690
fix import
hjh0119 161dac8
update extension path
hjh0119 0a14d20
override enable_lora for rollout
hjh0119 4574665
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 efae3b2
catch rollout exception
hjh0119 f454598
fix lora request
hjh0119 d46bc1f
server wip
hjh0119 986ac8d
server add_lora wip
hjh0119 0dc8c6e
fix server tp
hjh0119 ba284ba
merge main
hjh0119 0f7ca2a
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 849696f
doc wip
hjh0119 f70e827
doc
hjh0119 274f6db
check lora
hjh0119 f0b4de8
support only sync lora weight
hjh0119 6069888
add args for lora script
hjh0119 0cf5a62
update script
hjh0119 691a5df
fix
hjh0119 5cab78d
remove unused import
hjh0119 e43a0da
fix
hjh0119 688bf64
fix typo
hjh0119 4fa2d2f
fix unmerge
hjh0119 78f9473
wip
hjh0119 a50f756
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 be00cf4
Merge remote-tracking branch 'origin' into lora+
hjh0119 6745666
bucket for full training in server mode
hjh0119 dfccf15
remove circle import
hjh0119 4652f77
fix TokenizerGroup removed in vllm 0.11.0
hjh0119 8c73590
rm comments
hjh0119 4389268
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 cc56588
move model batches for full parameters
hjh0119 1360752
Merge branch 'lora+' of github.com:hjh0119/swift into lora+
hjh0119 1561e8f
fix lora training with rollout enable_lora
hjh0119 0f81605
Merge remote-tracking branch 'origin' into lora+
hjh0119 24220bf
check should merge adapter
hjh0119 c66a801
update accuracy & test accuracy & moe script
hjh0119 190c201
add test cases
hjh0119 c186507
colocate moe script & fix moe colocate lora training
hjh0119 b9a1827
add script
hjh0119 eb3e230
doc update
hjh0119 9b503a7
rm sricpt & update doc
hjh0119 67f36a6
streamline weight sync
hjh0119 a406f6d
clean comments and import
hjh0119 0380c08
add vllm_enable_lora for colocate
hjh0119 9f98473
fix zh comment in en doc
hjh0119 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 8*80G | ||
|
||
# CUDA_VISIBLE_DEVICES=0 \ | ||
# swift rollout \ | ||
# --model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
# --vllm_max_model_len 16384 \ | ||
# --vllm_enable_prefix_caching true | ||
|
||
CUDA_VISIBLE_DEVICES=1,2,3,4,5,6,7 \ | ||
NPROC_PER_NODE=7 \ | ||
swift rlhf \ | ||
--rlhf_type grpo \ | ||
--model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
--reward_funcs accuracy \ | ||
--use_vllm true \ | ||
--vllm_mode server \ | ||
--vllm_server_host 127.0.0.1 \ | ||
--vllm_server_port 8000 \ | ||
--train_type full \ | ||
--torch_dtype bfloat16 \ | ||
--dataset AI-MO/NuminaMath-TIR#1000 \ | ||
--max_length 12000 \ | ||
--max_completion_length 8192 \ | ||
--overlong_filter true \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 1 \ | ||
--learning_rate 1e-6 \ | ||
--gradient_accumulation_steps 4 \ | ||
--save_strategy 'steps' \ | ||
--eval_strategy 'steps' \ | ||
--eval_steps 1000 \ | ||
--save_steps 1000 \ | ||
--save_total_limit 10 \ | ||
--logging_steps 1 \ | ||
--warmup_ratio 0.01 \ | ||
--dataloader_num_workers 4 \ | ||
--num_generations 14 \ | ||
--temperature 1.0 \ | ||
--deepspeed zero3_offload \ | ||
--log_completions true \ | ||
--report_to tensorboard swanlab \ | ||
--num_iterations 1 \ | ||
--beta 0.001 \ | ||
--move_model_batches 5 |
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,44 @@ | ||
# 8*80G | ||
|
||
# CUDA_VISIBLE_DEVICES=0 \ | ||
# swift rollout \ | ||
# --model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
# --vllm_max_model_len 16384 \ | ||
# --vllm_enable_prefix_caching true | ||
|
||
CUDA_VISIBLE_DEVICES=1,2,3,4,5,6,7 \ | ||
NPROC_PER_NODE=7 \ | ||
swift rlhf \ | ||
--rlhf_type grpo \ | ||
--model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
--reward_funcs accuracy \ | ||
--use_vllm true \ | ||
--vllm_mode server \ | ||
--vllm_server_host 127.0.0.1 \ | ||
--vllm_server_port 8000 \ | ||
--train_type lora \ | ||
--torch_dtype bfloat16 \ | ||
--dataset AI-MO/NuminaMath-TIR#1000 \ | ||
--max_length 12000 \ | ||
--max_completion_length 8192 \ | ||
--overlong_filter true \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 1 \ | ||
--learning_rate 1e-6 \ | ||
--gradient_accumulation_steps 4 \ | ||
--save_strategy 'steps' \ | ||
--eval_strategy 'steps' \ | ||
--eval_steps 1000 \ | ||
--save_steps 1000 \ | ||
--save_total_limit 10 \ | ||
--logging_steps 1 \ | ||
--warmup_ratio 0.01 \ | ||
--dataloader_num_workers 4 \ | ||
--num_generations 14 \ | ||
--temperature 1.0 \ | ||
--deepspeed zero3 \ | ||
--log_completions true \ | ||
--report_to tensorboard swanlab \ | ||
--num_iterations 1 \ | ||
--beta 0.001 \ | ||
--move_model_batches 5 |
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 @@ | ||
# 8*80G | ||
|
||
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \ | ||
NPROC_PER_NODE=8 \ | ||
swift rlhf \ | ||
--rlhf_type grpo \ | ||
--model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
--reward_funcs accuracy \ | ||
--use_vllm true \ | ||
--vllm_mode colocate \ | ||
--vllm_gpu_memory_utilization 0.4 \ | ||
--vllm_tensor_parallel_size 2 \ | ||
--vllm_max_model_len 16384 \ | ||
--train_type full \ | ||
--torch_dtype bfloat16 \ | ||
--dataset AI-MO/NuminaMath-TIR#1000 \ | ||
--max_length 12000 \ | ||
--max_completion_length 8192 \ | ||
--overlong_filter true \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 1 \ | ||
--learning_rate 1e-6 \ | ||
--gradient_accumulation_steps 4 \ | ||
--save_strategy 'steps' \ | ||
--eval_strategy 'steps' \ | ||
--eval_steps 1000 \ | ||
--save_steps 1000 \ | ||
--save_total_limit 10 \ | ||
--logging_steps 1 \ | ||
--warmup_ratio 0.01 \ | ||
--dataloader_num_workers 4 \ | ||
--num_generations 16 \ | ||
--temperature 1.0 \ | ||
--deepspeed zero3_offload \ | ||
--log_completions true \ | ||
--sleep_level 1 \ | ||
--report_to tensorboard swanlab \ | ||
--num_iterations 1 \ | ||
--beta 0.001 \ | ||
--move_model_batches 10 |
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,42 @@ | ||
# 8*80G | ||
|
||
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \ | ||
NPROC_PER_NODE=8 \ | ||
swift rlhf \ | ||
--rlhf_type grpo \ | ||
--model Qwen/Qwen3-30B-A3B-Instruct-2507 \ | ||
--reward_funcs accuracy \ | ||
--use_vllm true \ | ||
--vllm_mode colocate \ | ||
--vllm_gpu_memory_utilization 0.4 \ | ||
--vllm_tensor_parallel_size 2 \ | ||
--vllm_max_model_len 16384 \ | ||
--train_type lora \ | ||
--torch_dtype bfloat16 \ | ||
--dataset AI-MO/NuminaMath-TIR#1000 \ | ||
--max_length 12000 \ | ||
--max_completion_length 8192 \ | ||
--overlong_filter true \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 1 \ | ||
--learning_rate 1e-6 \ | ||
--gradient_accumulation_steps 4 \ | ||
--save_strategy 'steps' \ | ||
--eval_strategy 'steps' \ | ||
--eval_steps 1000 \ | ||
--save_steps 1000 \ | ||
--save_total_limit 10 \ | ||
--logging_steps 1 \ | ||
--warmup_ratio 0.01 \ | ||
--dataloader_num_workers 4 \ | ||
--num_generations 16 \ | ||
--temperature 1.0 \ | ||
--deepspeed zero3 \ | ||
--log_completions true \ | ||
--sleep_level 1 \ | ||
--offload_model true \ | ||
--offload_optimizer true \ | ||
--report_to tensorboard swanlab \ | ||
--num_iterations 1 \ | ||
--beta 0.001 \ | ||
--move_model_batches 10 |
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
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.