Merged
Conversation
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:20:12.228964+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:20:39.031898+00:00
@@ -852,9 +852,8 @@
return True
return False
def is_thor() -> bool:
- if torch.cuda.get_device_capability() in [(11,0), (10,1)]:
+ if torch.cuda.get_device_capability() in [(11, 0), (10, 1)]:
return True
- return False
-
+ return False
--- /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:20:12.244964+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:20:41.090733+00:00
@@ -77,11 +77,11 @@
"pytorch/vision:v0.9.0", "resnet50", pretrained=True
),
"path": "both",
},
}
- # Conditionally add timm models
+ # Conditionally add timm models
if not is_tegra_platform():
import timm
timm_models = {
"efficientnet_b0": {
@@ -92,11 +92,11 @@
"model": timm.create_model("vit_base_patch16_224", pretrained=True),
"path": "script",
},
}
torchvision_models.update(timm_models)
-
+
to_test_models.update(torchvision_models)
def get(n, m, manifest):
print("Downloading {}".format(n))
--- /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:20:12.238964+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:20:41.505036+00:00
@@ -31,11 +31,11 @@
LEGACY_BASE_VERSION_SUFFIX_PATTERN = re.compile("a0$")
def get_root_dir() -> Path:
- dir_path = os.path.dirname(os.path.realpath(__file__))
+ dir_path = os.path.dirname(os.path.realpath(__file__))
return dir_path
def get_git_revision_short_hash() -> str:
return (
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:20:12.251964+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:20:42.858332+00:00
@@ -369,6 +369,6 @@
input_bs6 = torch.randn((6, 3, 224, 224)).to("cuda")
cos_sim = cosine_similarity(model(input_bs6), trt_model(input_bs6))
assertions.assertTrue(
cos_sim > COSINE_THRESHOLD,
msg=f"test_dynamic_with_fallback_shape_tensor_pass_through model TRT outputs don't match with the pytorch model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
- )
\ No newline at end of file
+ )
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:20:12.251964+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:20:43.369921+00:00
@@ -446,6 +446,6 @@
cos_sim > COSINE_THRESHOLD,
msg=f"BF16 fallback model TRT outputs don't match with the original model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
)
# Clean up model env
- torch._dynamo.reset()
\ No newline at end of file
+ torch._dynamo.reset()There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:20:24.372628+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:20:51.068968+00:00
@@ -852,9 +852,8 @@
return True
return False
def is_thor() -> bool:
- if torch.cuda.get_device_capability() in [(11,0), (10,1)]:
+ if torch.cuda.get_device_capability() in [(11, 0), (10, 1)]:
return True
- return False
-
+ return False
--- /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:20:24.388629+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:20:53.174401+00:00
@@ -77,11 +77,11 @@
"pytorch/vision:v0.9.0", "resnet50", pretrained=True
),
"path": "both",
},
}
- # Conditionally add timm models
+ # Conditionally add timm models
if not is_tegra_platform():
import timm
timm_models = {
"efficientnet_b0": {
@@ -92,11 +92,11 @@
"model": timm.create_model("vit_base_patch16_224", pretrained=True),
"path": "script",
},
}
torchvision_models.update(timm_models)
-
+
to_test_models.update(torchvision_models)
def get(n, m, manifest):
print("Downloading {}".format(n))
--- /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:20:24.382629+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:20:53.637280+00:00
@@ -31,11 +31,11 @@
LEGACY_BASE_VERSION_SUFFIX_PATTERN = re.compile("a0$")
def get_root_dir() -> Path:
- dir_path = os.path.dirname(os.path.realpath(__file__))
+ dir_path = os.path.dirname(os.path.realpath(__file__))
return dir_path
def get_git_revision_short_hash() -> str:
return (
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:20:24.395629+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:20:54.876805+00:00
@@ -369,6 +369,6 @@
input_bs6 = torch.randn((6, 3, 224, 224)).to("cuda")
cos_sim = cosine_similarity(model(input_bs6), trt_model(input_bs6))
assertions.assertTrue(
cos_sim > COSINE_THRESHOLD,
msg=f"test_dynamic_with_fallback_shape_tensor_pass_through model TRT outputs don't match with the pytorch model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
- )
\ No newline at end of file
+ )
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:20:24.395629+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:20:55.292489+00:00
@@ -446,6 +446,6 @@
cos_sim > COSINE_THRESHOLD,
msg=f"BF16 fallback model TRT outputs don't match with the original model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
)
# Clean up model env
- torch._dynamo.reset()
\ No newline at end of file
+ torch._dynamo.reset()There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:20:39.435152+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 01:21:06.693265+00:00
@@ -852,9 +852,8 @@
return True
return False
def is_thor() -> bool:
- if torch.cuda.get_device_capability() in [(11,0), (10,1)]:
+ if torch.cuda.get_device_capability() in [(11, 0), (10, 1)]:
return True
- return False
-
+ return False
--- /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:20:39.451153+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 01:21:08.829138+00:00
@@ -77,11 +77,11 @@
"pytorch/vision:v0.9.0", "resnet50", pretrained=True
),
"path": "both",
},
}
- # Conditionally add timm models
+ # Conditionally add timm models
if not is_tegra_platform():
import timm
timm_models = {
"efficientnet_b0": {
@@ -92,11 +92,11 @@
"model": timm.create_model("vit_base_patch16_224", pretrained=True),
"path": "script",
},
}
torchvision_models.update(timm_models)
-
+
to_test_models.update(torchvision_models)
def get(n, m, manifest):
print("Downloading {}".format(n))
--- /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:20:39.446152+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 01:21:09.087615+00:00
@@ -31,11 +31,11 @@
LEGACY_BASE_VERSION_SUFFIX_PATTERN = re.compile("a0$")
def get_root_dir() -> Path:
- dir_path = os.path.dirname(os.path.realpath(__file__))
+ dir_path = os.path.dirname(os.path.realpath(__file__))
return dir_path
def get_git_revision_short_hash() -> str:
return (
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:20:39.458153+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 01:21:10.794047+00:00
@@ -369,6 +369,6 @@
input_bs6 = torch.randn((6, 3, 224, 224)).to("cuda")
cos_sim = cosine_similarity(model(input_bs6), trt_model(input_bs6))
assertions.assertTrue(
cos_sim > COSINE_THRESHOLD,
msg=f"test_dynamic_with_fallback_shape_tensor_pass_through model TRT outputs don't match with the pytorch model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
- )
\ No newline at end of file
+ )
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:20:39.459153+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 01:21:11.137669+00:00
@@ -446,6 +446,6 @@
cos_sim > COSINE_THRESHOLD,
msg=f"BF16 fallback model TRT outputs don't match with the original model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
)
# Clean up model env
- torch._dynamo.reset()
\ No newline at end of file
+ torch._dynamo.reset()There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 05:05:22.528902+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/utils.py 2025-09-05 05:05:53.733815+00:00
@@ -852,9 +852,8 @@
return True
return False
def is_thor() -> bool:
- if torch.cuda.get_device_capability() in [(11,0), (10,1)]:
+ if torch.cuda.get_device_capability() in [(11, 0), (10, 1)]:
return True
- return False
-
+ return False
--- /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 05:05:22.544903+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/modules/hub.py 2025-09-05 05:05:55.882781+00:00
@@ -77,11 +77,11 @@
"pytorch/vision:v0.9.0", "resnet50", pretrained=True
),
"path": "both",
},
}
- # Conditionally add timm models
+ # Conditionally add timm models
if not is_tegra_platform():
import timm
timm_models = {
"efficientnet_b0": {
@@ -92,11 +92,11 @@
"model": timm.create_model("vit_base_patch16_224", pretrained=True),
"path": "script",
},
}
torchvision_models.update(timm_models)
-
+
to_test_models.update(torchvision_models)
def get(n, m, manifest):
print("Downloading {}".format(n))
--- /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 05:05:22.539902+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2025-09-05 05:05:56.093031+00:00
@@ -31,11 +31,11 @@
LEGACY_BASE_VERSION_SUFFIX_PATTERN = re.compile("a0$")
def get_root_dir() -> Path:
- dir_path = os.path.dirname(os.path.realpath(__file__))
+ dir_path = os.path.dirname(os.path.realpath(__file__))
return dir_path
def get_git_revision_short_hash() -> str:
return (
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 05:05:22.552903+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_dyn_models.py 2025-09-05 05:05:57.558341+00:00
@@ -369,6 +369,6 @@
input_bs6 = torch.randn((6, 3, 224, 224)).to("cuda")
cos_sim = cosine_similarity(model(input_bs6), trt_model(input_bs6))
assertions.assertTrue(
cos_sim > COSINE_THRESHOLD,
msg=f"test_dynamic_with_fallback_shape_tensor_pass_through model TRT outputs don't match with the pytorch model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
- )
\ No newline at end of file
+ )
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 05:05:22.552903+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/models/test_models.py 2025-09-05 05:05:58.093462+00:00
@@ -446,6 +446,6 @@
cos_sim > COSINE_THRESHOLD,
msg=f"BF16 fallback model TRT outputs don't match with the original model. Cosine sim score: {cos_sim} Threshold: {COSINE_THRESHOLD}",
)
# Clean up model env
- torch._dynamo.reset()
\ No newline at end of file
+ torch._dynamo.reset()
lanluo-nvidia
added a commit
that referenced
this pull request
Sep 9, 2025
lanluo-nvidia
added a commit
that referenced
this pull request
Sep 9, 2025
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
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: