Skip to content

add support for cu126 and cu128#4117

Draft
lanluo-nvidia wants to merge 4 commits intomainfrom
lluo/cherry_pick_from_release_211
Draft

add support for cu126 and cu128#4117
lanluo-nvidia wants to merge 4 commits intomainfrom
lluo/cherry_pick_from_release_211

Conversation

@lanluo-nvidia
Copy link
Collaborator

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@meta-cla meta-cla bot added the cla signed label Mar 5, 2026
@lanluo-nvidia lanluo-nvidia added ciflow/binaries/all Build for all Python Versions and removed cla signed labels Mar 5, 2026
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 5, 2026
Copy link

@github-actions github-actions bot left a 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/docs/v2.2.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:05.736649+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:48.444837+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_advanced_usage:

Torch Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:05.736649+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:48.452240+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_resnet:

Compiling ResNet using the Torch-TensorRT Dyanmo Frontend
==========================================================

-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.dynamo.compile` workflow on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:05.737320+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:48.456049+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_resnet:

Compiling ResNet using the Torch-TensorRT `torch.compile` Backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:05.737320+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:48.502454+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_advanced_usage:

Dynamo Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:05.737320+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:48.505084+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:05.787851+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:48.507237+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_advanced_usage:

Torch Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:05.737320+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.2.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:48.513086+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-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.dynamo.compile` workflow on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:05.788321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:48.549736+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_resnet:

Compiling ResNet using the Torch-TensorRT `torch.compile` Backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:05.787851+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:48.547649+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_resnet:

Compiling ResNet using the Torch-TensorRT Dyanmo Frontend
==========================================================

-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.dynamo.compile` workflow on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:05.788321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:48.569154+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_advanced_usage:

Dynamo Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:05.788321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:48.571313+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:05.788321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.3.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:48.602875+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-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.dynamo.compile` workflow on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:05.836595+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:48.638288+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_advanced_usage:

Torch Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:05.836595+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:48.640555+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_resnet:

Compiling ResNet using the Torch-TensorRT Dyanmo Frontend
==========================================================

-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.dynamo.compile` workflow on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:05.837321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:48.700567+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:05.837321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:48.713612+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_resnet:

Compiling ResNet using the Torch-TensorRT `torch.compile` Backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:05.837321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:48.741264+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_advanced_usage:

Dynamo Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:05.888475+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/0e30a6276601af7e5fc4d5166e2e3d37/torch_compile_advanced_usage.py	2026-03-05 17:45:48.764060+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_advanced_usage:

Torch Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.compile(..., ir="torch_compile", ...)` works, and how it integrates with the `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:05.837321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.4.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:48.768039+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-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.dynamo.compile` workflow on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/2a9ac10f2667047a7f398d1593b7ca33/torch_export_gpt2.py	2026-03-05 17:45:05.888475+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/2a9ac10f2667047a7f398d1593b7ca33/torch_export_gpt2.py	2026-03-05 17:45:48.802114+00:00
@@ -2,11 +2,12 @@
.. _torch_export_gpt2:

Compiling GPT2 using the Torch-TensorRT with dynamo backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with dynamo backend on a GPT2 model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with dynamo backend on a GPT2 model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
import torch
--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/3d4d74f6636d986f33167154f6553961/torch_export_cudagraphs.py	2026-03-05 17:45:05.888475+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/3d4d74f6636d986f33167154f6553961/torch_export_cudagraphs.py	2026-03-05 17:45:48.813469+00:00
@@ -2,11 +2,12 @@
.. _torch_export_cudagraphs:

Torch Export with Cudagraphs
======================================================

-This interactive script is intended as an overview of the process by which the Torch-TensorRT Cudagraphs integration can be used in the `ir="dynamo"` path. The functionality works similarly in the `torch.compile` path as well."""
+This interactive script is intended as an overview of the process by which the Torch-TensorRT Cudagraphs integration can be used in the `ir="dynamo"` path. The functionality works similarly in the `torch.compile` path as well.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:05.888475+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/418941399c146271a7b7728ba3059960/dynamo_compile_resnet_example.py	2026-03-05 17:45:48.833150+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_resnet:

Compiling ResNet using the Torch-TensorRT Dyanmo Frontend
==========================================================

-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.dynamo.compile` workflow on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/7b7004dc2ea6f839be532665e16e0426/torch_export_llama2.py	2026-03-05 17:45:05.889321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/7b7004dc2ea6f839be532665e16e0426/torch_export_llama2.py	2026-03-05 17:45:48.877782+00:00
@@ -2,11 +2,12 @@
.. _torch_export_llama2:

Compiling Llama2 using the Torch-TensorRT with dynamo backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with dynamo backend on a Llama2 model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with dynamo backend on a Llama2 model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
import torch
--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:05.890321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/d6e1bb6ec5f884994554d9d12e37a0f6/torch_compile_resnet_example.py	2026-03-05 17:45:48.903853+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_resnet:

Compiling ResNet using the Torch-TensorRT `torch.compile` Backend
==========================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a ResNet model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:05.890321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/dfa60e8f9850fd7761f3e7da81304d32/torch_compile_transformers_example.py	2026-03-05 17:45:48.929188+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model."""
+This interactive script is intended as a sample of the Torch-TensorRT workflow with `torch.compile` on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:05.890321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/e1ef5a42560a98a132f56a79d0b66f79/dynamo_compile_advanced_usage.py	2026-03-05 17:45:48.931302+00:00
@@ -2,11 +2,12 @@
.. _dynamo_compile_advanced_usage:

Dynamo Compile Advanced Usage
======================================================

-This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API."""
+This interactive script is intended as an overview of the process by which `torch_tensorrt.dynamo.compile` works, and how it integrates with the new `torch.compile` API.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:05.890321+00:00
+++ /home/runner/work/TensorRT/TensorRT/docs/v2.5.0/_downloads/e550c5f53cc43e11aa6da8cfb79b54df/dynamo_compile_transformers_example.py	2026-03-05 17:45:48.957917+00:00
@@ -2,11 +2,12 @@
.. _torch_compile_transformer:

Compiling a Transformer using torch.compile and TensorRT
==============================================================

-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.dynamo.compile` workflow on a transformer-based model.
+"""

# %%
# Imports and Model Definition
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--- /home/runner/work/TensorRT/TensorRT/docsrc/add_version_docs.py	2026-03-05 17:45:06.294433+00:00
+++ /home/runner/work/TensorRT/TensorRT/docsrc/add_version_docs.py	2026-03-05 17:45:50.370560+00:00
@@ -49,15 +49,15 @@
    if f'"version": "{version}"' in src:
        print(f"  {version} already present in generate_versions.py, skipping")
        return

    new_entry = (
-        f'    {{\n'
+        f"    {{\n"
        f'        "name": "{version}",\n'
        f'        "version": "{version}",\n'
        f'        "url": "https://pytorch.org/TensorRT/{version}/",\n'
-        f'    }},\n'
+        f"    }},\n"
    )

    new_ver = ver_tuple(version)

    # Find the first existing vX.Y.Z entry whose version is strictly less than
@@ -70,11 +70,14 @@

    if insert_pos is None:
        # All existing entries are >= new version; append before closing bracket
        insert_pos = src.rfind("]")
        if insert_pos == -1:
-            print("Error: could not find insertion point in generate_versions.py", file=sys.stderr)
+            print(
+                "Error: could not find insertion point in generate_versions.py",
+                file=sys.stderr,
+            )
            sys.exit(1)

    gen_versions.write_text(src[:insert_pos] + new_entry + src[insert_pos:])
    print(f"  Inserted {version} into generate_versions.py")

@@ -88,14 +91,17 @@
    print("  Regenerated docs/versions.json")


def stage(repo_root: Path, version: str, docsrc: Path) -> None:
    subprocess.run(
-        ["git", "add",
-         f"docs/{version}",
-         "docs/versions.json",
-         str(docsrc / "generate_versions.py")],
+        [
+            "git",
+            "add",
+            f"docs/{version}",
+            "docs/versions.json",
+            str(docsrc / "generate_versions.py"),
+        ],
        cwd=repo_root,
        check=True,
    )
    print("  Staged changes")

--- /home/runner/work/TensorRT/TensorRT/tools/perf/hub.py	2026-03-05 17:45:06.376221+00:00
+++ /home/runner/work/TensorRT/TensorRT/tools/perf/hub.py	2026-03-05 17:46:00.819482+00:00
@@ -138,13 +138,17 @@
        with open(MANIFEST_FILE, "r") as f:
            manifest = json.load(f)
            if manifest["version"] == torch_version:
                version_matches = True
            else:
-                print("Torch version: {} mismatches \
+                print(
+                    "Torch version: {} mismatches \
                with manifest's version: {}. Re-downloading \
-                all models".format(torch_version, manifest["version"]))
+                all models".format(
+                        torch_version, manifest["version"]
+                    )
+                )

                # Overwrite the manifest version as current torch version
                manifest["version"] = torch_version

    download_models(version_matches, manifest)

@github-actions github-actions bot requested a review from narendasan March 5, 2026 17:48
@meta-cla meta-cla bot added the cla signed label Mar 5, 2026
Copy link

@github-actions github-actions bot left a 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/docsrc/add_version_docs.py	2026-03-05 20:29:46.780559+00:00
+++ /home/runner/work/TensorRT/TensorRT/docsrc/add_version_docs.py	2026-03-05 20:30:27.594382+00:00
@@ -49,15 +49,15 @@
    if f'"version": "{version}"' in src:
        print(f"  {version} already present in generate_versions.py, skipping")
        return

    new_entry = (
-        f'    {{\n'
+        f"    {{\n"
        f'        "name": "{version}",\n'
        f'        "version": "{version}",\n'
        f'        "url": "https://pytorch.org/TensorRT/{version}/",\n'
-        f'    }},\n'
+        f"    }},\n"
    )

    new_ver = ver_tuple(version)

    # Find the first existing vX.Y.Z entry whose version is strictly less than
@@ -70,11 +70,14 @@

    if insert_pos is None:
        # All existing entries are >= new version; append before closing bracket
        insert_pos = src.rfind("]")
        if insert_pos == -1:
-            print("Error: could not find insertion point in generate_versions.py", file=sys.stderr)
+            print(
+                "Error: could not find insertion point in generate_versions.py",
+                file=sys.stderr,
+            )
            sys.exit(1)

    gen_versions.write_text(src[:insert_pos] + new_entry + src[insert_pos:])
    print(f"  Inserted {version} into generate_versions.py")

@@ -88,14 +91,17 @@
    print("  Regenerated docs/versions.json")


def stage(repo_root: Path, version: str, docsrc: Path) -> None:
    subprocess.run(
-        ["git", "add",
-         f"docs/{version}",
-         "docs/versions.json",
-         str(docsrc / "generate_versions.py")],
+        [
+            "git",
+            "add",
+            f"docs/{version}",
+            "docs/versions.json",
+            str(docsrc / "generate_versions.py"),
+        ],
        cwd=repo_root,
        check=True,
    )
    print("  Staged changes")

--- /home/runner/work/TensorRT/TensorRT/tools/perf/hub.py	2026-03-05 20:29:46.858344+00:00
+++ /home/runner/work/TensorRT/TensorRT/tools/perf/hub.py	2026-03-05 20:30:37.946656+00:00
@@ -138,13 +138,17 @@
        with open(MANIFEST_FILE, "r") as f:
            manifest = json.load(f)
            if manifest["version"] == torch_version:
                version_matches = True
            else:
-                print("Torch version: {} mismatches \
+                print(
+                    "Torch version: {} mismatches \
                with manifest's version: {}. Re-downloading \
-                all models".format(torch_version, manifest["version"]))
+                all models".format(
+                        torch_version, manifest["version"]
+                    )
+                )

                # Overwrite the manifest version as current torch version
                manifest["version"] = torch_version

    download_models(version_matches, manifest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries/all Build for all Python Versions cla signed documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant