[Perf] Fix moe reduce_scatter perf regression by removing additional comm, 5% E2E throughput gain back. - #48763
Conversation
Signed-off-by: yewentao256 <zhyanwentao@126.com>
|
This pull request has merge conflicts that must be resolved before it can be |
| if is_sequence_parallel: | ||
| hidden_states = hidden_states * get_tensor_model_parallel_world_size() | ||
| else: | ||
| hidden_states = tensor_model_parallel_all_reduce(hidden_states) |
There was a problem hiding this comment.
I don't see why we would do hidden_states = hidden_states * get_tensor_model_parallel_world_size(). Perhaps the scalar coefficient is being taken care of by a subsequent norm?
| if is_sequence_parallel: | |
| hidden_states = hidden_states * get_tensor_model_parallel_world_size() | |
| else: | |
| hidden_states = tensor_model_parallel_all_reduce(hidden_states) | |
| if not is_sequence_parallel: | |
| hidden_states = tensor_model_parallel_all_reduce(hidden_states) |
There was a problem hiding this comment.
I took a further look. You are right, fixed, thanks!
Signed-off-by: yewentao256 <zhyanwentao@126.com>
reduce_scatter perf regression by removing additional comm, 1.4%~4.8% E2E throughput gain back.reduce_scatter perf regression by removing additional comm, 5% E2E throughput gain back.
| if ( | ||
| self.mtp_block.use_sequence_parallel_moe | ||
| or hidden_states.shape[0] != positions.shape[0] | ||
| ): |
There was a problem hiding this comment.
nit: Why do we need both checks? I would think these are redundant
tlrmchlsmth
left a comment
There was a problem hiding this comment.
one nit, but otherwise LGTM now!
|
This pull request has merge conflicts that must be resolved before it can be |
|
This pull request has merge conflicts that must be resolved before it can be |
03b1160 to
a3e02ca
Compare
|
Documentation preview: https://vllm--48763.org.readthedocs.build/en/48763/ |
Purpose
Part of #46654
Following up PR for #48036 and alternative for #48657
Originally:
So all-gather(2H) + all-reduce(H) -> all-gather(H)
Test
vllm serve zai-org/GLM-5.2-FP8 --kv-cache-dtype fp8_e4m3 --enable-expert-parallel --tensor-parallel-size 4 --tool-call-parser glm47 --enable-auto-tool-choice --reasoning-parser glm45 --port 9256 --profiler-config.profiler=torch --profiler-config.torch_profiler_dir=/home/yewentao256/profile_vllm --speculative-config '{"method":"mtp","num_speculative_tokens":3}'lm_eval --model local-completions --model_args "base_url=http://127.0.0.1:9256/v1/completions,model=$MODEL,num_concurrent=1024" --tasks gsm8k