Repository navigation
Phase 5: NAIVE schedule, K/V overlap, performance baselines - #2
Merged
Merged
Conversation
…lines naive_ctrl runs the four NAIVE passes block by block (Z and P tiles round-trip through HBM, HBM grows to 2048 words). flash_ctrl gains double-buffered K/V prefetch (cfg_overlap). The tile core gains OP_NZ/OP_NM/OP_NP/OP_NPV. E2E: bit-exact O for FLASH and NAIVE, with and without overlap, traffic and tile counts exact, FLASH sequential cycles exact against the model, overlap and NAIVE cycles pinned in sim/perf_baseline.json.
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.
Summary
Phase 5 of the TinyAttention engine (Phase 0-4 are on
mainvia PR #1).naive_ctrl): the standard 3-pass safe softmax, run block by block. Z and P tiles round-trip through HBM (HBM grows to 2048 words). The four passes reuse the tile core through new operations: OP_NZ, OP_NM, OP_NP, OP_NPV.cfg_overlap, FLASH only): double-buffered K/V with a prefetch sequencer that loads tile kj+1 while tile kj computes.sim/perf_baseline.jsonpins busy cycles for FLASH (with and without overlap) and NAIVE over N, causal,cfg_qrowsand latency. The sequential FLASH values match the closed-form model exactly; overlap is checked never to be slower.Verification
bash sim/lint.sh:-Wallclean.bash sim/run_unit.sh: 15 suites pass.SEEDS=200 bash sim/run_e2e.sh: 3 tests pass. Bit-exact O for FLASH and NAIVE, with and without overlap, against the golden model, for every N, causal setting, block size and latency. HBM bytes, tile counts and K/V loads matchtraffic.py. The perf grid matches the baseline.Notes
docs/ARCHITECTURE.mdsection 10 for the design and measured numbers.