Skip to content

[AMD] Add moe_ep_size/moe_tp_size to the allreduce-fusion gate test mock - #35251

Closed
kangwangamd wants to merge 1 commit into
sgl-project:mainfrom
kangwangamd:amd/fix-allreduce-fusion-gate-test-mock
Closed

[AMD] Add moe_ep_size/moe_tp_size to the allreduce-fusion gate test mock#35251
kangwangamd wants to merge 1 commit into
sgl-project:mainfrom
kangwangamd:amd/fix-allreduce-fusion-gate-test-mock

Conversation

@kangwangamd

@kangwangamd kangwangamd commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

test_aiter_allreduce_fusion_amd.py::TestAiterAllreduceFusionGate has been red on both pr-test-amd and pr-test-amd-rocm720 since Aug-12 (log):

File "python/sglang/srt/layers/communicator.py", line 828, in should_fuse_mlp_allreduce_with_next_layer
    if parallel.moe_ep_size > 1 and parallel.moe_tp_size > 1:
AttributeError: 'types.SimpleNamespace' object has no attribute 'moe_ep_size'

#30700 added a hybrid EP+TP check to should_fuse_mlp_allreduce_with_next_layer, so the gate now reads moe_ep_size and moe_tp_size off get_parallel(). The mock in this test only provides tp_size, so every case in the class raises before reaching its assertion.

This adds both attributes to the mock, set to 1. That is the dense-TP configuration these tests are written for: the new guard only short-circuits when both are greater than 1, so 1/1 leaves test_dense_tp_fuses asserting the fusion path as before, and the other cases still exercise the DP-attention and EP-backend branches they were added for.

Test-only change; no source behaviour is affected.

Checklist

This repairs an existing test rather than adding one, and there is no documentation or performance impact.


CI States

Latest PR Test (Base): ❌ Run #32101495165
Latest PR Test (Extra): ❌ Run #32101494926

sgl-project#30700 made should_fuse_mlp_allreduce_with_next_layer read
parallel.moe_ep_size and parallel.moe_tp_size, but the get_parallel mock
in the AMD gate test only carries tp_size, so every case raises
AttributeError. Set both to 1, which is the dense-TP configuration these
tests exercise.
@github-actions github-actions Bot added the amd label Aug 18, 2026
@kangwangamd

Copy link
Copy Markdown
Contributor Author

@wenscarl could you take a look? This is a test-only fix for the moe_ep_size AttributeError that has had test_aiter_allreduce_fusion_amd.py red on both AMD PR workflows since Aug-12.

@kangwangamd

Copy link
Copy Markdown
Contributor Author

Closing in favour of #35340, which makes the same change (moe_ep_size=1, moe_tp_size=1 on the get_parallel stub) and is already in @bingxche's hands for CI.

One data point in case it is useful: on stage-c-test-large-8-gpu-amd-rocm720 shard 3 (run 31916881653) the shard reports Test Summary: 3/4 passed — this file is the only failure, and all 4 tests in the class error out before their assertions. So the stub fix should green the whole 8-GPU shard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant