Repository navigation
[Refactor] [Ascend] dsa: Align index K cache and scale layout with GPU - #47640
Open
dqh1900013087-tech wants to merge 17 commits into
Open
dqh1900013087-tech wants to merge 17 commits into
dqh1900013087-tech wants to merge 17 commits into
Conversation
Reuse the GPU Triton writer through an NPU wrapper, read packed index pages with QLI, and adapt host cache accounting. Include writer, graph replay, and packed reader integration tests. Keep the original CPU backup and restore implementations. Packed index cache CPU backup and restore are outside this experiment.
dqh1900013087-tech
requested review from
Ying1123,
hanming-lu,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
October 31, 2026 10:30
dqh1900013087-tech
requested review from
1am9trash,
Fridge003,
HaiShaw,
YAMY1234,
alphabetc1,
huangtingwei9988,
hubertlu-tw,
hzh0425,
iforgetmyname,
ispobock,
kkHuang-amd,
ping1jing2,
rainj-me and
whybeyoung
as code owners
October 31, 2026 10:30
dqh1900013087-tech
requested review from
BBuf,
DarkSharpness,
HydraQYH,
celve and
yuan-luo
as code owners
November 4, 2026 07:00
This was referenced Nov 6, 2026
This branch has not been deployed
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
Align the NPU DSA index K cache and K scale storage layout with the GPU implementation while preserving inference performance and model accuracy.
Previously, the NPU implementation stored quantized index keys and their scales in separate buffers. This PR adopts the same packed page layout as GPU, storing FP8 keys and FP32 scales in a single allocation and writing them together.
Modifications
Accuracy Tests
test/manual/ascend/test_dsa_index_k_cache.pytest/manual/ascend/test_dsa_packed_integration.pySpeed Tests and Profiling
The cache writer combines key and scale writes into one Triton kernel launch. The packed indexer is invoked through the registered Torch operator with device-side sequence metadata.
The goal is to align the cache layout without introducing a performance regression.
Baseline versus PR latency, throughput, and profiling results: pending.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci.CI States
Latest PR Test (Base):⚠️ Run #41796358986⚠️ Run #41796358746⚠️ Run #41796358870
Latest PR Test (Extra):
Latest PR Test (AMD ROCm 10):
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: