WIP: support deepseek v3.2 used Pytorch model - #2076
Draft
sunbaosong wants to merge 1 commit into
Draft
Conversation
XuZhang99
reviewed
Jul 30, 2026
| // construct_quant_lightning_indexer_output_tensor. For TND query + PA_BSND key | ||
| // the selected-count axis is sized by the key's head axis; BSND query adds the | ||
| // extra batch axis. | ||
| at::Tensor construct_lightning_indexer_output_tensor( |
… fix DeepSeek-V3.2 W8A8 adaptation for Ascend NPU, with xllm-vs-vllm bit-exact alignment and multinode correctness. Squashes the adaptation + four fixes: - feat: absorbed-form MLA + W8A8 (static/dynamic) + MoE + TP adaptation (npu_grouped_matmul, npu_moe_init_routing_v2, npu_moe_token_unpermute, npu_swiglu / npu_dynamic_quant, SFA). - fix: align W8A8/MLA ops with vllm for bit-exact precision (single-card + TP=2: gate -> topk -> dispatch -> gmm1 -> gmm2 -> combine -> AR all bit-exact). - fix: gate o_proj quant_bias to tp_rank==0 (row-parallel; was double- counted by all_reduce at TP>=2). - fix: align MoE with vllm CANN ops (routed_scaling applied post-combine pre-AR, sum-then-reduce AR structure) for TP=2 bit-exact. - fix(multinode): use the framework's GLOBAL tp_rank (config["tp_rank"], = tp_group_->rank()) for weight sharding instead of the local device index (_tp_rank_from_device returns 0..7 on every node). The local rank made every node load the same first N/per-node shards (missing the rest, cross-node duplicated) -> all_reduce double-counted + MoE expert weights partly loaded -> L13 MoE explosion -> garbled output on 16-NPU multinode. Verified: single-card + TP=2 5L bit-exact with vllm; 16-NPU 2-node multinode output coherent (was garbled). Pre-squash individual commits preserved on branch backup/dsv32-pre-squash. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Description
Related Issues
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes