Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
|
Friendly ping for a maintainer — this PR is stalled on one thing that needs write access, and it is not in the diff. The workflow runs need approval. Every About the red
|
TileFmhaBatchPrefillTraits and fmha_fwd_batch_prefill_traits_ both take kHasSink_ between kSkipMinSeqlenQ_ and kPageBlockSize_, but the batch prefill codegen never emitted it. Every argument after that slot shifted by one, so a generated instance expanded to kSkipMinSeqlenQ_ = false, kHasSink_ = 16, // page size kPageBlockSize_ = LINEAR_LAYOUT, // memory layout enum kKVMemoryLayout_ = VLLM_BLOCK_TABLE_2D // lookup table enum which is ill-formed: int to bool is a narrowing conversion, and two scoped enums bind to parameters of unrelated types. The dispatcher batch_prefill path therefore did not compile on any architecture. Emit the flag in both traits lists. The added test parses the generated argument list and pins each trailing parameter to its slot; it fails before this change with 15 arguments instead of 16. Signed-off-by: He Jin <Jin.He@amd.com>
f585988 to
ad4db5e
Compare
Fixes #12093
Summary
The dispatcher's batch prefill codegen emits an ill-formed traits list
on every architecture.
kHasSink_is never emitted, so every argumentafter it shifts one slot: the page size lands in a
boolparameter, andtwo scoped enums bind to parameters of unrelated types. The batch prefill
path does not compile anywhere.
kHasSink_in both batch prefill traits lists indispatcher/codegen/fmha/codegen.py— two linesOnly the dispatcher is affected. The example generator
example/ck_tile/01_fmha/generate.pyemits the list correctly.What goes wrong
TileFmhaBatchPrefillTraitsandfmha_fwd_batch_prefill_traits_bothdeclare
kHasSink_betweenkSkipMinSeqlenQ_andkPageBlockSize_.Codegen skipped it, so a generated instance expanded to:
inttoboolis a narrowing conversion in a converted constantexpression, and the two enums bind to unrelated parameter types — three
separate errors from one missing argument.
The fix emits
{_bool_cpp(sig["sink"])}in both lists. The argument thatwas missing is the
falsenow at index 12, immediately before the pagesize.
Test Plan
cd projects/composablekernel/dispatcher/tests python3 -m unittest test_fmha_codegen test_fmha_rulesBoth tests share a
_batch_prefill_traits_argshelper that runs codegenfor a gfx950 batch prefill config and parses the generated
TileFmhaBatchPrefillTraits<...>argument list.test_batch_prefill_traits_pass_sink_before_page_sizepins each trailing parameter to its slottest_batch_prefill_sink_slot_tracks_the_signaturesweepssinkover both values and requires slot 12 to follow itThe second test is needed because slots 11 (
kSkipMinSeqlenQ) and 12(
kHasSink) are adjacent bools: asserting only that each is"true"/"false"still passes if the two are swapped, or if the sinkflag is emitted as a constant.
gfx950 rather than an RDNA target on purpose. The traits list is emitted
identically everywhere, so the defect is not arch-specific — but on RDNA
validate_configrejects the batch prefill pipeline before codegen runs,leaving the test nothing to parse. A CDNA target keeps this PR
independently testable.
Test Result
Each test was checked against an injected mutant rather than trusted on
its face:
15 != 16falseThe last two rows are the blind spot the second test was added for.
Submission Checklist
ruff-formatclean; no C++ changed; all 8 pre-commit hooks passorigin/develop4606f83174