Repository navigation
Conversation
A decode window's routed experts run on the same item plan the prompt path and the NVFP4/FP8 MoE path already use, instead of tf_exl3_group plus the maxu x member-tile grid: the 9-slot picks are grouped by the Router into items of at most 16 pairs and the grouped GEMVs launch in standard mode on grids maxItems x (n/128) x (mats*sk), so at 64 rows ~325 blocks do work instead of ~55k and the one-block O(experts x pairs) group scan becomes the ranked plan. No 9->8 compaction and no copy back: the down epilogue writes ey's routed slot rows in place through tf_exl3_down_combine. The grouped kernel and tf_exl3_down_combine already take item triples in standard mode and a caller-chosen slot-row base, so no kernel change is needed: the plan reaches the decode as the same Items the prompt path takes, with the family's Router and the plan buffer the block already holds. Bit-exact: the glm-exl3-items GPU check compares the item plan's ey against the plain grouped decode byte for byte over distinct and lockstep (16/32/48/64-row) windows, and calls the plain launch shape directly so both paths stay covered. A wrong plan (a members offset off by one, a bad item first/count, the shared item not skipped) routes a slot to the wrong expert, so ey's bytes differ. A plan is refused (error.TileNotBuilt) for a non-mcg codebook, a non-zero wts or out, a zero ey, or a null plan array: the item kernels read one codebook a launch and write the caller's slot rows. Files: - zig/src/cuda/exl3_experts.zig: Items, runWith on the plan (standard mode), and fusedBytes/fusedScratch for the 9-slot layout without y. - zig/src/families/glm/cuda_exl3.zig: the decode branch on decodeItems, and scratchBytes sizing a decode arena with decodeBytes, the larger of the plain 8-slot layout and the 9-slot one, so no pool changes at GLM's shapes. - zig/tests/cuda/glm_exl3_items_tests.zig: the items decode against the plain launch, case by case.
Dims 512 alone only asked the item plan about small matrices. The check now also runs dims 4096 at the two widths a rank meets, 768 and 1024, one distinct window and one lockstep window each, with dims threaded through the weights, layer and pack helpers. Each shape carries an explicit case list, so 17 rows stays distinct: it is the only distinct window that spans two 16-pair items. The RESULT line counts the NaN tallies beside the byte comparisons, so this set prints 66 checks: 18 base cases and 4 served cases at three checks each.
# Conflicts: # CHANGELOG.md
main.zig is at its 600-line limit, so a second command can only ride on the lines glm-exl3 already has. Its dispatch now names both commands once and calls glm_exl3_tests.runCmd, which picks the expert check or the item-plan check by name, and the usage block names both commands on one line. The file contributes no new lines to a merge, and each command runs the check it did.
…kes; CHANGELOG credit (#2044) main's glm.experts.Kernels.load now takes ?cuda.experts32.Values as its last argument; null is the no-block-32 choice the old false made, as glm_exl3_tests.zig passes. The CHANGELOG bullet credits @BadAd84 and says the TP=3 decode numbers are the author's own run against main 673a34b.
Owner
Author
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: #2044 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.