-
Notifications
You must be signed in to change notification settings - Fork 903
[grpo] Optimize vLLM weight synchronization #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
Open
hjh0119
wants to merge
43
commits into
modelscope:main
Choose a base branch
from
hjh0119:lora+
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
43 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 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
Some comments aren't visible on the classic Files Changed page.
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,52 @@ | ||
# For LoRA Training, set following parameters to speed up weight update | ||
# ```bash | ||
# --vllm_enable_lora true | ||
# --vllm_max_lora_rank xxx # same as lora_rank in training script | ||
# ``` | ||
|
||
# CUDA_VISIBLE_DEVICES=4,5,6,7 \ | ||
# swift rollout \ | ||
# --model Qwen/Qwen2.5-VL-7B-Instruct \ | ||
# --vllm_data_parallel_size 2 \ | ||
# --vllm_tensor_parallel_size 2 \ | ||
# --vllm_enable_lora true \ | ||
# --vllm_max_lora_rank 16 | ||
|
||
|
||
CUDA_VISIBLE_DEVICES=0,1,2,3 \ | ||
NPROC_PER_NODE=4 \ | ||
swift rlhf \ | ||
--rlhf_type grpo \ | ||
--model Qwen/Qwen2.5-VL-7B-Instruct \ | ||
--external_plugins examples/train/grpo/plugin/plugin.py \ | ||
--reward_funcs external_r1v_acc format \ | ||
--use_vllm true \ | ||
--vllm_mode server \ | ||
--vllm_server_host 127.0.0.1 \ | ||
--vllm_server_port 8000 \ | ||
--train_type lora \ | ||
--lora_rank 16 \ | ||
--lora_alpha 32 \ | ||
--torch_dtype bfloat16 \ | ||
--dataset 'AI-ModelScope/clevr_cogen_a_train' \ | ||
--max_completion_length 1024 \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 4 \ | ||
--learning_rate 1e-6 \ | ||
--gradient_accumulation_steps 2 \ | ||
--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 \ | ||
--system 'examples/train/grpo/prompt.txt' \ | ||
--deepspeed zero3 \ | ||
--log_completions true \ | ||
--report_to tensorboard swanlab \ | ||
--num_iterations 1 \ | ||
--beta 0.001 |
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
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.