Skip to content

Commit

Permalink
fix: Update function calls to address API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gs-olive committed Jul 21, 2023
1 parent 42ecf57 commit c64566a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions examples/dynamo/dynamo_compile_resnet_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Dynamo Compile ResNet Example
=========================
This interactive script is intended as a sample of the `torch_tensorrt.dynamo.compile` workflow on a ResNet model."""
This interactive script is intended as a sample of the `torch_tensorrt.compile` workflow with `torch.compile` on a ResNet model."""

# %%
# Imports and Model Definition
Expand All @@ -19,7 +19,7 @@
inputs = [torch.randn((1, 3, 224, 224)).to("cuda").half()]

# %%
# Optional Input Arguments to `torch_tensorrt.dynamo.compile`
# Optional Input Arguments to `torch_tensorrt.compile`
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# Enabled precision for TensorRT optimization
Expand All @@ -39,13 +39,14 @@
torch_executed_ops = {}

# %%
# Compilation with `torch_tensorrt.dynamo.compile`
# Compilation with `torch_tensorrt.compile`
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# Build and compile the model with torch.compile, using Torch-TensorRT backend
optimized_model = torch_tensorrt.dynamo.compile(
optimized_model = torch_tensorrt.compile(
model,
inputs,
ir="torch_compile",
inputs=inputs,
enabled_precisions=enabled_precisions,
debug=debug,
workspace_size=workspace_size,
Expand Down
13 changes: 7 additions & 6 deletions examples/dynamo/dynamo_compile_transformers_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Dynamo Compile Transformers Example
=========================
This interactive script is intended as a sample of the `torch_tensorrt.dynamo.compile` workflow on a transformer-based model."""
This interactive script is intended as a sample of the `torch_tensorrt.compile` workflow with `torch.compile` on a transformer-based model."""

# %%
# Imports and Model Definition
Expand All @@ -23,7 +23,7 @@


# %%
# Optional Input Arguments to `torch_tensorrt.dynamo.compile`
# Optional Input Arguments to `torch_tensorrt.compile`
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# Enabled precision for TensorRT optimization
Expand All @@ -43,13 +43,14 @@
torch_executed_ops = {}

# %%
# Compilation with `torch_tensorrt.dynamo.compile`
# Compilation with `torch_tensorrt.compile`
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# Build and compile the model with torch.compile, using tensorrt backend
optimized_model = torch_tensorrt.dynamo.compile(
# Build and compile the model with torch.compile, using Torch-TensorRT backend
optimized_model = torch_tensorrt.compile(
model,
inputs,
ir="torch_compile",
inputs=inputs,
enabled_precisions=enabled_precisions,
debug=debug,
workspace_size=workspace_size,
Expand Down

0 comments on commit c64566a

Please sign in to comment.