|
1 | 1 | .. _torch_compile:
|
2 | 2 |
|
3 |
| -Dynamo / ``torch.compile`` |
4 |
| ----------------------------- |
| 3 | +Torch-TensorRT Examples |
| 4 | +==================================== |
5 | 5 |
|
6 |
| -Torch-TensorRT provides a backend for the new ``torch.compile`` API released in PyTorch 2.0. In the following examples we describe |
7 |
| -a number of ways you can leverage this backend to accelerate inference. |
| 6 | +Please refer to the following examples which demonstrate the usage of different features of Torch-TensorRT. We also provide |
| 7 | +examples of Torch-TensorRT compilation of select computer vision and language models. |
8 | 8 |
|
9 |
| -* :ref:`torch_compile_resnet`: Compiling a ResNet model using the Torch Compile Frontend for ``torch_tensorrt.compile`` |
10 |
| -* :ref:`torch_compile_transformer`: Compiling a Transformer model using ``torch.compile`` |
| 9 | +Dependencies |
| 10 | +------------------------------------ |
| 11 | + |
| 12 | +Please install the following external depencies (assuming you already have `torch_tensorrt` installed) |
| 13 | + |
| 14 | +.. code-block:: python |
| 15 | +
|
| 16 | + pip install -r requirements.txt |
| 17 | +
|
| 18 | +
|
| 19 | +Compiler Features |
| 20 | +------------------------------------ |
11 | 21 | * :ref:`torch_compile_advanced_usage`: Advanced usage including making a custom backend to use directly with the ``torch.compile`` API
|
12 |
| -* :ref:`torch_compile_stable_diffusion`: Compiling a Stable Diffusion model using ``torch.compile`` |
13 | 22 | * :ref:`torch_export_cudagraphs`: Using the Cudagraphs integration with `ir="dynamo"`
|
14 | 23 | * :ref:`custom_kernel_plugins`: Creating a plugin to use a custom kernel inside TensorRT engines
|
15 | 24 | * :ref:`refit_engine_example`: Refitting a compiled TensorRT Graph Module with updated weights
|
16 | 25 | * :ref:`mutable_torchtrt_module_example`: Compile, use, and modify TensorRT Graph Module with MutableTorchTensorRTModule
|
17 | 26 | * :ref:`vgg16_fp8_ptq`: Compiling a VGG16 model with FP8 and PTQ using ``torch.compile``
|
18 | 27 | * :ref:`engine_caching_example`: Utilizing engine caching to speed up compilation times
|
19 | 28 | * :ref:`engine_caching_bert_example`: Demonstrating engine caching on BERT
|
| 29 | + |
| 30 | +Model Zoo |
| 31 | +------------------------------------ |
| 32 | +* :ref:`torch_compile_resnet`: Compiling a ResNet model using the Torch Compile Frontend for ``torch_tensorrt.compile`` |
| 33 | +* :ref:`torch_compile_transformer`: Compiling a Transformer model using ``torch.compile`` |
| 34 | +* :ref:`torch_compile_stable_diffusion`: Compiling a Stable Diffusion model using ``torch.compile`` |
| 35 | +* :ref:`_torch_export_gpt2`: Compiling a GPT2 model using AOT workflow (`ir=dynamo`) |
| 36 | +* :ref:`_torch_export_llama2`: Compiling a Llama2 model using AOT workflow (`ir=dynamo`) |
0 commit comments