Repository navigation
Conversation
get_concat_eliminated_tensors put every Concat input whose consumers are
quantized into the shared-scale group, including initializers. The
calibrators only collect ranges for activation tensors, so applying the
group raised KeyError ('/Expand_output_0_ReduceMin') for a ViT whose
constant-folded class token feeds a quantized Concat, and the run failed
after autotune had finished.
Skip gs.Constant inputs when building the group, and add a unit test that
fails without the change.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: gcunhase <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: gcunhase <[email protected]>
…lim.py" This reverts commit 954b136. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: gcunhase <[email protected]>
…t_elim.py Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: gcunhase <[email protected]>
Move the test graph builder to _test_utils/onnx/lib_test_models.py, name the unit test file test_concat_elimination.py, and note the fix in the changelog. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: gcunhase <[email protected]>
Contributor
cjluo-nv
approved these changes
Oct 16, 2026
cjluo-nv
left a comment
Collaborator
There was a problem hiding this comment.
Bot review (bedrock-claude-opus-5-5) — DM the bot to share feedback.
Approving: this is a small, correct fix. It stops initializer Concat inputs from joining a concat-elimination scale group, and new tests cover both the constant and the activation case.
No action needed.
No action needed:
- The
isinstance(input_tensor, gs.Constant)check is narrower than the existingis_const_inputhelper on purpose. That helper also flagsIdentity/Constant-node outputs, which are runtime tensors the calibrator can still measure. So the narrower check doesn't change grouping for anything except initializers. - If a
Constant-op output (not an initializer) feeds aConcat, it would still be grouped. That's outside this bug's scope (ViT's class token is folded into an initializer), but worth remembering if a similarKeyErrorshows up again. - The new test file's header matches
LICENSE_HEADER. The fixture inlib_test_models.pyadds new code only and doesn't change existing models. - I read the tests but didn't run them.
gcunhase
enabled auto-merge (squash)
October 16, 2026 16:19
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2838 +/- ##
==========================================
+ Coverage 69.57% 78.65% +9.07%
==========================================
Files 656 656
Lines 73018 73090 +72
==========================================
+ Hits 50805 57490 +6685
+ Misses 22213 15600 -6613
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rohansjoshi
added a commit
that referenced
this pull request
Oct 17, 2026
#2769 #2770 #2719 #2796 #2801 #2794 #2787 #2682 #2793 #2791 #2792 #2766 #2823 #2777 #2773 #2813 #2832 #2795 #2684 #2822 #2838 #2807 #2772 #2837 #2820 (#2843) ## Cherry-picked PRs - #2647 - #2700 - #2718 - #2578 - #2580 - #2711 - #2731 - #2726 - #2697 - #2769 - #2770 - #2719 - #2796 - #2801 - #2794 - #2787 - #2682 - #2793 - #2791 - #2792 - #2766 - #2823 - #2777 - #2773 - #2813 - #2832 - #2795 - #2684 - #2822 - #2838 - #2807 - #2772 - #2837 - #2820 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded quantized model export support for MXFP4, MXFP8, FP8, and additional block-quantization formats. * Added quantization support for GPT-OSS and Step-family models, plus export support for native FP8 experts. * Added chat JSONL data preparation for Megatron workflows and an option to freeze the student MTP head during distillation. * Added model recipes for Kimi, Gemma, DiffusionGemma, and GLM variants. * **Bug Fixes** * Improved ONNX quantization and export compatibility, distributed calibration consistency, and handling of packed attention caches. * Improved safe model loading and low-precision quantization accuracy. * **Documentation** * Updated the 0.48.0 changelog and guidance for data preparation and quantization recipes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Also includes a partial backport of #2656 (only the `_validate_fold_weight` hook and the `mtq.fold_weight` pre-check), which #2820 depends on. --------- Signed-off-by: Shengliang Xu <[email protected]> Signed-off-by: Rohan Joshi <[email protected]> Signed-off-by: Juhi Mittal <[email protected]> Signed-off-by: Fridah-nv <[email protected]> Signed-off-by: Chenjie Luo <[email protected]> Signed-off-by: yingguo-trt <[email protected]> Signed-off-by: weimingc <[email protected]> Signed-off-by: Yue <[email protected]> Signed-off-by: joe-nv <[email protected]> Signed-off-by: ajrasane <[email protected]> Signed-off-by: Ajinkya Rasane <[email protected]> Signed-off-by: ColinM-sys <[email protected]> Signed-off-by: Keval Morabia <[email protected]> Signed-off-by: Meng Xin <[email protected]> Signed-off-by: gcunhase <[email protected]> Signed-off-by: Chad Voegele <[email protected]> Co-authored-by: Shengliang Xu <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Juhi Mittal <[email protected]> Co-authored-by: Frida Hou <[email protected]> Co-authored-by: Chenjie Luo <[email protected]> Co-authored-by: yingguo-trt <[email protected]> Co-authored-by: Wei-Ming Chen <[email protected]> Co-authored-by: yueshen2016 <[email protected]> Co-authored-by: joe <[email protected]> Co-authored-by: Ajinkya Rasane <[email protected]> Co-authored-by: Colin McDonough <[email protected]> Co-authored-by: Keval Morabia <[email protected]> Co-authored-by: mxinO <[email protected]> Co-authored-by: Gwena Cunha <[email protected]> Co-authored-by: Chad Voegele <[email protected]>
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.
What does this PR do?
Type of change: Bug fix
get_concat_eliminated_tensorsgroups every input of a quantizedConcatso the inputs share onescaling factor. It also grouped constant (initializer) inputs. The calibrators only collect ranges
for activation tensors, so applying the group raised
KeyError: '<tensor>_ReduceMin'in_compute_data_minmax_calibrator.A ViT hits this: constant folding leaves the class token (
/Expand_output_0) as an initializer thatfeeds
Concat, and when the Concat output is quantized the defaultconcat_eliminationpass puts itin a group. With
--autotunethe crash came after the whole search had finished.The fix skips
gs.Constantinputs when building the group. The constant keeps its own scale, soTensorRT may keep one Q/DQ pair at that Concat that concat elimination would have removed.
Usage
Testing
tests/unit/onnx/quantization/test_concat_elimination.py--autotune default, H100, TensorRT 10.16.2.11. Before: crashafter 2.0 h. After: completes in 2.0 h (ModelOpt keeps the FP16 model, since FP8 measured 0.895x).
Before your PR is "Ready for review"
CONTRIBUTING.md: N/AAdditional Information
None.
🤖 Generated with Claude Code
Summary by CodeRabbit