Repository navigation
[6915426] Fix ONNX AutoTune benchmark initialization on TensorRT 11 - #2795
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
cjluo-nv
left a comment
There was a problem hiding this comment.
Bot review (bedrock-claude-opus-5-5) — DM the bot to share feedback.
The code fix is correct and has a good GPU regression test, but the Autotune guide still has the same EXPLICIT_BATCH snippet that breaks on TensorRT 11.
Needs action:
- Update the "Using TensorRT Python API" example in
docs/source/guides/9_autotune.rstto use only1 << int(trt.NetworkDefinitionCreationFlag.STRONGLY_TYPED). As written, the snippet raises the sameAttributeErrorthis PR fixes.
No action needed:
benchmark.pywas the only code path still usingEXPLICIT_BATCH. The change is right for TensorRT 10 and 11, since explicit batch is implicit on both andSTRONGLY_TYPEDis kept.- The new parametrized test runs the real constructor, checks the
STRONGLY_TYPEDflag, and builds and measures INT8 and FP8 Q/DQ MatMul engines. It skips FP8 below SM89. No existing tests were changed. - The changelog entry is under 0.49.0 Bug Fixes, which is the right place.
|
Addressed the review in 9a5a621: the “Using TensorRT Python API” example now creates the network with Also added a concise docstring to the integration-test class's TensorRT/CUDA fixture in response to the docstring coverage warning. The PR description now includes the documentation change and its validation. Full AutoTune searches and CLI accuracy evaluation remain explicitly untested. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2795 +/- ##
==========================================
+ Coverage 69.33% 78.67% +9.33%
==========================================
Files 654 655 +1
Lines 72665 72776 +111
==========================================
+ Hits 50385 57256 +6871
+ Misses 22280 15520 -6760
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:
|
9a5a621 to
0fc4792
Compare
gcunhase
left a comment
There was a problem hiding this comment.
This matches TrtExecBenchmark with --stronglyTyped enabled.
LGTM.
TensorRT 11 removed EXPLICIT_BATCH. Use STRONGLY_TYPED alone to preserve typing on TensorRT 10 and 11. Add real INT8 and FP8 benchmark regression coverage. Signed-off-by: ajrasane <131806219+ajrasane@users.noreply.github.com>
Remove the stale EXPLICIT_BATCH access from the TensorRT Python example and document the GPU integration-test fixture. Signed-off-by: ajrasane <131806219+ajrasane@users.noreply.github.com>
0fc4792 to
d2b55c3
Compare
#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 <shengliangx@nvidia.com> Signed-off-by: Rohan Joshi <rohjoshi@nvidia.com> Signed-off-by: Juhi Mittal <juhim@nvidia.com> Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com> Signed-off-by: Chenjie Luo <chenjiel@nvidia.com> Signed-off-by: yingguo-trt <244492186+yingguo-trt@users.noreply.github.com> Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com> Signed-off-by: Yue <yueshen@nvidia.com> Signed-off-by: joe-nv <222375587+joe-nv@users.noreply.github.com> Signed-off-by: ajrasane <131806219+ajrasane@users.noreply.github.com> Signed-off-by: Ajinkya Rasane <131806219+ajrasane@users.noreply.github.com> Signed-off-by: ColinM-sys <cmcdonough@50words.com> Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com> Signed-off-by: Meng Xin <164952785+mxinO@users.noreply.github.com> Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com> Signed-off-by: Chad Voegele <cvoegele@nvidia.com> Co-authored-by: Shengliang Xu <106840466+shengliangxu@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Juhi Mittal <39641197+juhi10071998@users.noreply.github.com> Co-authored-by: Frida Hou <201670829+Fridah-nv@users.noreply.github.com> Co-authored-by: Chenjie Luo <108829653+cjluo-nv@users.noreply.github.com> Co-authored-by: yingguo-trt <244492186+yingguo-trt@users.noreply.github.com> Co-authored-by: Wei-Ming Chen <17592131+meenchen@users.noreply.github.com> Co-authored-by: yueshen2016 <39203804+yueshen2016@users.noreply.github.com> Co-authored-by: joe <222375587+joe-nv@users.noreply.github.com> Co-authored-by: Ajinkya Rasane <131806219+ajrasane@users.noreply.github.com> Co-authored-by: Colin McDonough <cmcdonough@50words.com> Co-authored-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com> Co-authored-by: mxinO <164952785+mxinO@users.noreply.github.com> Co-authored-by: Gwena Cunha <4861122+gcunhase@users.noreply.github.com> Co-authored-by: Chad Voegele <chadvoegele@users.noreply.github.com>
What does this PR do?
Type of change: Bug fix
ONNX AutoTune's TensorRT Python benchmark fails during initialization on TensorRT 11 because it accesses the removed
NetworkDefinitionCreationFlag.EXPLICIT_BATCHenum. Create the network withSTRONGLY_TYPEDalone: explicit batching is already implicit in TensorRT 10 and 11, and strong typing remains enabled on both versions.Add a parametrized GPU regression test that constructs the real benchmark, verifies its network creation flags, and builds and measures tiny INT8 and FP8 Q/DQ MatMul candidates. Update the AutoTune guide's TensorRT Python example to use the same supported network flags, and document the integration-test fixture. The same constructor exists in ModelOpt 0.47, so this also includes a changelog entry.
BuilderFlag.DIRECT_IOremains available in the tested versions and needs no change.Usage
Testing
EXPLICIT_BATCHAttributeError.pytest tests/gpu/onnx/quantization/autotune/test_benchmark.py -q— 36 passed, including INT8/FP8 candidate builds and measurements, Python benchmark bytes/path/callable cases, and trtexec smoke tests.pytest tests/gpu/onnx/quantization/autotune/test_benchmark.py -k TestTensorRTPyBenchmark -q— 5 passed.Full standalone AutoTune searches and quantization CLI accuracy evaluations were not run. Candidate measurements here validate the shared benchmark path, not model accuracy.
Before your PR is "Ready for review"
Make sure you read and follow Contributor guidelines and your commits are signed (
git commit -s -S).Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded
trust_remote_code=True,torch.load(..., weights_only=False),pickle, etc.).CONTRIBUTING.md: N/AAdditional Information
TensorRT 10-to-11 migration guide
Summary by CodeRabbit