-
Notifications
You must be signed in to change notification settings - Fork 382
fix: docs + new dep group #4060
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
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/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:50:57.564183+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:51:30.211201+00:00
@@ -24,10 +24,11 @@
logging.basicConfig(level=logging.DEBUG)
torch.manual_seed(0)
# %%
+
# Define a model with expand and reshape operations
# This is a simplified Vision Transformer pattern with:
# - A learnable class token that needs to expand to match batch size
# - A QKV projection followed by reshaping for multi-head attention53a9dfc to
f42a040
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/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:52:54.555414+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:53:26.945609+00:00
@@ -24,10 +24,11 @@
logging.basicConfig(level=logging.DEBUG)
torch.manual_seed(0)
# %%
+
# Define a model with expand and reshape operations
# This is a simplified Vision Transformer pattern with:
# - A learnable class token that needs to expand to match batch size
# - A QKV projection followed by reshaping for multi-head attentionf42a040 to
42d89f8
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/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:54:57.305479+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/compile_with_dynamic_inputs.py 2026-01-29 19:55:29.533323+00:00
@@ -24,10 +24,11 @@
logging.basicConfig(level=logging.DEBUG)
torch.manual_seed(0)
# %%
+
# Define a model with expand and reshape operations
# This is a simplified Vision Transformer pattern with:
# - A learnable class token that needs to expand to match batch size
# - A QKV projection followed by reshaping for multi-head attention42d89f8 to
8977704
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/examples/dynamo/autocast_example.py 2026-01-29 19:57:56.468654+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/autocast_example.py 2026-01-29 19:58:29.240203+00:00
@@ -104,21 +104,19 @@
should_be_fp16 = [
autocast_outs[8],
]
should_be_bf16 = [autocast_outs[3], autocast_outs[4], autocast_outs[6]]
-assert all(a.dtype == torch.float32 for a in should_be_fp32), (
- "Some Autocast outputs are not float32!"
-)
-assert all(a.dtype == torch.float16 for a in should_be_fp16), (
- "Some Autocast outputs are not float16!"
-)
-assert all(a.dtype == torch.bfloat16 for a in should_be_bf16), (
- "Some Autocast outputs are not bfloat16!"
-)
+assert all(
+ a.dtype == torch.float32 for a in should_be_fp32
+), "Some Autocast outputs are not float32!"
+assert all(
+ a.dtype == torch.float16 for a in should_be_fp16
+), "Some Autocast outputs are not float16!"
+assert all(
+ a.dtype == torch.bfloat16 for a in should_be_bf16
+), "Some Autocast outputs are not bfloat16!"
for i, (a, w) in enumerate(zip(autocast_outs, pytorch_outs)):
assert torch.allclose(
a.to(torch.float32), w.to(torch.float32), atol=1e-2, rtol=1e-2
- ), (
- f"Autocast and Pytorch outputs do not match! autocast_outs[{i}] = {a}, pytorch_outs[{i}] = {w}"
- )
+ ), f"Autocast and Pytorch outputs do not match! autocast_outs[{i}] = {a}, pytorch_outs[{i}] = {w}"
print("All dtypes and values match!")
--- /home/runner/work/TensorRT/TensorRT/examples/dynamo/refit_engine_example.py 2026-01-29 19:57:56.468654+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/refit_engine_example.py 2026-01-29 19:58:29.373306+00:00
@@ -103,13 +103,13 @@
expected_outputs, refitted_outputs = (
exp_program2.module()(*inputs),
new_trt_gm(*inputs),
)
for expected_output, refitted_output in zip(expected_outputs, refitted_outputs):
- assert torch.allclose(expected_output, refitted_output, 1e-2, 1e-2), (
- "Refit Result is not correct. Refit failed"
- )
+ assert torch.allclose(
+ expected_output, refitted_output, 1e-2, 1e-2
+ ), "Refit Result is not correct. Refit failed"
print("Refit successfully!")
# %%
#
--- /home/runner/work/TensorRT/TensorRT/examples/dynamo/nvrtc_aot_plugin.py 2026-01-29 19:57:56.468654+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/nvrtc_aot_plugin.py 2026-01-29 19:58:29.417137+00:00
@@ -237,10 +237,10 @@
print("Running inference with compiled model...")
with torch.no_grad():
for i in range(10):
res = model_trt(input)
- assert torch.allclose(res, model(input), rtol=1e-2, atol=1e-2), (
- "Results do not match!"
- )
+ assert torch.allclose(
+ res, model(input), rtol=1e-2, atol=1e-2
+ ), "Results do not match!"
print("Inference successful!")
--- /home/runner/work/TensorRT/TensorRT/examples/dynamo/mutable_torchtrt_module_example.py 2026-01-29 19:57:56.468654+00:00
+++ /home/runner/work/TensorRT/TensorRT/examples/dynamo/mutable_torchtrt_module_example.py 2026-01-29 19:58:29.464922+00:00
@@ -55,13 +55,13 @@
# Check the output
# The refit happens while you call the mutable module again.
with torch.no_grad():
expected_outputs, refitted_outputs = model2(*inputs), mutable_module(*inputs)
for expected_output, refitted_output in zip(expected_outputs, refitted_outputs):
- assert torch.allclose(expected_output, refitted_output, 1e-2, 1e-2), (
- "Refit Result is not correct. Refit failed"
- )
+ assert torch.allclose(
+ expected_output, refitted_output, 1e-2, 1e-2
+ ), "Refit Result is not correct. Refit failed"
print("Refit successfully!")
# %%
# Saving Mutable Torch TensorRT Module8977704 to
a1fa190
Compare
lanluo-nvidia
left a comment
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.
LGTM
Description
Fix documentation building
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: