Skip to content

Debugging guide for TensorRT #3489

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ User Guide
* :ref:`runtime`
* :ref:`using_dla`
* :ref:`mixed_precision`
* :ref:`debugging`

.. toctree::
:caption: User Guide
Expand All @@ -51,6 +52,7 @@ User Guide
user_guide/runtime
user_guide/using_dla
user_guide/mixed_precision
user_guide/debugging


Tutorials
Expand Down
30 changes: 30 additions & 0 deletions docsrc/user_guide/debugging_torch_tensorrt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _debugging:

Debugging Torch-TensorRT Compilation
====================================


FX Graph Visualization
----------------------

Debug Mode
-------------


Profiling TensorRT Engines
--------------------------

There are some profiling tools built into Torch-TensorRT to measure the performance of TensorRT sub blocks in compiled modules.
This can be used in conjunction with PyTorch profiling tools to get a picture of the performance of your model.
Profiling for any particular sub block can be enabled by the ``enabled_profiling()`` method of any
`` __torch__.classes.tensorrt.Engine`` attribute, or of any ``torch_tensorrt.runtime.TorchTensorRTModule``. The profiler will
dump trace files by default in /tmp, though this path can be customized by either setting the
profile_path_prefix of ``__torch__.classes.tensorrt.Engine`` or as an argument to
torch_tensorrt.runtime.TorchTensorRTModule.enable_precision(profiling_results_dir="").
Traces can be visualized using the Perfetto tool (https://perfetto.dev)

.. image:: /user_guide/images/perfetto.png
:width: 512px
:height: 512px
:scale: 50 %
:align: right
Binary file added docsrc/user_guide/images/perfetto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading