Skip to content

[NPU] Enable DeepGEMM MegaMoE for DeepSeek V4.1 target decode - #50

Merged
ClownBin merged 15 commits into
randgun:dsv41-perf-1202from
BourneSun0527:codex/deepgemm-decode
Dec 3, 2026
Merged

ClownBin merged 15 commits into
randgun:dsv41-perf-1202from
BourneSun0527:codex/deepgemm-decode

Conversation

@BourneSun0527

Copy link
Copy Markdown

Enable the DeepGEMM-Ascend low-latency MegaMoE kernel for target decode and small verification batches on Ascend 950 with TP=attention DP=EP at 8 or 32 ranks. The target uses packed MXFP4 expert weights for both prefill and decode. DSpark can use a separately configured CANN draft provider.

The dispatcher uses shared DP row counts when available so idle ranks participate in the same kernel selection. The low-latency path is bounded by the configured decode capacity and the provider limit of 4096 rows.

Validation: Python compilation and git diff whitespace checks passed. A5 runtime, graph replay, accuracy and throughput validation are pending.

AkiYangDev and others added 15 commits December 3, 2026 15:33
- aclnnGemmSyrkGetWorkspaceSize grew an int8_t cubeMathType argument
  between 9.3.0-beta.1 and the 9.3.0 release; apply the call-site
  adaptation to the DeepGEMM worktree as cann93-release-syrk.patch.
- Record the patched-file digests in their Linux line-ending view and
  cover csrc/apis/aclnn.hpp as well; the previous digests were taken
  from a CRLF checkout and never matched a Linux prepare.
- Prebuild the cann_ops_transformer ops and the triton Ascend
  npu_utils host extension during prepare with the default toolchain
  headers: their g++-13 -std=c++20 builds fail at runtime against the
  GCC 11 include path kept for the device JIT.
Validated on 141.61.45.121, CANN 9.3.0 release, 8 x Ascend950DT:
offline 4096 finished=80, new_tokens=327680, measured_steps=10.

- Drop CPLUS_INCLUDE_PATH from the run-time vendor environment: the
  device JIT has not needed the GCC 11 headers on the 9.3.0 release,
  while they break the cann_ops_transformer ops and the triton Ascend
  npu_utils host builds (g++-13 -std=c++20). Opt back in with
  DEVICE_JIT_GCC11=1.
- Prepend the pip site-packages in vendor_env so the pinned pip
  cannbot-dsl 0.8.0 (tensor.reinterpret) shadows the cannbotdsl bundled
  with the host CANN release.
- Extend the adapter's mHC runtime gate to the 9.3.0 release after
  extraction; the beta.1 pilot kernel runs on it.
- Add run_all.sh: one-click offline tiers and the native vs DeepGEMM
  serve comparison with readiness polling and short smoke mode.
- runtime_libraries preloads the system libstdc++: the hcc toolchain
  dir first in LD_LIBRARY_PATH shadows it with a build missing the
  GLIBCXX_3.4.29 futex symbols, and mooncake (the default PD transfer
  backend) fails to import in the serve arm.
- run_all.sh wait_ready exits as soon as the server process dies
  instead of polling for the full 40 minutes.
Drop the defensive layers: model-path candidate scanning, precondition
re-checks, and duplicate idle checking (repro.sh already fails loudly on
all of those). Keep the one-line defaults, the readiness poll that dies
with the server, the SHORT smoke flag, and the per-tier summary print.
…emm-decode

# Conflicts:
#	python/sglang/srt/hardware_backend/npu/moe/config.py
#	python/sglang/srt/hardware_backend/npu/moe/deepgemm_prefill.py
#	python/sglang/srt/layers/moe/token_dispatcher/ascend_ops.py
#	test/registered/unit/moe/test_ascend_deepgemm_prefill.py
@ClownBin
ClownBin merged commit c716954 into randgun:dsv41-perf-1202 Dec 3, 2026
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.

4 participants