Repository navigation
Conversation
…below the GEMM tile Below 64 rows a routed prompt plan cut every expert into items of 8 pairs, the shared expert too. The shared expert holds every row whatever the routing, so a prompt of N rows ran it as ceil(N / 8) items, each reading its weights again. `tf_moe_route` now takes the shared expert's id and a tile of its own. In a prompt pass (`Ops.prefill`, outside a lane round) the stacked shared expert is cut at the GEMM tile, 128 rows, so below 128 rows it is one item; the routed experts keep `tile_for`'s rule. Decode, lane rounds and the MTP draft head keep the 8-row tile for every expert, and tp ranks and Nemotron, which do not stack it, pass none. The routed launches' m stays the most rows an item holds (`itemRowsFor`): the K-parallel tiers that do not loop cover only m rows of an item and fit by it. The registry ignores m when it prices a routed prompt plan, so the kernel chosen does not change. The served fixture and `routedShape` plan as serving does. The route tests move to kernel_tests/route.zig.
… from 33 rows A routed prompt plan cut its routed experts into 8-pair items below 64 rows on every card. On gfx1151 the 35B-A3B's plan of 33 or more rows already runs on the 64-row routed tile, which takes an item of up to 64 rows in one block, so the 8-pair items only split each busy expert's rows into more items. gfx1151's tuning table now sets `prompt_block_from = 33`: the fewest rows a prompt pass's routed plan cuts at the 128-row GEMM tile. It serves only the chip the table is named after (`promptBlockFrom`), so gfx1150, gfx1152 and gfx1153, which share the table's costs, and the other cards keep 64. `tile_for` reads it for prompt passes only (`Ops.prefill`): decode, lane rounds and the MTP draft head keep the 8-row tile below 64 rows. The launches' m stays the most rows an item holds (`itemRowsFor`), and the fixtures plan with the card's start. The bytes hold: a prompt tile writes the same bits however a prompt's rows are cut into items, which the served fixture checks entry by entry, and the routed launches still cover every row of every item.
tf_moe_route joins the contract as the engine launches it: a prompt pass with the GEMM tile from 33 and from 64 rows, a prompt pass with no stacked shared expert, decode with the MTP draft head, and a lane round. Gates 1 and 3 check every member and item exactly against the contract's own statement of the cut, gate 2 repeats it behind guard bytes, and gate 4 has no sums to check. Two planted controls go red at gate 3: the stacked shared expert cut at the routed 8-row tile, and a prompt planned from 64 rows where the GEMM tile starts at 33. Its launch record holds ROCm 10.1's usage on every served chip.
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.
CI for a landing train: #3521 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.