Skip to content

Deepseekv4 with npi - #1291

Open
ochougul wants to merge 22 commits into
quic:mainfrom
ochougul:deepsekv4_with_npi
Open

ochougul wants to merge 22 commits into
quic:mainfrom
ochougul:deepsekv4_with_npi

Conversation

@ochougul

Copy link
Copy Markdown
Contributor

No description provided.

@ochougul
ochougul marked this pull request as ready for review September 9, 2026 09:53
@ochougul ochougul changed the title Deepsekv4 with npi Deepseekv4 with npi Sep 9, 2026
ochougul and others added 10 commits September 10, 2026 14:49
Signed-off-by: ochougul <ochougul@qti.qualcomm.com>
Signed-off-by: ochougul <ochougul@qti.qualcomm.com>
Signed-off-by: ochougul <ochougul@qti.qualcomm.com>
Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
Signed-off-by: ochougul <ochougul@qti.qualcomm.com>
The raw sliding-window attention path in all four cache layers
(sliding, HCA, CSA) gathered context_length (the full ctx_len-wide
retained-state buffer) on every decode step instead of just the
sliding_window-wide recent window, and the model-level causal mask
was built at the same unnecessarily wide ctx_len. Both are now
narrowed to sliding_window width via a shared
_sliding_window_context_indices helper, removing O(ctx_len) wasted
attention/ReduceMax compute from every decode step without changing
model output.

Verified via the existing CPU parity tests (test_deepseek_v4_*, full
test_model_quickcheck.py suite unaffected) and by matching generated
token IDs on real QAIC hardware, before and after the fix, for both
the current ping-pong CSA cache and (previously) the legacy overlap
layout.

Signed-off-by: divytrip <divytrip@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek Kumar Singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek Kumar Singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
@abhishek-singh591
abhishek-singh591 force-pushed the deepsekv4_with_npi branch 2 times, most recently from d281635 to 15bd6f9 Compare September 23, 2026 06:07
Signed-off-by: Abhishek kumar singh <sabhis@qti.qualcomm.com>
divytrip3005 and others added 2 commits September 24, 2026 20:10
Signed-off-by: divytrip3005 <divytrip@qti.qualcomm.com>
(cherry picked from commit 9b9e932e0fa81856e0d52f49138907fa4e94946a)
perf(deepseek-v4): fold sliding attention cache

This branch has not been deployed

No deployments
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.

3 participants