Repository navigation
Model K: streamline narrow stages and compact head - #288
Merged
Merged
Conversation
Use prewidened FP32 bias planes and folded weight offsets in the two-window narrow kernels. Pack the 32 live compact-head rows into two WMMA tiles. Rebind the K softmax source digest after native D3D12 backend 3 k_smx_test=report reproduced all 133 stored hashes in each of the mix and round-to-odd forms with zero mismatches. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Keep the original 48-row head in KBlkParams and pass the compact head and bias plane as separate D3D12 arguments. Require the narrow ports and their argument signatures for hybrid and native contexts. Refuse missing argument values before hybrid argument packing. Replay both d1 forms and the compact head against the original HIP arguments. Check the packed row permutation on the host and reject a compact-bias full-head shader at compile time. Rebind the softmax source digest to a47546460b78b46b3ae0775661c6c4160ad20af09b6106c16322f8d164136264. The native backend-3 k_smx_test=report reproduced 133/133 stored HIP hashes for each of mix and round-to-odd, with zero hash or probe mismatches. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
What changed
Prewiden the FP16 bias planes and fold weight offsets for Model K's narrow e0, e1, d1, and compact d0 stages. Pack the 32 live d0 head rows into two WMMA tiles and preserve the logical row mapping for the compact and hidden epilogues. Rebind the softmax source digest after the native report gate passed.
Initial timing against eff8ed7
Four alternating ABBA/BAAB blocks per shape, 1,500 frames per leg. A and B used the same runtime build flags and loaded DXIL from disk. A's reviewed phi-fast shaders were verified against the
eff8ed7source tree.1b975fbba17891e35fb3d1ab49ad8f90Gates
eff8ed7and REFS. Forced round-to-odd also matched all 600 odd frames and six saved frames. The odd raw state and output comparison matched 516,093,680 bytes, including compact and full head and recurrent state.k_smx_test=reportreproduced 133 of 133 stored HIP hashes in each of mix and round-to-odd, with zero hash or probe mismatches.Review fixes
Head 731ba36 passes the compact d0 head and FP32 bias plane as separate D3D12 arguments and preserves the original 48-row head in the shared stage parameters. The hybrid runtime refuses missing or incompatible narrow ports and rejects null argument storage before packing.
The replay passes the original arguments to HIP and supplies the packed weights and bias planes to D3D12. The head row test covers every pixel and hidden channel, and DXC rejects a full-head shader built with the compact bias plane.
Four alternating ABBA/BAAB blocks per shape used 1,500 frames per leg against eff8ed7. The noise floor is max(5 us, twice max A/A).
1b975fbba17891e35fb3d1ab49ad8f90