Repository navigation
[AsyncTP] Set return_A=False in AllGatherGEMMPattern to unlock multim… - #34480
tianrengao wants to merge 1 commit into
Conversation
…em path The AllGatherGEMMPattern replacement calls fused_all_gather_matmul but never uses the gathered tensor (ag_output). However, it relies on the default return_A=True, which prevents the multimem execution path in _should_use_multimem_all_gather_matmul from being selected. Setting return_A=False signals that the gathered tensor is not needed, enabling the NVLink multicast-based multimem path for small M values. Microbenchmarks on 8xH100 show 1.5x-8.5x per-op speedup for M<=2048. Note: PyTorch's native Inductor FX pass (micro_pipeline_tp.py) already performs this optimization by checking if ag_output has no downstream users, but vLLM's pattern matcher does not do this liveness analysis. Signed-off-by: tianrengao <terrygao87@gmail.com>
|
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this comment.
Code Review
This pull request introduces a performance optimization by setting return_A=False in the fused_all_gather_matmul call within the AllGatherGEMMPattern. As explained in the description, this change is safe because the gathered tensor is not used downstream, and it unlocks a faster NVLink multicast-based execution path for small matrix sizes, resulting in significant speedups. The change is well-contained, correct, and the added code comment clearly explains the rationale. I've confirmed that this optimization is specific to fused_all_gather_matmul and does not apply to fused_all_gather_scaled_matmul used in other patterns, as the latter does not have the return_A parameter. The implementation is solid and I have no further suggestions.
|
This pull request has merge conflicts that must be resolved before it can be |
|
Closing as superseded by #60517, which removed the torch.compile-based sequence parallelism pass and AsyncTP (along with |
…em path
The AllGatherGEMMPattern replacement calls fused_all_gather_matmul but never uses the gathered tensor (ag_output). However, it relies on the default return_A=True, which prevents the multimem execution path in _should_use_multimem_all_gather_matmul from being selected.
Setting return_A=False signals that the gathered tensor is not needed, enabling the NVLink multicast-based multimem path for small M values. Microbenchmarks on 8xH100 show 1.5x-8.5x per-op speedup for M<=2048.
Note: PyTorch's native Inductor FX pass (micro_pipeline_tp.py) already performs this optimization by checking if ag_output has no downstream users, but vLLM's pattern matcher does not do this liveness analysis.
Purpose
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.