Repository navigation
[None][feat] Support MiniMax-M3 in MegaMoE CuTeDSL - #18605
Conversation
|
/bot run |
|
PR_Github #71044 [ run ] triggered by Bot. Commit: |
|
PR_Github #71044 [ run ] completed with state
|
ca5ad22 to
da752d1
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #71200 [ run ] triggered by Bot. Commit: |
|
PR_Github #71200 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71326 [ run ] triggered by Bot. Commit: |
|
PR_Github #71326 [ run ] completed with state
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe change adds MiniMax-M3 SwiGLU bias support across MegaMoE activation and kernel paths. It also adjusts MiniMax-M3 MoE reduction for fused communication schedulers and adds unit and integration coverage. ChangesMiniMax-M3 MegaMoE support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant MegaMoECustomOp
participant MegaMoERunner
participant MegaMoEBackend
participant MiniMaxM3MoE
MegaMoECustomOp->>MegaMoERunner: pass SwiGLU alpha and beta
MegaMoERunner->>MegaMoEBackend: construct configured kernel
MegaMoEBackend->>MiniMaxM3MoE: produce routed and shared outputs
MiniMaxM3MoE->>MiniMaxM3MoE: reduce shared output when routed output is global
Merge Risk: ⚪ Minimal · up to The MiniMax-M3 activation and communication changes preserve the intended constants and reduction behavior across supported paths. No actionable current-head risk remains before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 31.91% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 10 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review the test coverage as a QA engineer. give inline comments. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== changed files ==='
git diff --name-status HEAD^ HEAD
echo '=== changed test and implementation outlines ==='
for f in \
tests/unittest/_torch/moe/test_moe_backend.py \
tests/unittest/_torch/models/test_minimax_m3.py \
tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py \
tensorrt_llm/_torch/models/modeling_minimaxm3.py \
tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/epilogue_refactor.py \
tensorrt_llm/_torch/moe/custom_ops/cute_dsl_megamoe_custom_op.py; do
if [ -f "$f" ]; then
echo "--- $f ---"
ast-grep outline "$f" --items all 2>/dev/null | head -250 || true
fi
done
echo '=== diff ==='
git diff --unified=80 HEAD^ HEAD -- \
tests/unittest/_torch/moe/test_moe_backend.py \
tests/unittest/_torch/models/test_minimax_m3.py \
tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py \
tensorrt_llm/_torch/models/modeling_minimaxm3.py \
tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/epilogue_refactor.py \
tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/kernel_fc12.py \
tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/megamoe_kernel.py \
tensorrt_llm/_torch/moe/custom_ops/cute_dsl_megamoe_custom_op.pyLength of output: 201197 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== focused numbered ranges ==='
for spec in \
'tests/unittest/_torch/moe/test_moe_backend.py:1000:1110' \
'tests/unittest/_torch/models/test_minimax_m3.py:70:155' \
'tensorrt_llm/_torch/models/modeling_minimaxm3.py:75:100' \
'tensorrt_llm/_torch/models/modeling_minimaxm3.py:450:555' \
'tensorrt_llm/_torch/models/modeling_minimaxm3.py:1720:1775' \
'tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py:410:520' \
'tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py:1325:1425' \
'tensorrt_llm/_torch/moe/custom_ops/cute_dsl_megamoe_custom_op.py:1100:1205' \
'tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/epilogue_refactor.py:1280:1415'; do
file="${spec%%:*}"
rest="${spec#*:}"
start="${rest%%:*}"
end="${rest##*:}"
echo "--- $file lines $start-$end ---"
sed -n "${start},${end}p" "$file" | nl -ba -v "$start"
done
echo '=== related test coverage search ==='
rg -n -C 3 --glob '*.py' \
'unique_id\(\)|\.name\(\)|SwapABSwigluFp4Epilogue|alpha_swiglu_clamp|swiglu_alpha|swiglu_beta|routed_output_is_global|test_minimax_m3_moe' \
tests tensorrt_llmLength of output: 1643 🏁 Script executed: #!/bin/bash
set -euo pipefail
show_range () {
file="$1"
start="$2"
end="$3"
echo "--- $file lines $start-$end ---"
sed -n "${start},${end}p" "$file" | awk -v n="$start" '{printf "%d\t%s\n", n++, $0}'
}
show_range tests/unittest/_torch/moe/test_moe_backend.py 1000 1110
show_range tests/unittest/_torch/models/test_minimax_m3.py 70 155
show_range tensorrt_llm/_torch/models/modeling_minimaxm3.py 75 100
show_range tensorrt_llm/_torch/models/modeling_minimaxm3.py 450 555
show_range tensorrt_llm/_torch/models/modeling_minimaxm3.py 1720 1775
show_range tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py 410 520
show_range tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py 1325 1425
show_range tensorrt_llm/_torch/moe/custom_ops/cute_dsl_megamoe_custom_op.py 1100 1205
show_range tensorrt_llm/_torch/cute_dsl_kernels/mega_moe_nvfp4/epilogue_refactor.py 1280 1415
echo '=== related test coverage search ==='
rg -n -C 3 --glob '*.py' \
'unique_id\(\)|SwapABSwigluFp4Epilogue|alpha_swiglu_clamp|swiglu_alpha|swiglu_beta|routed_output_is_global|test_minimax_m3_moe' \
tests tensorrt_llmLength of output: 193070
Inline comment —
Inline comment — Add a unit test for Inline comment — Add constructor-level coverage for Inline comment — Add a B200 numerical test that executes You are interacting with an AI system. |
sunnyqgg
left a comment
There was a problem hiding this comment.
The new SwigluBias path has no numerical coverage: moe_test_utils.py::should_skip_megamoe_cutedsl (line ~1007) still skips every swiglu_gptoss_style combo, and test_moe_module.py couples bias=swiglu_gptoss_style, which this backend rejects — so test_configurable_moe_single_gpu -k "MEGAMOE_CUTEDSL" never reaches the new epilogue. TestMiniMaxM3::test_nvfp4 also pins backend="CUTLASS". Please update the skip helper and pass bias=False for the SwigluBias combo so the GPU harness covers it, and/or add a backend="MEGAMOE_CUTEDSL" case to test_nvfp4 to cover the TEP AllReduce change end-to-end.
Barry-Delaney
left a comment
There was a problem hiding this comment.
mega_moe_cute_dsl.py:460 (can_implement): The double-reduce you fixed for M3 also affects DSv3/DSv4/Qwen3-MoE: they still allreduce(shared + routed) under TEP with this backend. Suggest rejecting TEP in can_implement here (like MegaMoEDeepGemm) until a shared ConfigurableMoE property lets all models handle it.
Signed-off-by: peihengh <[email protected]>
Signed-off-by: peihengh <[email protected]>
Signed-off-by: peihengh <[email protected]>
Signed-off-by: peihengh <[email protected]>
Signed-off-by: peihengh <[email protected]>
e011450 to
9a98cc5
Compare
Signed-off-by: peihengh <[email protected]>
Barry-Delaney
left a comment
There was a problem hiding this comment.
LGTM from the MoE side. Thanks for restricting TEP in can_implement and moving the host-only tests to cpu_only.
|
/bot run --disable-fail-fast |
|
PR_Github #73631 [ run ] triggered by Bot. Commit: |
|
PR_Github #73631 [ run ] completed with state
|
Signed-off-by: peihengh <[email protected]>
|
/bot run --disable-fail-fast |
|
PR_Github #73677 [ run ] triggered by Bot. Commit: |
|
PR_Github #73677 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #73846 [ run ] triggered by Bot. Commit: |
|
PR_Github #73846 [ run ] completed with state |
|
@coderabbitai evaluate custom pre-merge check --name "Semantic conflict with target branch" --mode warning --instructions "Historical source-only replay of this merged PR #18605 in NVIDIA/TensorRT-LLM. Evaluate only the specified historical revisions, not current main. Do not consult PR discussions, incident reports or later fixes. Verify the requested head, target and merge base with Git. Compare both diffs from the merge base and inspect the combined code. Use only those revisions and source evidence; do not infer compatibility from earlier reviews. First audit the tests: trace new or modified fixtures, fakes, mocks, subclasses and monkeypatch replacements to the production functions they exercise, in both directions across the two diffs. For each affected path, compare actual call arguments, keywords and required attributes with the replacement implementation. Report test-only incompatibilities too. Example: run(x, trace=None) is incompatible with a replacement run(x); accepting trace or a verified adapter resolves it. Then audit other affected contracts: return units, defaults, tensor shapes/dtypes, resource lifetimes and synchronization. Exclude unrelated pre-existing defects and style. Do not stop after a different unsupported feature combination. FAIL if combining the branches breaks a concrete contract. Give the triggering call/input and cite both sides. PASS requires a coverage summary identifying inspected test and production paths and why they remain compatible. Return INCONCLUSIVE for missing necessary evidence. Do not run repository code. Put the evidence first, using immutable GitHub blob links with full SHAs and line numbers from head and target. End with one record: SEMANTIC_RESULT head= target= merge_base= verdict=<PASS|FAIL|INCONCLUSIVE> Use verified full lowercase SHAs; omit the record if unavailable. A record alone is insufficient. Inspect fixed revisions: head=f26e4766f9d4082cb0f747abc465562e17b2fa08, target=82d667fbfb896df0318d37383fa32c54a031ad48, merge_base=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13. This is a post-merge audit: inspect actual merged code 65804bf and verify its parent. Include SEMANTIC_MERGED sha=65804bfcede17124661988c674bd183edec1808e after the result line. This is a historical audit, not a request to modify or reopen this PR." |
|
Evaluate custom pre-merge check command executed successfully. See results below. |
## 📌 Description Integrate the MiniMax-M3 MegaMoE changes from NVIDIA/TensorRT-LLM#18605 into FlashInfer's CuTe DSL NVFP4 MegaMoE backend. The backend now supports uniform `swiglu_alpha` / `swiglu_beta` constants and computes `(up + beta) * gate * sigmoid(alpha * gate)` after gate/up clamping. MiniMax-M3 uses `alpha=1.702` and `beta=1.0`; omitting both preserves standard SwiGLU. Thread the constants through the FlashInfer backend, shim, and kernel, and include them in compilation and workspace-pool identities. Add numerical coverage for parameter changes on the same session, clamped/unclamped activations, and multi-rank EP. Correct the existing torch oracle to round each FC2 term to BF16 before top-k reduction, matching the kernel's output format. This is a semantic integration of the TRT-LLM kernel changes, with FlashInfer-native API/cache wiring. TRT-LLM's model-specific shared-expert/AllReduce changes remain in the calling framework. ## 🔍 Related Issues Source change: NVIDIA/TensorRT-LLM#18605 (head `f26e4766f9d4082cb0f747abc465562e17b2fa08`). ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). All hooks passed on the changed files, including mypy and Ruff; commit hooks also passed. Repository-wide hooks were not run. ## 🧪 Tests - [x] Tests have been added or updated as needed. - [x] All tests are passing (`unittest`, etc.). Focused validation on B200 with PyTorch 2.13.0+cu130 and CuTe DSL 4.7.0: - `test_nvfp4_cutedsl_kernel_vs_reference.py`: 6 passed, including standard SwiGLU and MiniMax activation changes. All exercised kernel outputs matched the corrected torch oracle elementwise. - `test_nvfp4_minimax_multirank` under `torchrun --nproc_per_node=2`: 2 passed per rank, covering the public layer and an independent torch oracle with real cross-rank EP traffic. - `test_config.py`, `test_mega_layer_validation.py`, and `test_workspace_pool.py`: 59 passed, 1 skipped. The full repository test suite was not run. ## 🔬 Experimental Track <!-- Only for PRs submitted under the experimental policy (CONTRIBUTING.md → "Experimental APIs and Backends"). Leave this section untouched for normal PRs. --> - [ ] This PR is **experimental**: it adds or changes code under `flashinfer/experimental/` and/or an `@flashinfer_experimental_api`. Tracking issue: # - [ ] The tracking issue names an owner, the reason for the experimental path, and a graduation plan with a target release. - [ ] Core changes are limited to a thin entry point (signature, shared validation, feature-gate check, backend selection, handoff). - [ ] Tests live in `tests/experimental/` and were validated on the intended hardware; a runnable example is included. - [ ] Nothing is registered in `flashinfer/aot.py`, and no experimental backend is reachable from `backend="auto"` without `FLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1`. (Calling an `@flashinfer_experimental_api` or naming a backend explicitly is itself the opt-in and needs no environment variable.) - [ ] **Test scope declared below.** The experimental CI lane runs exactly these targets, so keep them as narrow as the change allows. <!-- Required for experimental PRs. Replace the commented lines below with your targets. Do not delete the fence or change its `experimental-tests` tag — the experimental-track watcher reads it verbatim to decide which targets to ask CI for. --> ```experimental-tests # One target per line: a directory or a file. (A pytest ::selector is not # supported -- the sharding runner cannot consume one.) Must be under # tests/experimental/ and must exist. Delete these comment lines and add yours, e.g. # # tests/experimental/test_my_backend.py # tests/experimental/my_backend/ # # Declaring the whole tree (tests/experimental/) is allowed but means every # experimental PR pays for every other feature's tests, in every matrix cell. ``` ## Reviewer Notes The NVFP4 kernel changes are a targeted port from TRT-LLM. The corresponding change has also been submitted to the kernel-team upstream repository. Activation constants are distinct from the per-expert dequantization `fc1_alpha` values. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added optional SwiGLU alpha and beta activation parameters to NVFP4 MegaMoE configuration and execution. * Added support for MiniMax-style SwiGLU activation values while preserving standard SwiGLU behavior by default. * Added validation requiring alpha and beta to be provided together. * Activation settings are now respected during autotuning, compilation, caching, and runtime execution. * **Tests** * Added coverage for MiniMax SwiGLU behavior in single- and multi-rank kernel comparisons. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Evaluate behavioral incompatibilities involving the supplied PR changes and the Verify the three full commit IDs and their merge-base. For divergent branches, When head contains target ( First identify changed or removed interfaces and symbols, then search repository Classify findings in prose as cross-branch interactions or PR-local compatibility Use read-only source and Git inspection. Do not modify checked-out files, execute Assess independent findings separately. Uncertainty about one path does not
Write exactly one standalone heading
Then give the verdict, findings or inspected paths, and limitations. For PASS and Copy the supplied identity and commit IDs verbatim. Always include the result Analyze only these fixed revisions in NVIDIA/TensorRT-LLM, not the hosting PR: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
H=f26e4766f9d4082cb0f747abc465562e17b2fa08
T=82d667fbfb896df0318d37383fa32c54a031ad48
B=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13
for rev in "$H" "$T" "$B"; do
git cat-file -t "$rev"
git show -s --format='%H %P' "$rev"
done
echo '=== verified merge base ==='
git merge-base "$H" "$T"
echo '=== head changed files ==='
git diff --stat "$B" "$H"
git diff --name-status "$B" "$H"
echo '=== target changed files ==='
git diff --stat "$B" "$T"
git diff --name-status "$B" "$T"
echo '=== head interface and test changes ==='
git diff --unified=5 "$B" "$H" -- '*.py' '*.yml'Length of output: 127429 🏁 Script executed: #!/bin/bash
set -euo pipefail
H=f26e4766f9d4082cb0f747abc465562e17b2fa08
T=82d667fbfb896df0318d37383fa32c54a031ad48
B=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13
echo '=== relevant target diffs ==='
git diff -U8 "$B" "$T" -- tensorrt_llm/_torch/models/modeling_minimaxm3.py tensorrt_llm/_torch/moe/fused_moe/interface.py tensorrt_llm/_torch/moe/fused_moe/configurable_moe.py tests/unittest/_torch/moe/test_moe_module.py tests/unittest/_torch/helpers.py tests/unittest/utils/util.py tensorrt_llm/_torch/modules/linear.py
echo '=== read-only three-way preview ==='
git merge-tree "$B" "$T" "$H" | head -500
echo '=== fixed-revision references ==='
for R in "$H" "$T"; do
echo "--- $R ---"
git grep -n -E 'query_megamoe_shared_workspace_bytes\(|Sm100MegaMoENvfp4Runner\(|Sm100MegaMoEKernel\(|Sm100SwapABSwigluFp4Fc12Kernel\(|SwapABSwigluFp4Epilogue\(|cute_dsl_megamoe_nvfp4_blackwell\(' "$R" -- '*.py'
git grep -n -E 'MiniMaxM3MoE|maybe_execute_in_parallel|_compute_routed_output|final_all_reduce_params' "$R" -- tests/unittest/_torch/models/test_minimax_m3.py tensorrt_llm/_torch/models/modeling_minimaxm3.py
done
echo '=== head test outline ==='
git show "$H:tests/unittest/_torch/models/test_minimax_m3.py" | ast-grep outline --lang python --items all /dev/stdin 2>&1 || true
echo '=== head model core ==='
git show "$H:tensorrt_llm/_torch/models/modeling_minimaxm3.py" | nl -ba | sed -n '380,565p;1620,1800p'Length of output: 57218 🏁 Script executed: #!/bin/bash
set -euo pipefail
H=f26e4766f9d4082cb0f747abc465562e17b2fa08
T=82d667fbfb896df0318d37383fa32c54a031ad48
B=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13
echo '=== complete preview metadata and relevant combined hunk ==='
python - <<'PY'
import subprocess
b='a8ac7e5bccb972b35808dc973f7b4aac96cbbc13';t='82d667fbfb896df0318d37383fa32c54a031ad48';h='f26e4766f9d4082cb0f747abc465562e17b2fa08'
s=subprocess.check_output(['git','merge-tree',b,t,h],text=True)
for block in s.split('\nchanged in both\n'):
lines=block.splitlines()
if 'modeling_minimaxm3.py' in '\n'.join(lines[:5]): print('\n'.join(lines[:85]))
print('Conflict marker lines:', [x for x in s.splitlines() if '<<<<<<<' in x or '>>>>>>>' in x])
for x in s.splitlines():
if x.startswith((' result',' base',' our',' their')): print(x)
PY
echo '=== fixed-revision references ==='
for R in "$H" "$T"; do
echo "--- $R ---"
git grep -n -E 'query_megamoe_shared_workspace_bytes\(|Sm100MegaMoENvfp4Runner\(|Sm100MegaMoEKernel\(|Sm100SwapABSwigluFp4Fc12Kernel\(|SwapABSwigluFp4Epilogue\(|cute_dsl_megamoe_nvfp4_blackwell\(' "$R" -- '*.py'
done
echo '=== numbered finding evidence ==='
git show "$H:tests/unittest/_torch/models/test_minimax_m3.py" | nl -ba | sed -n '75,220p'
git show "$T:tensorrt_llm/_torch/models/modeling_minimaxm3.py" | nl -ba | sed -n '497,545p'
git show "$B:tensorrt_llm/_torch/models/modeling_minimaxm3.py" | nl -ba | sed -n '497,542p'
git show "$H:tests/integration/test_lists/test-db/l0_cpu.yml" | nl -ba | sed -n '40,56p'
echo '=== test doubles/replacements across complete head test ==='
git grep -n -C 3 -E 'monkeypatch.setattr|def forward|def run_indexer|class .*Fake|class .*Mock|_build_swiglu_oai_dense_mlp' "$H" -- tests/unittest/_torch/models/test_minimax_m3.py
echo '=== kernel and test adapter outlines ==='
for F in tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py tests/unittest/_torch/moe/moe_test_utils.py tests/unittest/_torch/moe/quantize_utils.py; do
echo "--- $F ---"
git show "$H:$F" | ast-grep outline /dev/stdin --lang python --items all 2>&1 || true
doneLength of output: 36816 🏁 Script executed: #!/bin/bash
set -euo pipefail
H=f26e4766f9d4082cb0f747abc465562e17b2fa08
T=82d667fbfb896df0318d37383fa32c54a031ad48
B=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13
echo '=== head workspace and execution contracts ==='
git show "$H:tensorrt_llm/_torch/moe/fused_moe/mega_moe/mega_moe_cute_dsl.py" | nl -ba | sed -n '890,961p;1200,1260p;1418,1487p'
git show "$H:tensorrt_llm/_torch/moe/custom_ops/cute_dsl_megamoe_custom_op.py" | nl -ba | sed -n '1005,1085p;1690,1735p;1760,1802p;1880,1925p'
echo '=== head constructor and fusion ==='
git show "$H:tensorrt_llm/_torch/models/modeling_minimaxm3.py" | nl -ba | sed -n '1640,1770p'
echo '=== both fixed revisions test/helper references ==='
for R in "$H" "$T"; do
git grep -n -E 'def create_test_backend|def run_backend_moe|def get_swiglu_tensors|activation_type=|lora_params' "$R" -- tests/unittest/_torch/moe/moe_test_utils.py tests/unittest/_torch/moe/quantize_utils.py tests/unittest/_torch/moe/test_moe_module.py | sed -n '1,100p'
done
echo '=== confirm new test absent in base and target ==='
for R in "$B" "$T"; do
git grep -n -E '_M3CompositionShared|test_minimax_m3_moe_reduces_only_local_terms' "$R" -- '*.py' '*.yml' || true
done
echo '=== final identity verification ==='
for R in "$H" "$T" "$B"; do git rev-parse --verify "$R^{commit}"; done
git merge-base "$H" "$T"Length of output: 31643
SEMANTIC_REVIEW
Verdict: FAIL One high-confidence cross-branch interaction breaks a newly added CPU test. This is a test-only behavioral incompatibility, not a missing-test finding. Evidence
Trigger and observable failureRun either parameter case of The test supplies a non- Predicted runtime effect: Python raises a Confidence: high. The incompatible signature and reachable call are verified source facts. The exception is a source-derived prediction; I did not execute the test. Integration and origin checksGit verified all three supplied commit objects. I compared both
No paired edit or adapter resolves this mismatch. The routed-expert replacement accepts At the merge base, Lines 499–517, the shared callback passes only Other inspected paths and limitationsI also inspected changed MegaMoE constructor interfaces, repository call references at both fixed revisions, custom-op and fake signatures, activation-constant forwarding, cache-identity edits, workspace-probe calls, output-shape handling, profiling-state cleanup, and decoder scheduler test replacements. The decoder constructor replacements accept arbitrary arguments and supply the new This review used Git and source inspection only. I did not execute project code, tests, or GPU kernels. Numerical accuracy and multi-rank synchronization remain unverified. These limits do not weaken the independently established test incompatibility. SEMANTIC_RESULT request_id=e002777b-6ced-41a4-81ba-53cd21e10bb2 head=f26e4766f9d4082cb0f747abc465562e17b2fa08 target=82d667fbfb896df0318d37383fa32c54a031ad48 merge_base=a8ac7e5bccb972b35808dc973f7b4aac96cbbc13 verdict=FAIL You are interacting with an AI system. |
Dev Engineer Review
SwigluBiassupport to the MegaMoE CuTeDSL NVFP4 backend.alpha,beta, and clamp constants.l0_b200.ymlwith five MegaMoE tests and removed five earlier entries.l0_cpu.ymlwith two MiniMax-M3 tests.QA Engineer Review
tests/unittest/_torch/moe/test_moe_backend.py, including eligibility, validation, cache identity, and numerical tests.test_minimax_m3_moe_reduces_only_local_termsandtest_minimax_m3_decoder_layer_sets_post_fusion_from_moe_schedulerintests/unittest/_torch/models/test_minimax_m3.py.tests/integration/test_lists/test-db/l0_b200.yml.tests/integration/test_lists/test-db/l0_cpu.yml.swiglu_alphaandswiglu_betacache changes, and clamp-boundary numerical cases.Description
Adapt the existing MegaMoE CuTeDSL NVFP4 backend for MiniMax-M3:
ActivationType.SwigluBiaswith uniform per-layer alpha, beta, and clamp constants(up + beta) * gate * sigmoid(alpha * gate)epilogue while preserving standard SwiGLU and Kimi SiTU pathsThis is a semantic port of the MiniMax-M3-specific work from #17907 onto current
main. It deliberately excludes the historical infrastructure commit copied into that feature-branch PR. No open PR is required first: currentmainalready contains the MegaMoE CuTeDSL infrastructure this change extends.Test Coverage
l0_b200.yml.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbits summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.