Repository navigation
Conversation
A data-parallel rank with no tokens in a step still runs its LM head with zero rows. Since #8031 the gfx1250 BF16 rows for DeepSeek-V4.1-Flash's LM head (N=129280, K=5120) name the FlyDSL TDM HGEMM, whose config check rejects M=0, so DP attention + EP serving stops at the first batch. Return the empty [*, N] result (or the caller's out) before the tuned lookup, so no backend sees M=0. op_tests/test_gemm_a16w16.py -t zero covers 2-D and 3-D inputs with and without out=.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
|
This looks like the same fix as #8960 (same root cause: M=0 dummy steps on gfx1250 get routed to FlyDSL TDM, whose validator rejects a zero-dim input, hanging the serving rank's collective — see #8958). #8960 lands the early-return at the same call site but with broader test coverage (all tuned backends, 2D/3D, bias/out=, plus an end-to-end c32 validation run), so I'd suggest consolidating on that one to avoid two PRs touching the same guard. Happy to help reconcile if there's something here that #8960 is missing — otherwise might be worth closing this in favor of #8960 once it merges. |
|
Closing in favor of #8960. |
Summary
_gemm_a16w16returns an empty[*A.shape[:-1], N]result (or the caller'sout) when the input has no rows, before the tuned-config lookup.Motivation
On gfx1250, DeepSeek-V4.1-Flash served with DP attention + EP (DEP4,
ATOM_DP_LM_HEAD_MODE=allgather) stops at the first batch: three of the four DP ranks raise in the LM head GEMM and the fourth waits for them.The failing call is
M=0, N=129280, K=5120(BF16): a DP rank with no tokens in the step still runs the LM head, with zero rows. Since #8031 the tuned gfx1250 rows for this shape name the FlyDSL TDM HGEMM, whose config check rejectsM=0. Before #8031 the same call returned an empty result.Changes
aiter/tuned_gemm.py:_gemm_a16w16returns early forM=0, so no backend sees an empty input and the result does not depend on which kernel a tuned row names.op_tests/test_gemm_a16w16.py: new-t zerocase.Testing
Tested on MI455X (gfx1250); see below.
Documentation
Internal early return; no API or documented behavior changes.
Dependencies
Breaking Changes
None
PR Self-Review
Reviewed revision
To be filled from the automated PR Self-Review comment.
Behavior and intent
tgemm.mm/gemm_a16w16with zero rows returned an empty result before #8031 and raises on gfx1250 after it, for every shape whose tuned row names the TDM kernel. It now returns the empty result for any backend.Validation and unverified scope
Direct call
tgemm.mm(x[M, 5120], w[129280, 5120])on one MI455X, with the DeepSeek-V4.1-Flash BF16 tuned-config list:2989e550f(before #8031)9da592818(main, 2026-11-27)9da592818with #8031 reverted9da592818+ this changeEnd to end on one MI455X node (4 GPUs), image
rocm/fw-bringup-mlperf:gfx1250-atom-ci455-20261128(ATOM380aeb8a0, aiter9da592818), DeepSeek-V4.1-Flash DEP4 server:Commands:
python3 op_tests/test_gemm_a16w16.py -t zeropasses;black --checkandruff checkpass on both files.-t outfails on gfx1250 with and without this change (torch bf16+bias: routed to triton), unrelated. Not run on gfx942 / gfx950.PR-specific question
To be answered after the automated PR Self-Review comment.
Changed op tests
op_tests/test_gemm_a16w16.py:test_gemm_zero_rows(-t zero) runsM=0for a 2-D[0, 5120]and a 3-D[2, 0, 5120]input against the 129280 x 5120 LM head weight, with and withoutout=, and checks the result shape, dtype and thatoutis returned. No existing case coversM=0.