Skip to content

[TRTLLM-14822][feat] deprecate WIDEEP MoE backend - #17119

Open
xxi-nv wants to merge 1 commit into
NVIDIA:mainfrom
xxi-nv:deprecate-wideep-moe
Open

[TRTLLM-14822][feat] deprecate WIDEEP MoE backend#17119
xxi-nv wants to merge 1 commit into
NVIDIA:mainfrom
xxi-nv:deprecate-wideep-moe

Conversation

@xxi-nv

@xxi-nv xxi-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Deprecate the WIDEEP MoE backend by raising an explicit error in both get_moe_cls and create_moe_backend, so it cannot be selected via create_moe nor by calling create_moe_backend directly. Wide expert parallelism and EPLB stay available through the remaining backends (DEEPGEMM for FP8 block-scale checkpoints, TRTLLM / CUTEDSL / CUTLASS otherwise).

AUTO never resolves to WIDEEP, so no implicit user path is affected.

Why the FP8 EPLB tests can move off WIDEEP

TestDeepSeekV4FlashBase FP8 EPLB cases used to require WIDEEP because the default CUTLASS FP8 block-scale path (CutlassFp8BlockScaleGemmRunner::moeGemm) takes a Hopper-only wgmma route with no SM100/SM103 implementation. WIDEEP avoided this via an is_sm_100f() check that switches to DeepGEMM. DEEPGEMM reaches the same kernel directly, so those cases now use DEEPGEMM.

Other updates

  • Examples, docs and CLI choices that offered WIDEEP now point at CUTEDSL / DEEPGEMM.
  • Test list entries parametrized on WIDEEP are removed.
  • WideEPMoE is dropped from the mirrored swiglu_limit capability tuple in modeling_deepseekv4.py to keep it consistent with create_moe.py.
  • The layer_wise_benchmarks --scaled-from test is skipped: that feature is implemented by monkeypatching WideEPMoE.select_alltoall_method_type.

Test plan

Ran the full TestDeepSeekV4FlashBase class on 4x B300 (SM103), wheel built with -a "100-real;103-real", using TRTLLM_ACCURACY_NO_REFERENCE=1 (this model has no registered MMLU/GSM8K reference entries):

  • test_fp8_4gpus_static_eplb[moe_backend=DEEPGEMM] - PASSED (15m09s)
  • test_auto_dtype[moe_backend=DEEPGEMM] - PASSED (7m46s)
  • test_auto_dtype[moe_backend=TRTLLM] - PASSED (7m58s)
  • test_fp8_chunked_prefill - PASSED (7m18s)
  • test_fp8_4gpus_online_eplb[moe_backend=DEEPGEMM] - fails on a pre-existing incompatibility, see below

Note on the online EPLB case

test_fp8_4gpus_online_eplb fails with AssertionError: t.is_contiguous() must be True at moe_load_balancer.py:151. This is not introduced by this PR:

  • On SM100/SM103, WideEPMoE._get_quant_method returns the same DeepSeekFP8BlockScalesFusedMoEMethodDeepGemm that DeepGemmFusedMoE returns, so switching the backend does not change this code path.
  • _needs_e8m0_resmooth() is true for all Blackwell architectures, and the resulting scale tensor from transform_sf_into_required_layout is non-contiguous, which the online EPLB host tensor sharer rejects. static EPLB passes layer_updates_per_iter=0 and short-circuits that requirement.
  • The class is gated by @skip_pre_blackwell, so every platform that can run this case hits the same assertion, including the previous WIDEEP parametrization.
  • The case is not referenced by any CI test list, so it was never covered by CI.

Fixing it requires deciding whether forcing contiguity is safe for the DeepGEMM scale layout, which is a separate concern from this deprecation.

Dev Engineer Review

  • WIDEEP now fails explicitly in get_moe_cls and create_moe_backend.
  • WIDEEP is removed from CLI choices, examples, documentation, validation, load balancing, and benchmark routing.
  • Supported replacements are consistent: CUTEDSL for NVFP4 and DEEPGEMM or TRTLLM for FP8.
  • WideEPMoE remains available through supported backends and is removed only from the swiglu_limit capability tuple.
  • The layer-wise benchmark is skipped because --scaled-from requires the removed WIDEEP all-to-all hook.
  • Test lists remove obsolete WIDEEP coverage and waivers without adding invalid entries.
  • No correctness or configuration issues were identified.
  • The online FP8 EPLB failure remains a pre-existing non-contiguous scale tensor incompatibility.

QA Engineer Review

Modified test code includes:

  • DeepSeek V4 and V4-Flash FP8 EPLB parameterizations in test_llm_api_pytorch.py.
  • DeepSeek V4-Flash-Base static and automatic-dtype coverage in test_llm_api_pytorch.py.
  • test_deepseek_r1_gen_scaled_from_16_dep, now skipped.
  • MoE LoRA validator parametrizations in test_moe_lora_validator.py.
  • DeepSeek V4-Flash integration comments in test_disaggregated_serving.py.
  • DeepSeek-R1 MTP benchmark configuration in test_e2e.py.

The related CI and QA manifests remove obsolete WIDEEP cases from llm_function_core.txt, llm_function_rtx6k.txt, llm_perf_disagg.yml, llm_perf_multinode.txt, l0_dgx_b200.yml, and waives.txt.

Coverage uses supported backends, including DEEPGEMM, TRTLLM, and CUTLASS. The static FP8 EPLB, automatic-dtype, and chunked-prefill tests passed on 4x B300. The online FP8 EPLB test still fails for a pre-existing issue.

Verdict: needs follow-up because the online FP8 EPLB test remains failing.

Raise an explicit error for the WIDEEP MoE backend in both get_moe_cls and create_moe_backend, so the backend cannot be selected through create_moe or by calling create_moe_backend directly. Wide expert parallelism and EPLB remain available through the other backends.

TestDeepSeekV4FlashBase FP8 EPLB cases previously required WIDEEP because CutlassFp8BlockScaleGemmRunner takes a Hopper-only wgmma path with no SM100/SM103 implementation. DEEPGEMM routes the same block-scale weights through DeepGEMM, so those cases now use DEEPGEMM. Examples, docs and test lists that referenced WIDEEP are updated to CUTEDSL or DEEPGEMM accordingly.

The layer_wise_benchmarks --scaled-from test is skipped because that feature is implemented by monkeypatching WideEPMoE.select_alltoall_method_type.

Signed-off-by: xxi <xxi@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

WIDEEP is deprecated and rejected during MoE backend selection and construction. CLI choices, deployment examples, runtime validation, DeepSeek accuracy coverage, QA manifests, and benchmark tests now use supported backends or remove WIDEEP cases.

Changes

WIDEEP backend retirement

Layer / File(s) Summary
Runtime backend removal
tensorrt_llm/_torch/modules/fused_moe/create_moe.py, tensorrt_llm/_torch/models/modeling_deepseekv4.py, tests/unittest/_torch/lora/*
WIDEEP selection and construction now raise a deprecation error. WIDEEP is removed from load-balancer and SwiGLU-limit validation.
Backend selection surfaces
docs/source/deployment-guide/..., examples/llm-api/*, examples/wide_ep/*, examples/models/core/exaone/README.md, examples/layer_wise_benchmarks/run.py, tensorrt_llm/tools/layer_wise_benchmarks/runner.py, tensorrt_llm/_torch/peft/lora/validation.py
CLI choices, configurations, documentation, and benchmark routing replace or remove WIDEEP.
Accuracy backend coverage
tests/integration/defs/accuracy/*, tests/integration/defs/test_e2e.py
DeepSeek EPLB and V4 Flash tests use supported backend combinations.
Test inventory cleanup
tests/integration/test_lists/*, tests/unittest/tools/test_layer_wise_benchmarks.py
WIDEEP QA, performance, waiver, and scaled-from benchmark entries are removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: api-breaking

Suggested reviewers: schetlur-nv, bowenfu, fredricz-20070104

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: deprecating the WIDEEP MoE backend.
Description check ✅ Passed The description explains the change, rationale, affected areas, test coverage, and a known pre-existing failure; the checklist is omitted but non-critical.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/defs/accuracy/test_llm_api_pytorch.py`:
- Line 4045: Add the exact DEEPGEMM parameterized node for
TestDeepSeekV4FlashBase::test_fp8_4gpus_online_eplb to the appropriate active
CI, test-db, and QA lists before recording its waiver, then add the matching
waiver for the known failure. Ensure the test is scheduled and gated rather than
only waived.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: aaf1a23f-c0ed-4f44-a653-8ef6f2ca34f4

📥 Commits

Reviewing files that changed from the base of the PR and between f10a22e and 7b667ff.

📒 Files selected for processing (24)
  • docs/source/deployment-guide/deployment-guide-for-deepseek-r1-on-trtllm.md
  • examples/layer_wise_benchmarks/run.py
  • examples/llm-api/llm_sparse_attention.py
  • examples/llm-api/quickstart_advanced.py
  • examples/longbench/eval_longbench_v1.py
  • examples/models/core/exaone/README.md
  • examples/wide_ep/README.md
  • examples/wide_ep/slurm_scripts/config.yaml
  • examples/wide_ep/slurm_scripts/kimi-k2-thinking.yaml
  • tensorrt_llm/_torch/models/modeling_deepseekv4.py
  • tensorrt_llm/_torch/modules/fused_moe/create_moe.py
  • tensorrt_llm/_torch/peft/lora/validation.py
  • tensorrt_llm/tools/layer_wise_benchmarks/runner.py
  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/integration/defs/test_e2e.py
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/qa/llm_function_rtx6k.txt
  • tests/integration/test_lists/qa/llm_perf_disagg.yml
  • tests/integration/test_lists/qa/llm_perf_multinode.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/waives.txt
  • tests/unittest/_torch/lora/test_moe_lora_validator.py
  • tests/unittest/tools/test_layer_wise_benchmarks.py
💤 Files with no reviewable changes (7)
  • tests/integration/test_lists/qa/llm_perf_multinode.txt
  • tests/integration/test_lists/waives.txt
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/qa/llm_function_rtx6k.txt
  • tensorrt_llm/tools/layer_wise_benchmarks/runner.py
  • tests/integration/test_lists/qa/llm_perf_disagg.yml


@pytest.mark.skip_less_mpi_world_size(4)
@parametrize_with_ids("moe_backend", ["WIDEEP"])
@parametrize_with_ids("moe_backend", ["DEEPGEMM"])

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 5 \
  -e 'test_fp8_4gpus_online_eplb' \
  -e 'TestDeepSeekV4FlashBase' \
  tests/integration/test_lists/waives.txt \
  tests/integration/test_lists/test-db \
  tests/integration/test_lists/qa || true

Repository: NVIDIA/TensorRT-LLM

Length of output: 157


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- source files ---'
git ls-files 'tests/integration/defs/accuracy/test_llm_api_pytorch.py' 'tests/integration/test_lists/waives.txt' 'tests/integration/test_lists/test-db/**' 'tests/integration/test_lists/qa/**'

echo '--- test definition and parametrization ---'
sed -n '3985,4085p' tests/integration/defs/accuracy/test_llm_api_pytorch.py

echo '--- matching entries in active list files ---'
rg -n -i -C 4 \
  -e 'test_fp8_4gpus_online_eplb' \
  -e 'TestDeepSeekV4FlashBase' \
  -e 'DeepSeekV4FlashBase' \
  -e 'DEEPGEMM' \
  tests/integration/test_lists/waives.txt \
  tests/integration/test_lists/test-db \
  tests/integration/test_lists/qa || true

echo '--- all list entries containing the test name ---'
find tests/integration/test_lists/test-db tests/integration/test_lists/qa -type f -print0 |
  xargs -0 grep -n -i -C 2 'test_fp8_4gpus_online_eplb' || true

Repository: NVIDIA/TensorRT-LLM

Length of output: 34383


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- focused diff for the changed test file ---'
git diff --unified=12 -- tests/integration/defs/accuracy/test_llm_api_pytorch.py

echo '--- test-list and waiver semantics ---'
sed -n '1,220p' tests/integration/test_lists/qa/README.md
sed -n '1,220p' tests/integration/test_lists/test-db/README.md
sed -n '1,80p' tests/integration/test_lists/waives.txt

echo '--- exact and broader list matches ---'
rg -n -i \
  -e 'TestDeepSeekV4FlashBase' \
  -e 'test_fp8_4gpus_(static|online)_eplb' \
  -e 'DeepSeekV4Flash-Base' \
  tests/integration/test_lists/waives.txt \
  tests/integration/test_lists/test-db \
  tests/integration/test_lists/qa || true

echo '--- all references to the class and methods in repository metadata ---'
rg -n -i \
  -e 'TestDeepSeekV4FlashBase' \
  -e 'test_fp8_4gpus_(static|online)_eplb' \
  tests/integration .github 2>/dev/null || true

Repository: NVIDIA/TensorRT-LLM

Length of output: 21636


Add the test to the active lists before adding a waiver.

TestDeepSeekV4FlashBase::test_fp8_4gpus_online_eplb[moe_backend=DEEPGEMM] has no local skip and is absent from waives.txt, test-db, and qa. It is not scheduled by active CI or QA, so a waiver alone will not gate it. Add the exact node to the intended lists, then add the matching waiver for the known failure. Test coverage is insufficient.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/integration/defs/accuracy/test_llm_api_pytorch.py` at line 4045, Add
the exact DEEPGEMM parameterized node for
TestDeepSeekV4FlashBase::test_fp8_4gpus_online_eplb to the appropriate active
CI, test-db, and QA lists before recording its waiver, then add the matching
waiver for the known failure. Ensure the test is scheduled and gated rather than
only waived.

Source: Path instructions

@xxi-nv

xxi-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63033 [ run ] triggered by Bot. Commit: 7b667ff Link to invocation

@mikeiovine
mikeiovine requested a review from Mgluhovskoi July 31, 2026 15:48
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63033 [ run ] completed with state FAILURE. Commit: 7b667ff
/LLM/main/L0_MergeRequest_PR pipeline #51140 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@xxi-nv

xxi-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63064 [ run ] triggered by Bot. Commit: 7b667ff Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63064 [ run ] completed with state FAILURE. Commit: 7b667ff
/LLM/main/L0_MergeRequest_PR pipeline #51163 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@xxi-nv

xxi-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63132 [ run ] triggered by Bot. Commit: 7b667ff Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63132 [ run ] completed with state FAILURE. Commit: 7b667ff
/LLM/main/L0_MergeRequest_PR pipeline #51220 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@xxi-nv

xxi-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63153 [ run ] triggered by Bot. Commit: 7b667ff Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63153 [ run ] completed with state SUCCESS. Commit: 7b667ff
/LLM/main/L0_MergeRequest_PR pipeline #51237 completed with status: 'SUCCESS'

CI Report

Link to invocation

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.

2 participants