-
Notifications
You must be signed in to change notification settings - Fork 382
Add some logging to how we handle dynamic shapes #4055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
91d0a09 to
44c5893
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:15:09.021682+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:15:47.295102+00:00
@@ -807,13 +807,13 @@
Copy the metadata from anchor node to the replacement node. This should be used
if the anchor node is replaced with only a single replacement node i.e one-one replacement.
"""
for match_and_replacement in match_and_replacements:
anchor_node = match_and_replacement.nodes_map[match_and_replacement.anchor]
- assert len(match_and_replacement.replacements) == 1, (
- "Found more than 1 replacements for the anchor node."
- )
+ assert (
+ len(match_and_replacement.replacements) == 1
+ ), "Found more than 1 replacements for the anchor node."
replacement_node = match_and_replacement.replacements[0]
replacement_node.meta = anchor_node.meta
def flatten_nodes(nodes: Any) -> List[torch.fx.node.Node]:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:15:10.772610+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:15:52.472541+00:00
@@ -807,13 +807,13 @@
Copy the metadata from anchor node to the replacement node. This should be used
if the anchor node is replaced with only a single replacement node i.e one-one replacement.
"""
for match_and_replacement in match_and_replacements:
anchor_node = match_and_replacement.nodes_map[match_and_replacement.anchor]
- assert len(match_and_replacement.replacements) == 1, (
- "Found more than 1 replacements for the anchor node."
- )
+ assert (
+ len(match_and_replacement.replacements) == 1
+ ), "Found more than 1 replacements for the anchor node."
replacement_node = match_and_replacement.replacements[0]
replacement_node.meta = anchor_node.meta
def flatten_nodes(nodes: Any) -> List[torch.fx.node.Node]:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:16:00.856071+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:16:39.195226+00:00
@@ -807,13 +807,13 @@
Copy the metadata from anchor node to the replacement node. This should be used
if the anchor node is replaced with only a single replacement node i.e one-one replacement.
"""
for match_and_replacement in match_and_replacements:
anchor_node = match_and_replacement.nodes_map[match_and_replacement.anchor]
- assert len(match_and_replacement.replacements) == 1, (
- "Found more than 1 replacements for the anchor node."
- )
+ assert (
+ len(match_and_replacement.replacements) == 1
+ ), "Found more than 1 replacements for the anchor node."
replacement_node = match_and_replacement.replacements[0]
replacement_node.meta = anchor_node.meta
def flatten_nodes(nodes: Any) -> List[torch.fx.node.Node]:44c5893 to
9ae776d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:17:23.133684+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2026-01-28 22:18:01.112613+00:00
@@ -807,13 +807,13 @@
Copy the metadata from anchor node to the replacement node. This should be used
if the anchor node is replaced with only a single replacement node i.e one-one replacement.
"""
for match_and_replacement in match_and_replacements:
anchor_node = match_and_replacement.nodes_map[match_and_replacement.anchor]
- assert len(match_and_replacement.replacements) == 1, (
- "Found more than 1 replacements for the anchor node."
- )
+ assert (
+ len(match_and_replacement.replacements) == 1
+ ), "Found more than 1 replacements for the anchor node."
replacement_node = match_and_replacement.replacements[0]
replacement_node.meta = anchor_node.meta
def flatten_nodes(nodes: Any) -> List[torch.fx.node.Node]:
Description
Fixes some logging and edge cases with dynamic shapes and the torch.compile backend failing on TypeErrors
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: