Skip to content

Commit fea6a92

Browse files
committed
fix: Feature different frontend invocations
- ResNet example now features `torch_tensorrt.dynamo.compile`, while transformers example features `torch_tensorrt.compile(..., ir="dynamo_compile", ...)`
1 parent 51a366d commit fea6a92

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/dynamo/dynamo_compile_resnet_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
min_block_size = 3
3737

3838
# Operations to Run in Torch, regardless of converter support
39-
torch_executed_ops = {}
39+
torch_executed_ops = {"torch.ops.aten.embedding.default"}
4040

4141
# %%
4242
# Compilation with `torch_tensorrt.dynamo.compile`

examples/dynamo/dynamo_compile_transformers_example.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@
4747
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
# Build and compile the model with torch.compile, using tensorrt backend
50-
optimized_model = torch_tensorrt.dynamo.compile(
50+
optimized_model = torch_tensorrt.compile(
5151
model,
52-
inputs,
52+
ir="dynamo_compile",
53+
inputs=inputs,
5354
enabled_precisions=enabled_precisions,
5455
debug=debug,
5556
workspace_size=workspace_size,
@@ -59,7 +60,7 @@
5960

6061
# %%
6162
# Equivalently, we could have run the above via the convenience frontend, as so:
62-
# `torch_tensorrt.compile(model, ir="dynamo_compile", inputs=inputs, ...)`
63+
# `torch_tensorrt.dynamo.compile(model, inputs, ...)`
6364

6465
# %%
6566
# Inference

0 commit comments

Comments
 (0)