Skip to content

Commit bb93381

Browse files
committed
fix comments
1 parent 211ca8f commit bb93381

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

py/torch_tensorrt/dynamo/backend/backends.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def _pretraced_backend(
157157
logger.warning(
158158
"require_full_compilation arg is not applicable for torch.compile with backend='torch_tensorrt"
159159
)
160+
if settings.strip_engine_weights:
161+
logger.warning(
162+
"strip_engine_weights arg is not supported for torch.compile()"
163+
)
160164
trt_compiled = compile_module(
161165
gm,
162166
torchtrt_inputs,

tests/py/dynamo/models/test_weight_stripped_engine.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_three_ways_to_compile(self):
7878
not importlib.util.find_spec("torchvision"),
7979
"torchvision is not installed",
8080
)
81-
def test_three_ways_to_compile_weight_stripped_engine(self):
81+
def test_compile_weight_stripped_engine(self):
8282
pyt_model = models.resnet18(pretrained=True).eval().to("cuda")
8383
example_inputs = (torch.randn((100, 3, 224, 224)).to("cuda"),)
8484

@@ -91,20 +91,12 @@ def test_three_ways_to_compile_weight_stripped_engine(self):
9191
"refit_identical_engine_weights": False,
9292
}
9393

94-
# 1. Compile with torch_trt.compile using dynamo backend
94+
# Compile with torch_trt.compile using dynamo backend
9595
gm1 = torch_trt.compile(
9696
pyt_model, ir="dynamo", inputs=example_inputs, **settings
9797
)
9898
gm1_output = gm1(*example_inputs)
9999

100-
# 2. Compile with torch.compile using tensorrt backend, which is not supported to set strip_engine_weights=True
101-
# gm2 = torch.compile(
102-
# pyt_model,
103-
# backend="tensorrt",
104-
# options=settings,
105-
# )
106-
# gm2_output = gm2(*example_inputs)
107-
108100
assertions.assertEqual(
109101
gm1_output.sum(), 0, msg="gm1_output should be all zeros"
110102
)

0 commit comments

Comments
 (0)