Skip to content

[10b/n] Migrate custom all-reduce, DeepSeek V4 fused MLA, MiniMax reduce-RMS, and MXFP8 MoE to libtorch stable ABI - #44365

Merged
Harry-Chen merged 3 commits into
vllm-project:mainfrom
cleonard530:new-stable-abi-phase10b
Jun 3, 2026
Merged

[10b/n] Migrate custom all-reduce, DeepSeek V4 fused MLA, MiniMax reduce-RMS, and MXFP8 MoE to libtorch stable ABI#44365
Harry-Chen merged 3 commits into
vllm-project:mainfrom
cleonard530:new-stable-abi-phase10b

Conversation

@cleonard530

@cleonard530 cleonard530 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Purpose

Continues the libtorch stable ABI migration by moving several kernels out of legacy _C and into _C_stable_libtorch.

This PR migrates custom all-reduce, DeepSeek V4 fused MLA, MiniMax reduce-RMS, and MXFP8 MoE kernels from legacy _C to _C_stable_libtorch, converting host code to stable torch APIs and moving CMake/bindings accordingly. QuickReduce stays on legacy _C for ROCm-only builds

cc @janeyx99 @Harry-Chen

See 7fc426c to see diffs. A few files look like created/deleted instead of moved otherwise.

Test Plan

pytest tests/kernels/test_fused_deepseek_v4_qnorm_rope_kv_insert.py 
pytest tests/distributed/test_custom_all_reduce.py 
pytest tests/kernels/core/test_minimax_reduce_rms.py 
pytest tests/kernels/moe/test_cutlass_mxfp8_grouped_mm.py (needs Blackwell GPU to run)

Test Result

image image (Same test is failing on main branch) image uv ---
Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Migration progress using the Audit Python extension torch-abi-audit:

main branch

  -- extensions --
    [UNSTABLE] [abi3-ok               ] _C.abi3.so  (stable_shim=0, unstable=78)
    [STABLE  ] [abi3-ok               ] _C_stable_libtorch.abi3.so  (stable_shim=81, unstable=0)
    [UNSTABLE] [abi3-ok               ] _flashmla_C.abi3.so  (stable_shim=0, unstable=72)
    [UNSTABLE] [abi3-ok               ] _flashmla_extension_C.abi3.so  (stable_shim=0, unstable=68)
    [UNSTABLE] [abi3-ok               ] _moe_C.abi3.so  (stable_shim=0, unstable=83)
    [NO-TORCH] [abi3-ok               ] cumem_allocator.abi3.so
    [NO-TORCH] [abi3-ok               ] spinloop.abi3.so
    [UNSTABLE] [uses-private-api      ] third_party/deep_gemm/_C.cpython-312-x86_64-linux-gnu.so  (stable_shim=0, unstable=59)
    [UNSTABLE] [abi3-ok               ] vllm_flash_attn/_vllm_fa2_C.abi3.so  (stable_shim=0, unstable=85)
    [UNSTABLE] [abi3-ok               ] vllm_flash_attn/_vllm_fa3_C.abi3.so  (stable_shim=0, unstable=81)

This branch

-- extensions --
    [UNSTABLE] [abi3-ok               ] _C.abi3.so  (stable_shim=0, unstable=78)
    [STABLE  ] [abi3-ok               ] _C_stable_libtorch.abi3.so  (stable_shim=81, unstable=0)
    [UNSTABLE] [abi3-ok               ] _flashmla_C.abi3.so  (stable_shim=0, unstable=72)
    [UNSTABLE] [abi3-ok               ] _flashmla_extension_C.abi3.so  (stable_shim=0, unstable=68)
    [UNSTABLE] [abi3-ok               ] _moe_C.abi3.so  (stable_shim=0, unstable=83)
    [NO-TORCH] [abi3-ok               ] cumem_allocator.abi3.so
    [NO-TORCH] [abi3-ok               ] spinloop.abi3.so
    [UNSTABLE] [uses-private-api      ] third_party/deep_gemm/_C.cpython-312-x86_64-linux-gnu.so  (stable_shim=0, unstable=58)
    [UNSTABLE] [uses-private-api      ] third_party/deep_gemm/_C.cpython-313-x86_64-linux-gnu.so  (stable_shim=0, unstable=59)
    [UNSTABLE] [abi3-ok               ] vllm_flash_attn/_vllm_fa2_C.abi3.so  (stable_shim=0, unstable=85)
    [UNSTABLE] [abi3-ok               ] vllm_flash_attn/_vllm_fa3_C.abi3.so  (stable_shim=0, unstable=81)

No symbols removed

Signed-off-by: Chris Leonard <chleonar@redhat.com>
…d MXFP8 MoE to _C_stable_libtorch with stable torch APIs and bindings.

Signed-off-by: Chris Leonard <chleonar@redhat.com>
@cleonard530
cleonard530 marked this pull request as ready for review June 2, 2026 22:47
return t.is_contiguous() ||
(t.storage().nbytes() - t.storage_offset() * t.element_size() ==
t.numel() * t.element_size());
bool _is_weak_contiguous(torch::stable::Tensor& t) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to redefine _is_weak_contiguous() because the stable wrapper does not expose storage()

@mergify mergify Bot added ci/build deepseek Related to DeepSeek models nvidia labels Jun 2, 2026
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
@Harry-Chen Harry-Chen added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come no move for this one

@cleonard530 cleonard530 Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I mentioned in the comments. I guess because there were too many updates the diff between this and main was too large so GitHub treated it as a deleted/created file instead of a move. If you checkout the commit linked in the description though you can see the diff better

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, why no move?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Jun 3, 2026
@Harry-Chen
Harry-Chen merged commit 59d0236 into vllm-project:main Jun 3, 2026
180 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Jun 3, 2026
zyongye added a commit to zyongye/vllm that referenced this pull request Jun 3, 2026
After rebasing onto main, vllm-project#44365 moved the DeepSeek V4 fused qnorm/rope/KV
insert kernel into csrc/libtorch_stable/ and converted it to the stable ABI.
The replayed FlashInfer full-cache bf16/fp8 insert ops still used the old
ABI (TORCH_CHECK, torch::Tensor, at::cuda::*, VLLM_DISPATCH_HALF_TYPES,
data_ptr), which don't exist there. Port them to match the migrated
_quant_insert op:

- kernel .cu: both full-cache ops + the shared launchFullCacheKernel sm_80
  guard now use STD_TORCH_CHECK, torch::stable::Tensor,
  torch::headeronly::ScalarType, DeviceGuard + get_current_cuda_stream,
  VLLM_STABLE_DISPATCH_HALF_TYPES, const_data_ptr/mutable_data_ptr. KV byte
  strides computed from the literal element size (bf16=2, fp8=1) since
  stable::Tensor has no element_size().
- libtorch_stable/ops.h: declare the two full-cache ops (stable signatures).
- libtorch_stable/torch_bindings.cpp: def + TORCH_BOX impl under _C, next to
  _quant_insert.
- csrc/torch_bindings.cpp: drop the stranded non-stable registration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yongye Zhu <zyy1102000@gmail.com>
mvanhorn pushed a commit to mvanhorn/vllm that referenced this pull request Jun 4, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
JisoLya pushed a commit to JisoLya/vllm that referenced this pull request Jun 5, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Signed-off-by: JisoLya <523420504@qq.com>
knight0528 pushed a commit to knight0528/vllm that referenced this pull request Jun 8, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
waqahmed-amd-fi pushed a commit to waqahmed-amd-fi/vllm that referenced this pull request Jun 10, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Signed-off-by: Waqar Ahmed <waqar.ahmed@amd.com>
Saddss pushed a commit to Saddss/vllm that referenced this pull request Jun 14, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
divineearthly pushed a commit to divineearthly/vllm that referenced this pull request Jun 19, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Signed-off-by: divineearthly <divineearthly@gmail.com>
nkzhenhua pushed a commit to nkzhenhua/vllm that referenced this pull request Jun 24, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
…uce-RMS, and MXFP8 MoE to libtorch stable ABI (vllm-project#44365)

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants