Repository navigation
[CK] Emit both gfx942 and gfx950 MoE instances in a dual-arch build - #8397
jatseng-ai wants to merge 1 commit into
Conversation
get_gfx() returns the last GPU_ARCHS entry, so a gfx942;gfx950 wheel dropped the gfx942 MulABScale instances that tuned swiglu_limit rows name. Co-authored-by: Cursor <[email protected]>
🏷️ 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 |
|
Closing this in favor of #8353. The codegen commit is now |
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
|
Closing again. This codegen change is already on #8353. The reopen was only a way to retrigger the old Actions run, and that run is no longer needed. |
Summary
GPU_ARCHS=gfx942;gfx950wheel callsget_gfx(), which returns only the last entry. CK MoE codegen then emits the gfx950 instance list and drops the gfx942MulABScaleinstances.RuntimeError: Unknown or incompatible CK MoE kernel: moe_ck2stages_gemm1_256x16x64x256_1x4_MulABScale_...for per-token SiLU limit 7.0, the row ina8w8_plain_tuned_swiglu_limit_fmoe_gfx942.csv. Limit 1.0 has no row, takes the gfx950 heuristic, and passes, because those instances already run on gfx942.get_gfx(). gfx942-only tiles are instantiated for the host and the gfx942 device pass, and left out of the gfx950 device pass. A tuned row still wins, and the configurable limit stays.This is the CI failure that showed up on #8353 after the dispatch crash was fixed. #8353 keeps CK-capable clamped calls on CK. This PR makes the tuned CK kernel exist in the dual-arch wheel.
Test plan
pytest op_tests/test_moe_ck_codegen_arches.py(no GPU, no hipcc). BothGPU_ARCHSorders put every kernel name from the gfx942 swiglu-limit CSV in the lookup, plus a gfx950TypeCasttile. The heuristic element op follows the last arch.GPU_ARCHS=gfx942does not gain gfx950 names or the device guard.GPU_ARCHS=gfx942;gfx950) andtest_plain_fp8_swiglu_limiton MI300X. The gfx942-only tiles were not compiled here.PR Self-Review
Reviewed revision
1351bf1
Behavior and intent
A dual-arch CK MoE prebuild now contains the gfx942 instance list as well as the gfx950 list.
get_gfx()still selects the heuristic, so an untuned call dispatches exactly as before. Tuned CSV rows that name a gfx942MulABScalekernel find that kernel in the lookup instead of raisingUnknown or incompatible CK MoE kernel. The existing behavior is insufficient becauseci:mi300xprebuilds withGPU_ARCHS=gfx942;gfx950andget_gfx()keeps only gfx950, so those tuned rows cannot run from the wheel.Validation and unverified scope
Validated with
pytest op_tests/test_moe_ck_codegen_arches.pyon the codegen output only, no GPU and no hipcc. It checksGPU_ARCHS=gfx942;gfx950andgfx950;gfx942againsta8w8_plain_tuned_swiglu_limit_fmoe_gfx942.csv, and checks that a gfx942-only build is unchanged.Not validated: a dual-arch hipcc compile of the new gfx942-only instances, and the numerical
test_plain_fp8_swiglu_limitrun on MI300X. The guard assumes those tiles compile for gfx942 and do not need to compile for gfx950.PR-specific question
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
test_moe_ck_codegen_arches.pyfails before this PR because the generated lookup forGPU_ARCHS=gfx942;gfx950does not contain the gfx942MulABScalenames from the tuned swiglu-limit CSV.test_plain_fp8_swiglu_limithits the same miss only after a dual-arch wheel is built and only on the tuned limit, so it does not guard the codegen itself. This test runs gen_instances with no GPU and fails on the missing name directly.Changed op tests
op_tests/test_moe_ck_codegen_arches.pycovers the dual-arch lookup, the heuristic element op, and the gfx942-only device guard. It is not redundant withtest_plain_fp8_swiglu_limit: that test needs the prebuilt module and a GPU, and the crash only appears once dispatch gets paststage1 is None. This test checks the generated sources for bothGPU_ARCHSorders without compiling.Made with Cursor