Matrix SRAM L-Compute for Mamba/KDA recurrence - #116
Draft
Happymic wants to merge 1 commit into
Draft
Conversation
Happymic
force-pushed
the
review/matrix-lcompute-20260905
branch
from
September 5, 2026 19:42
2cd96e2 to
ce58691
Compare
Happymic
force-pushed
the
review/matrix-lcompute-20260905
branch
from
September 5, 2026 19:47
ce58691 to
0e7effa
Compare
Happymic
force-pushed
the
review/matrix-lcompute-20260905
branch
from
September 5, 2026 20:16
0e7effa to
44693ed
Compare
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.
This PR implements Matrix SRAM L-Compute for Mamba-2 and KDA recurrence. The compiler places state tiles in PLENA's fixed diagonal SRAM layout and generates
L_TILEinstructions to process groups of logical rows. Rust executes those instructions, updates the state, and writes the results through the SRAM and HBM data path.The Compiler → assembler → Rust path has run four consecutive tokens using prepared synthetic BF16 inputs at the model state dimensions. With the phased layout, all outputs and the final state match the reference exactly, with zero bank stalls. A separate integration test also verifies projection writeback into a Matrix SRAM view.
This is a draft for architecture and implementation review; do not merge. The paired Compiler PR #79 is pinned by the submodule. The completed path is the recurrence core; full-checkpoint execution in Rust and RTL resource mapping remain future work.
Reproduce and implementation notes
On Linux with Nix flakes enabled:
git clone --branch review/matrix-lcompute-20260905 https://github.com/AICrossSim/PLENA_Simulator.git cd PLENA_Simulator git checkout 44693edaf041de7ddc922a1f50fdc735cbc59068 git submodule update --init --recursive nix develop --no-write-lock-file --command just test-matrix-lcomputeThe ISA specification records the remaining encoding and hardware questions: viewed
M_MM_WOreinterprets old immediate bit 17, and L_TILE's FP32 intermediates still need physical resource mapping.