Repository navigation
Batch TONN running-sum circuits into one scan - #67
Merged
AvnehSBhatia merged 1 commit intoNov 22, 2026
Merged
Conversation
(cherry picked from commit 539e025)
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
I,MI,MIM,EP,GIandSMinto one scan per TONN layer. Fixed-only layers keep the FFT, and layers with token-dependent gates run one prefix scan across all six types present.Experiment result
The speed harness timed forward, backward, and optimizer steps on arm64 CPU with one PyTorch thread. Both versions used the same
tinyTONN model (127,432 parameters), seed-0 initialization and input, batch size 8, 25 warm-up steps, and 150 timed steps. Each context used three interleaved baseline and batched runs. Retrieval and generation were disabled.A separate parity check against the archived implementation used seeds 0 and 1 with all six running-sum types in a single layer. Maximum absolute differences were 4.77e-7 for outputs and 1.16e-9 for input and parameter gradients.
Reproduction
Run with the PR code checked out and the same Python environment for both versions.
Validation
The full local suite reported 259 passed in 78.28 seconds with no failures or skips.