Repository navigation
Conversation
PixelFlat
requested review from
DongheJin,
DragonFive,
JimHsiung,
Kang-Meng,
XuZhang99,
liutongxuan,
xiao-yu-chen,
yingxudeng and
zhang-minchao
as code owners
December 3, 2026 09:52
PixelFlat
force-pushed
the
codex/feat/v41-ascend-kernel-package
branch
from
December 3, 2026 10:01
cb9ab2e to
2d886a0
Compare
wai-bao
previously approved these changes
Dec 4, 2026
PixelFlat
force-pushed
the
codex/feat/v41-ascend-kernel-package
branch
from
December 4, 2026 10:00
bb7ac3a to
6fbebc8
Compare
XuZhang99
reviewed
Dec 4, 2026
Collaborator
There was a problem hiding this comment.
rename to deepseek_v41_quant_indexer.cpp
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.
Scope
This operator prerequisite is split out of #2844. It packages the Ascend A3 operators needed by DeepSeek V4.1 Flash that are outside the external CANN interfaces in #2950. Model integration, Python ACL Graph and the embedded fixed-step DSpark draft will follow after this operator PR lands.
CANN interfaces from #2950
57e01c16aand provides the genericsparse_flash_mla,sparse_flash_mla_metadata,quant_lightning_indexer_v2andquant_lightning_indexer_v2_metadataoperations. The model will use its external MLA and matching metadata together. The merged provider uses thecann_ops_transformerpackage and matching OPP in the CANN 9.3 environment.quant_lightning_indexer_v2_vaandquant_lightning_indexer_v2_metadata_va. V2 VA returns selected token IDs and candidate block IDs. V3 also produces valid block counts consumed by the sparse metadata and indexer on device.6fbebc8e3removes the local MLA device sources, AICPU metadata, native binding, registration and build rules. QLI retains its own AICPU metadata. This PR uses the existingthird_party/xllm_opsrevision.Validation
On the rebased head, the SDK-free kernel package build, kernel selection (24 passed), changed-file pre-commit hooks and
git diff --checkpassed. The combined catalog contains 112 unique operation names. The four generic MLA/QLI V2 entries resolve to the external backend declarations and the four candidate QLI entries resolve to this PR's AscendC backend declarations.A3 results before the CANN 9.3 rebase
python setup.py buildpassed on Ascend A3 with CANN 9.0, using a fresh AscendC vendor build directory. The resulting vendor library exports the candidate QLI V3 and sparse metadata entry points and contains no private SparseFlashMla implementation.b4f0d976e. All 110 operation names in the combined catalog are unique. The four generic names resolve to the external CANN callables, and the four candidate QLI names resolve to the package's native bindings. One ACL Graph ran candidate generation, sparse QLI selection and the external CSA attention together at device KV lengths of 1,024, 768 and 1,024. It returned 512 distinct valid token IDs and matched the reference attention result on all three replays.ops-transformer@814116886and its compatible OPP runtime. The older wheel in the A3 development image lacks themla_prologexport checked during refactor: integrate cann9.3 ops-transformer operators into xllm-kernel. #2950 provider initialization. All nine BF16 SWA/CSA shapes matched the previous package's full outputs bit-for-bit. Each graph captures metadata generation and attention together. Replaying with device KV lengths of 4,097 and 16,384 matched eager execution and sampled FP32 attention references. A separate six-query private SWA test varied the valid count for each row across replays (128, 64, then 128). For a model without a learned sink, the caller supplied an FP32-infper query head, preserving the previous softmax result. The follow-up model PR needs to carry this convention into its adapter.MLA provider comparison
Same A3 device, 16,384-token context, 16 query heads, one KV head, head dimension 512, page size and sliding window 128, compressed TopK 512. Each value is the mean of two run medians in microseconds. The provider order was external / previous / previous / external. Each run timed 21 warmed ACL Graph replays of four successive metadata-plus-attention calls, normalized per call. The table reports operator timing. End-to-end serving performance belongs to the model integration PR.
A3 QLI consumer timing
Device P50 in microseconds for one metadata operation and one INT8 indexer, timed together inside an ACL Graph. Each of eight requests sees 16,384 keys. TopK is 512 and each candidate block covers eight keys. Both paths selected the expected token IDs. Each sample contains four repetitions, with 21 timed samples after warmup.