fix(projection_asm): correct single-pass matmul emission#62
Merged
Conversation
Two fixes in the single-pass (num_k_tiles <= MAX_K_TILES) path: - Remove three stray `break`s that truncated the K-loop to a single tile, so the matmul only computed 1 of N K-tiles. - Scale the within-group weight-row offset by MLEN. Matrix SRAM is row-granular (one output feature per row), so the offset must be in rows ((wr % (mlen//blen)) * blen * mlen), not elements — otherwise the BLEN output features in a group aliased to the same weights. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Two correctness fixes in the single-pass (
num_k_tiles <= MAX_K_TILES) projection path. Required by PLENA_RTLkev/linear(PR AICrossSim/PLENA_RTL#44) to bring thelinearworkload to a passing state.breaks that truncated the K-loop to a single tile, so the matmul only computed 1 of N K-tiles.(wr % (mlen//blen)) * blen * mlen, not* blen(element units, which got dropped by the SRAM's row-granular address translation and made the BLEN output features of a group alias to the same weights).Testing
Verified end-to-end via PLENA_RTL
just rtl-sim linear→ PASSED (95.31%).