Skip to content
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

docs: Example on how to use custom kernels in Torch-TensorRT #2812

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
"ConverterImplSignature": "ConverterImplSignature",
}

nbsphinx_execute = "never"

# -- A patch that prevents Sphinx from cross-referencing ivar tags -------
# See http://stackoverflow.com/a/41184353/3343043

Expand Down
1 change: 1 addition & 0 deletions docsrc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Tutorials
tutorials/_rendered_examples/dynamo/torch_compile_transformers_example
tutorials/_rendered_examples/dynamo/torch_compile_advanced_usage
tutorials/_rendered_examples/dynamo/torch_compile_stable_diffusion
tutorials/_rendered_examples/dynamo/custom_kernel_plugins

Python API Documenation
------------------------
Expand Down
8 changes: 4 additions & 4 deletions docsrc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sphinx==4.5.0
sphinx==5.0.1
sphinx-gallery==0.13.0
breathe==4.33.1
exhale==0.3.1
breathe==4.34.0
exhale==0.3.7
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
nbsphinx==0.8.8
nbsphinx==0.9.3
docutils==0.17.1
pillow
46 changes: 46 additions & 0 deletions docsrc/sg_execution_times.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

:orphan:

.. _sphx_glr_sg_execution_times:


Computation times
=================
**00:00.000** total execution time for 4 files **from all galleries**:

.. container::

.. raw:: html

<style scoped>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
</style>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" class="init">
$(document).ready( function () {
$('table.sg-datatable').DataTable({order: [[1, 'desc']]});
} );
</script>

.. list-table::
:header-rows: 1
:class: table table-striped sg-datatable

* - Example
- Time
- Mem (MB)
* - :ref:`sphx_glr_tutorials__rendered_examples_dynamo_torch_compile_advanced_usage.py` (``../examples/dynamo/torch_compile_advanced_usage.py``)
- 00:00.000
- 0.0
* - :ref:`sphx_glr_tutorials__rendered_examples_dynamo_torch_compile_resnet_example.py` (``../examples/dynamo/torch_compile_resnet_example.py``)
- 00:00.000
- 0.0
* - :ref:`sphx_glr_tutorials__rendered_examples_dynamo_torch_compile_stable_diffusion.py` (``../examples/dynamo/torch_compile_stable_diffusion.py``)
- 00:00.000
- 0.0
* - :ref:`sphx_glr_tutorials__rendered_examples_dynamo_torch_compile_transformers_example.py` (``../examples/dynamo/torch_compile_transformers_example.py``)
- 00:00.000
- 0.0
Binary file added docsrc/tutorials/images/circ_pad_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/dynamo/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ a number of ways you can leverage this backend to accelerate inference.
* :ref:`torch_compile_transformer`: Compiling a Transformer model using ``torch.compile``
* :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:`custom_kernel_plugins`: Creating a plugin to use a custom kernel inside TensorRT engines
Loading
Loading