Fix noncontiguous AOT inputs - #4509
Open
jloftin-nv wants to merge 2 commits into
Open
Conversation
lanluo-nvidia
left a comment
Collaborator
There was a problem hiding this comment.
- P1 — The top-level Dynamo AOT entry points still reject non-contiguous tensors before reaching these updated functions. py/torch_tensorrt/_compile.py:340,
py/torch_tensorrt/_compile.py:438, and py/torch_tensorrt/_compile.py:564 call prepare_inputs(...) without disable_memory_format_check=True. Thus
torch_tensorrt.compile(..., ir="dynamo"), top-level cross-compilation, and convert_method_to_trt_engine still raise ValueError for the same transposed
inputs, so the change only fixes direct torch_tensorrt.dynamo.* APIs. The test covers only the direct compile path.
jloftin-nv
force-pushed
the
dev-jloftin-non-contigious
branch
from
August 21, 2026 17:14
327f655 to
8aa3cbc
Compare
Contributor
Author
Fixed the other pathways |
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.
Description
Input.from_tensor rejects non-contiguous / non-channels-last tensors unless disable_memory_format_check=True. The torch.compile backend sets that flag; every dynamo.compile AOT path does not, so the same inputs succeed on one entry point and fail on the other.
Pass disable_memory_format_check=True through the AOT prepare_inputs sites to match the backend behavior.
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: