Repository navigation
fix(deploy): unblock TensorRT 11 inference - #2908
Merged
kevalmorabia97 merged 2 commits intoOct 22, 2026
Merged
Conversation
Contributor
ModelOpt's TensorRT inference session crashes during I/O initialization
on TensorRT 11 because initialize_input_output_tensors() reads the
removed IExecutionContext.all_shape_inputs_specified property. The
resulting AttributeError prevents both baseline and quantized models
from reaching inference. This is a product runtime API-compatibility
bug rather than a quantization or accuracy-threshold failure.
The property wraps the legacy C++ allInputShapesSpecified() interface.
TensorRT 10.16 documents that it does not work with name-based APIs such
as set_input_shape(), which ModelOpt already uses, and recommends
infer_shapes(). The TensorRT 11 migration reference lists this API as
"Removed (always true)"; it was removed, not simply renamed.
Delete only the obsolete assertion. Retain the existing infer_shapes()
validation and its io_shapes == {} condition. This removes an obsolete
check on TensorRT 10.16 and avoids accessing the missing property on
TensorRT 11.x. Model weights, quantization parameters and numerical
operations are unchanged, as are public APIs and dependencies.
Public history:
- 73d6af7, authored 2025-01-29,
"Update 0.23.0 - OSS release", is the earliest public commit located
that already contains the assertion. Its message gives no rationale
for the check; the apparent intent to validate shape-input
completeness is inferred from the assertion text.
- 2017cd9, authored 2025-03-03,
"Update for 0.25.0 release", only reformats this assertion. Plain
git blame can attribute the current lines to that formatting change.
Development-only CPU protocol checks reproduce the missing-property
failure before the fix and pass after it; the legacy-property control
also passes. Applicable pre-commit hooks passed. These checks do not
establish native TensorRT/CUDA compatibility or accuracy. TensorRT
10.16/11.x GPU inference and evaluation validation remain pending.
Sources:
NVIDIA@73d6af7
NVIDIA@2017cd9
https://github.com/NVIDIA/TensorRT/blob/v10.16/include/NvInferRuntime.h#L4556-L4565
https://docs.nvidia.com/deeplearning/tensorrt/11.4.0/api/migration/tensorrt-10x-to-11x-c-api-reference.html
Refs: bug/6915422
Signed-off-by: joe-nv <[email protected]>
joe-nv
force-pushed
the
fix/6915422-remove-legacy-shape-check
branch
from
October 21, 2026 07:31
e3592ba to
713d261
Compare
joe-nv
marked this pull request as ready for review
October 21, 2026 07:36
Contributor
Author
|
@kevalmorabia97 please help to review bugfix |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2908 +/- ##
=======================================
Coverage 70.08% 70.08%
=======================================
Files 659 659
Lines 74081 74080 -1
=======================================
+ Hits 51917 51922 +5
+ Misses 22164 22158 -6
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:
|
cjluo-nv
reviewed
Oct 22, 2026
Collaborator
There was a problem hiding this comment.
Bot review (gpt-6.1-sol) — DM the bot to share feedback.
Nudge: the deletion looks correct and surgical, but native TensorRT regression validation is still pending.
Needs action:
- Run
tests/gpu/torch/deploy/_runtime/test_trt_client.pyon TensorRT 10.16 and 11.x; report final-commit results and validate the explicitio_shapespath as well.
No action needed:
- Existing GPU tests exercise initialization, inference, and output comparisons; no tests were modified or removed.
- The obsolete property access is removed without changing the existing
infer_shapes()condition or public APIs.
kevalmorabia97
approved these changes
Oct 22, 2026
Contributor
Author
|
Hi @kevalmorabia97 Could you help cherry-pick this to the 0.48 branch? Thanks. |
kevalmorabia97
added a commit
that referenced
this pull request
Oct 28, 2026
#2928 #2885 #2908 #2929 #2950 #2972 #2877 #2951 #2816 #3005 #3012 #2971 #3015 #3006 #3026 #2988 #3028 #1860 #3030 #2612 #3033 #2653 #2599 #2655 #2618 #2868 #3032 #3027 #2869 #2984 #2975 #2345 #3020 #2997 (#3072) ## Cherry-picked PRs - #2817 - #2671 - #2892 - #2876 - #2910 - #2911 - #2919 - #2904 - #2937 - #2928 - #2885 - #2908 - #2929 - #2950 - #2972 - #2877 - #2951 - #2816 - #3005 - #3012 - #2971 - #3015 - #3006 - #3026 - #2988 - #3028 - #1860 - #3030 - #2612 - #3033 - #2653 - #2599 - #2655 - #2618 - #2868 - #3032 - #3027 - #2869 - #2984 - #2975 - #2345 - #3020 - #2997 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Diffusion exports now offer more control over attention-quantizer metadata and preserve sparse-attention settings in a format compatible with downstream tooling. * Model loading better handles select bundled model implementations, and Docker guidance now covers writable CUDA-extension cache locations. * **Bug Fixes** * Improved reliability for model export and checkpoint saving, quantization across devices, ONNX processing, and calibration. * Temporary TensorRT and autotuning artifacts now use private directories by default. * **Documentation** * Updated installation guidance, compatibility notes, and links; corrected typos across guides and examples. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Chad Voegele <[email protected]> Signed-off-by: Rohan Joshi <[email protected]> Signed-off-by: LinCanNerd <[email protected]> Signed-off-by: Keval Morabia <[email protected]> Signed-off-by: weimingc <[email protected]> Signed-off-by: Noey Yang <[email protected]> Signed-off-by: Kai Xu <[email protected]> Signed-off-by: Zhehao Hu <[email protected]> Signed-off-by: noeyy-mino <[email protected]> Signed-off-by: joe-nv <[email protected]> Signed-off-by: yingguo-trt <[email protected]> Signed-off-by: Shengliang Xu <[email protected]> Signed-off-by: Chenjie Luo <[email protected]> Signed-off-by: anmaurya001 <[email protected]> Signed-off-by: Connor Baker <[email protected]> Signed-off-by: wiederse <[email protected]> Signed-off-by: Vu Dinh <[email protected]> Signed-off-by: Pratik Gandhi <[email protected]> Signed-off-by: Michael Rusu <[email protected]> Signed-off-by: Michael-Rusu <[email protected]> Signed-off-by: namgyu-youn <[email protected]> Signed-off-by: Sylvester Kaczmarek <[email protected]> Signed-off-by: Javier de Jesus <[email protected]> Signed-off-by: javierdejesusda <[email protected]> Signed-off-by: Zhiyu Cheng <[email protected]> Signed-off-by: Juhi Mittal <[email protected]> Signed-off-by: Dmitry Rantovov <[email protected]> Signed-off-by: h-guo18 <[email protected]> Co-authored-by: Chad Voegele <[email protected]> Co-authored-by: LinCanNerd <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> Co-authored-by: Keval Morabia <[email protected]> Co-authored-by: Wei-Ming Chen <[email protected]> Co-authored-by: noeyy-mino <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: kaix-nv <[email protected]> Co-authored-by: Zhehao Hu <[email protected]> Co-authored-by: joe <[email protected]> Co-authored-by: yingguo-trt <[email protected]> Co-authored-by: Shengliang Xu <[email protected]> Co-authored-by: Chenjie Luo <[email protected]> Co-authored-by: anmaurya001 <[email protected]> Co-authored-by: Connor Baker <[email protected]> Co-authored-by: Jiao Mingyang <[email protected]> Co-authored-by: Vu Dinh <[email protected]> Co-authored-by: Pratik Gandhi <[email protected]> Co-authored-by: Michael R <[email protected]> Co-authored-by: Michael-Rusu <[email protected]> Co-authored-by: namgyu-youn <[email protected]> Co-authored-by: Sylvester Kaczmarek <[email protected]> Co-authored-by: Javier De Jesus <[email protected]> Co-authored-by: Zhiyu <[email protected]> Co-authored-by: Juhi Mittal <[email protected]> Co-authored-by: Dmitry Rantovov <[email protected]> Co-authored-by: h-guo18 <[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
Remove the obsolete
IExecutionContext.all_shape_inputs_specifiedassertion that aborts TensorRT inference initialization withAttributeErroron TensorRT 11.TensorRT 10.16 documents that this legacy check does not work with name-based APIs such as
set_input_shape()and recommendsinfer_shapes(). NVIDIA's TensorRT 11 migration reference lists the correspondingallInputShapesSpecified()API as "Removed (always true)".The change deletes only this three-line assertion. Existing name-based
infer_shapes()validation, including itsio_shapes == {}condition, is preserved. Input/output allocation, profile selection, inference execution, public APIs and dependency requirements are unchanged.Usage
No new API or flag. Existing TensorRT deployment and evaluation calls continue to use the same entry points and optional
io_shapesargument.Testing
AttributeError, while the legacy-property control passes. After the change, both cases pass and retain the same binding/profile calls. This validates the Python interface regression, not native TensorRT/CUDA execution; the scaffolding is not included in this PR.git diff --checkand Python syntax parsing passed.Before your PR is "Ready for review"
Additional Information
Refs: bug/6915422
The commit includes DCO sign-off and an SSH signature verified locally. GitHub reports
unknown_keybecause the signing public key is not registered on the account.Target:
main, withcherry-pick-0.48.0. Keep as Draft pending native validation of the final commit. No merge or auto-merge requested.Summary by CodeRabbit