Conversation
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.
Motivation
When one request contains multiple cache misses, each missed segment must begin
from the accumulated state of everything preceding it, including cached
segments between misses. The previous GDN and KDA addition paths seeded only
the first miss and ignored prompt order, so later misses lost causal state and
earlier misses could receive state from future cached segments.
The request state also needs to retain cached segments after the final miss.
Modifications
prefix before every miss
recurrent state
contain a multi-miss request
Transition matrices are not introduced into addition mode.
Accuracy Tests
The deterministic regression uses:
For
miss(S=1) → hit(S=10) → miss(S=2) → hit(S=20), it verifies:The tests exercise the GDN and KDA addition orchestration while replacing only
the hardware-boundary kernels with deterministic CPU implementations. No
full-model or GPU numerical accuracy claim is made.
Speed Tests and Profiling
A batch containing a multi-miss request performs two recurrent passes over its
miss segments: one to obtain reusable zero-start states and one to produce
causally seeded outputs. Batches where every request has at most one miss retain
the existing one-pass behavior.
The additional workspaces are allocated only for multi-miss addition batches
and reused by later calls. No end-to-end performance claim is made.
Test Plan
test/registered/unit/layers/attention/linear/test_pic_addition.py— 5 passed.Coverage includes:
Closes #2.