-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
.. _torch_compile: | ||
|
||
Dynamo / ``torch.compile`` | ||
---------------------------- | ||
Torch-TensorRT Examples | ||
==================================== | ||
|
||
Torch-TensorRT provides a backend for the new ``torch.compile`` API released in PyTorch 2.0. In the following examples we describe | ||
a number of ways you can leverage this backend to accelerate inference. | ||
Please refer to the following examples which demonstrate the usage of different features of Torch-TensorRT. We also provide | ||
examples of Torch-TensorRT compilation of select computer vision and language models. | ||
|
||
* :ref:`torch_compile_resnet`: Compiling a ResNet model using the Torch Compile Frontend for ``torch_tensorrt.compile`` | ||
* :ref:`torch_compile_transformer`: Compiling a Transformer model using ``torch.compile`` | ||
Dependencies | ||
------------------------------------ | ||
|
||
Please install the following external depencies (assuming you already have `torch_tensorrt` installed) | ||
|
||
.. code-block:: python | ||
pip install -r requirements.txt | ||
Compiler Features | ||
------------------------------------ | ||
* :ref:`torch_compile_advanced_usage`: Advanced usage including making a custom backend to use directly with the ``torch.compile`` API | ||
* :ref:`torch_compile_stable_diffusion`: Compiling a Stable Diffusion model using ``torch.compile`` | ||
* :ref:`torch_export_cudagraphs`: Using the Cudagraphs integration with `ir="dynamo"` | ||
* :ref:`custom_kernel_plugins`: Creating a plugin to use a custom kernel inside TensorRT engines | ||
* :ref:`refit_engine_example`: Refitting a compiled TensorRT Graph Module with updated weights | ||
* :ref:`mutable_torchtrt_module_example`: Compile, use, and modify TensorRT Graph Module with MutableTorchTensorRTModule | ||
* :ref:`vgg16_fp8_ptq`: Compiling a VGG16 model with FP8 and PTQ using ``torch.compile`` | ||
* :ref:`engine_caching_example`: Utilizing engine caching to speed up compilation times | ||
* :ref:`engine_caching_bert_example`: Demonstrating engine caching on BERT | ||
|
||
Model Zoo | ||
------------------------------------ | ||
* :ref:`torch_compile_resnet`: Compiling a ResNet model using the Torch Compile Frontend for ``torch_tensorrt.compile`` | ||
* :ref:`torch_compile_transformer`: Compiling a Transformer model using ``torch.compile`` | ||
* :ref:`torch_compile_stable_diffusion`: Compiling a Stable Diffusion model using ``torch.compile`` | ||
* :ref:`_torch_export_gpt2`: Compiling a GPT2 model using AOT workflow (`ir=dynamo`) | ||
* :ref:`_torch_export_llama2`: Compiling a Llama2 model using AOT workflow (`ir=dynamo`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cupy==13.1.0 | ||
torch>=2.4.0.dev20240503+cu121 | ||
torch-tensorrt>=2.4.0.dev20240503+cu121 | ||
triton==2.3.0 | ||
diffusers==0.30.3 | ||
transformers==4.44.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters