[None][fix] Fix fused mHC RMS normalization - #13587
Merged
lfr-0531 merged 2 commits intoApr 29, 2026
Merged
Conversation
Fused mHC computes RMS statistics over the flattened hyper-connection residual whose logical K is hc_mult * hidden_size. The fused half-MMA/FMA paths passed hidden_size into the big-fuse RMS postlogue, and the all-MMA path used hidden_size in its inline RMS normalization. That scaled rstd incorrectly for DeepSeek-V4 Flash and caused the GSM8K accuracy drop when fused_hc was enabled. Use the full mHC K for RMS normalization in the fused_hc big-fuse calls and the all-MMA inline path. Add a real-scale regression test that covers fused_half_mma, fused_half_fma, fused_all_mma, and fused_all_fma. Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
mingyangHao
force-pushed
the
mhc-fused-rms-denominator-fix
branch
from
April 29, 2026 01:52
3df8bc8 to
1df26e1
Compare
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
lfr-0531
pushed a commit
that referenced
this pull request
May 7, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com>
lfr-0531
pushed a commit
that referenced
this pull request
May 14, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
May 29, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 1, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 3, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 7, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 10, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 11, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 12, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 12, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 13, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 16, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 17, 2026
Signed-off-by: Mingyang Hao <mingyangHao@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> (cherry picked from commit 3303f1c) Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.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.
@coderabbitai summary
Description
Fused mHC computes RMS statistics over the flattened hyper-connection residual whose logical K is
hc_mult * hidden_size. The fused_hc half-MMA/FMA paths passed onlyhidden_sizeinto the big-fuse RMS postlogue, and the all-MMA path usedhidden_sizein its inline RMSnormalization. For DeepSeek-V4 Flash this scaled
rstdincorrectly and caused the GSM8K accuracy drop whenTRTLLM_MHC_ENABLE_FUSED_HC=1.This PR changes fused_hc RMS normalization to use the full mHC K in both big-fuse and all-MMA inline paths. It also adds a real-scale regression test covering
fused_half_mma,fused_half_fma,fused_all_mma, andfused_all_fma.No API changes, new dependencies, ownership changes, or documentation updates are required.
Test Coverage
pre-commit run --show-diff-on-failure --files cpp/tensorrt_llm/kernels/mhcKernels/mhcFusedHcKernel.cu cpp/tensorrt_llm/kernels/mhcKernels/fused_tf32_pmap_gemm.cuh tests/unittest/_torch/modules/test_mhc.pytests/unittest/_torch/modules/test_mhc.py::test_mhc_fused_hc_realistic_scale_regression(4 passed)96.2996.0678.66PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths.
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.