Repository navigation
test(marlin): derive large-K tile expectation from SM count - #6672
Merged
Merged
Conversation
`test_large_k_keeps_narrow_when_it_still_splits_k` hard-coded the narrow 128x64 tile for five large-K shapes. That contract was measured on 128-SM Ada parts, where 64 narrow output tiles still leave room for two K blocks per tile. On the 48-SM GB10 the same 64 tiles already exceed the SM count, so the planner correctly keeps the wide tile; the test failed on every shape although the kernel was correct (verified against the FP64 oracle and a wide-vs-narrow benchmark). Derive the expected tile from the device's SM count and the narrow tile's actual K-split, including #5281's four-way rule for 16-row tiles. The test still pins the narrow tile on 128-SM parts and now expects the wide tile on 48-SM parts. Mutation check: forcing the planner to always prefer narrow makes all five cases fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_large_k_keeps_narrow_when_it_still_splits_khard-codes the narrow{threads=128, thread_n=64, thread_k=128}tile for five large-K shapes. Thatcontract was measured on 128-SM Ada parts, where the narrow tile's 64 output
tiles still leave at least two threadblocks per tile to split K. On the 48-SM
GB10 the same 64 output tiles already exceed the SM count, so the planner
correctly keeps the wide tile; the test failed on every shape although the
kernel was correct.
No issue number: this was found by a GB10 regression sweep, not filed upstream.
What Changed
_large_k_expected_tile, which derives the expected tile from thedevice's SM count and the narrow tile's actual K-split, including [PERF] Regression from #5216: Marlin small-grid 128x64 tile override ignores K - large-K decode (Llama-8B/7B down_proj, K=14336/11008, N=4096) 1.1-1.33x slower on sm_89 at M=4/16/128 #5281's
four-way rule for 16-row tiles.
test_large_k_keeps_narrow_when_it_still_splits_know asserts that derivedtile instead of the constant narrow tile. On 128-SM parts it still pins the
narrow tile; on 48-SM parts it expects the wide tile.
No production code changed. The two "AllSpark rejects sm_121" GPU tests are
left untouched; they are by design.
Tests
Measured Impact
Wide vs narrow tile on the 48-SM GB10, fp16, min of 5 trials x 200 iterations
after warmup (CUDA events; auto output matched the wide tile bitwise):
The narrow tile is not "clearly faster" on 48 SMs: it is 17% slower at M=128
and within run-to-run noise elsewhere. Both tiles match the FP64 oracle on
these shapes (max errors 0.0104-0.0211), so the planner's wide choice is valid
and the test's constant was the stale part.
Model Support / Module Plan
Not applicable: test-only change.
AWQ onboarding safety
Not applicable: no AWQ changes.
Logic Flow Documentation
Not applicable: test-only change; no runtime selection or data flow changes.
Review Requirements
I or an AI agent (such as Codex or Claude) have:
Kernel Accuracy Requirements
Not applicable: no kernel changed. The existing test still compares every
launch with an independent FP64 oracle, and the five affected shapes were
checked with both tiles during the benchmark.
Notes
The 48-SM GB10 cannot give the narrow tile two K blocks per output tile for
these shapes. The helper models that hardware constraint, not a hard-coded SM
number: on a 128-SM part it returns the narrow tile and the test still pins
#5281's choice. The mutation check confirms the test fails when the planner is
forced to pick narrow on GB10.