Skip to content

Matrix SRAM L-Compute for Mamba/KDA recurrence - #116

Draft
Happymic wants to merge 1 commit into
mainfrom
review/matrix-lcompute-20260905
Draft

Matrix SRAM L-Compute for Mamba/KDA recurrence#116
Happymic wants to merge 1 commit into
mainfrom
review/matrix-lcompute-20260905

Conversation

@Happymic

@Happymic Happymic commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

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_TILE instructions 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-lcompute

The ISA specification records the remaining encoding and hardware questions: viewed M_MM_WO reinterprets old immediate bit 17, and L_TILE's FP32 intermediates still need physical resource mapping.

@Happymic
Happymic force-pushed the review/matrix-lcompute-20260905 branch from 2cd96e2 to ce58691 Compare September 5, 2026 19:42
@Happymic Happymic changed the title [Review only] Banked Matrix SRAM L-Compute simulator and evidence Execute Mamba/KDA recurrence with banked Matrix SRAM Sep 5, 2026
@Happymic
Happymic force-pushed the review/matrix-lcompute-20260905 branch from ce58691 to 0e7effa Compare September 5, 2026 19:47
@Happymic
Happymic force-pushed the review/matrix-lcompute-20260905 branch from 0e7effa to 44693ed Compare September 5, 2026 20:16
@Happymic Happymic changed the title Execute Mamba/KDA recurrence with banked Matrix SRAM Execute Matrix SRAM views and L_TILE primitives Sep 5, 2026
@Happymic Happymic changed the title Execute Matrix SRAM views and L_TILE primitives Matrix SRAM L-Compute for Mamba/KDA recurrence Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant