Skip to content

Commit 75ed476

Browse files
author
TRTorch Github Bot
committed
docs: [Automated] Regenerating documenation from
Signed-off-by: TRTorch Github Bot <[email protected]>
1 parent b4b12a1 commit 75ed476

File tree

10 files changed

+99
-164
lines changed

10 files changed

+99
-164
lines changed

docs/_notebooks/Resnet50-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@
690690
</div>
691691
</div>
692692
<p>
693-
<img alt="bf250e9548a3469882a09c02fed1a5ad" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
693+
<img alt="832f033f9337487ba7868b45ff52e9fe" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
694694
</p>
695695
<h1 id="notebooks-resnet50-example--page-root">
696696
TRTorch Getting Started - ResNet 50

docs/_notebooks/lenet-getting-started.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@
784784
</div>
785785
</div>
786786
<p>
787-
<img alt="115352dad3f344b68dd7c007421cc24d" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
787+
<img alt="a469a5f1dc3245c091eb0097581de724" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
788788
</p>
789789
<h1 id="notebooks-lenet-getting-started--page-root">
790790
TRTorch Getting Started - LeNet

docs/_notebooks/ssd-object-detection-demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@
804804
</div>
805805
</div>
806806
<p>
807-
<img alt="5a94e2e3b3dc48038922d2fdab691fba" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
807+
<img alt="6fee1a4f09854ba1a11aed1c38759f74" src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png"/>
808808
</p>
809809
<h1 id="notebooks-ssd-object-detection-demo--page-root">
810810
Object Detection with TRTorch (SSD)

docs/_sources/tutorials/ptq.rst.txt

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ the TensorRT calibrator. With TRTorch we look to leverage existing infrastructur
1414
calibrators easier.
1515

1616
LibTorch provides a ``DataLoader`` and ``Dataset`` API which steamlines preprocessing and batching input data.
17-
These APIs are exposed via both C++ and Python interface which makes it easier for the end user.
18-
For C++ interface, we use ``torch::Dataset`` and ``torch::data::make_data_loader`` objects to construct and perform pre-processing on datasets.
19-
The equivalent functionality in python interface uses ``torch.utils.data.Dataset`` and ``torch.utils.data.DataLoader``.
20-
This section of the PyTorch documentation has more information https://pytorch.org/tutorials/advanced/cpp_frontend.html#loading-data and https://pytorch.org/tutorials/recipes/recipes/loading_data_recipe.html.
17+
This section of the PyTorch documentation has more information https://pytorch.org/tutorials/advanced/cpp_frontend.html#loading-data.
2118
TRTorch uses Dataloaders as the base of a generic calibrator implementation. So you will be able to reuse or quickly
2219
implement a ``torch::Dataset`` for your target domain, place it in a DataLoader and create a INT8 Calibrator
2320
which you can provide to TRTorch to run INT8 Calibration during compliation of your module.
2421

25-
.. _writing_ptq_cpp:
22+
.. _writing_ptq:
2623

27-
How to create your own PTQ application in C++
24+
How to create your own PTQ application
2825
----------------------------------------
2926

3027
Here is an example interface of a ``torch::Dataset`` class for CIFAR10:
@@ -135,73 +132,11 @@ Then all thats required to setup the module for INT8 calibration is to set the f
135132
auto trt_mod = trtorch::CompileGraph(mod, compile_spec);
136133

137134
If you have an existing Calibrator implementation for TensorRT you may directly set the ``ptq_calibrator`` field with a pointer to your calibrator and it will work as well.
135+
138136
From here not much changes in terms of how to execution works. You are still able to fully use LibTorch as the sole interface for inference. Data should remain
139137
in FP32 precision when it's passed into `trt_mod.forward`. There exists an example application in the TRTorch demo that takes you from training a VGG16 network on
140138
CIFAR10 to deploying in INT8 with TRTorch here: https://github.com/NVIDIA/TRTorch/tree/master/cpp/ptq
141139

142-
.. _writing_ptq_python:
143-
144-
How to create your own PTQ application in Python
145-
----------------------------------------
146-
147-
TRTorch Python API provides an easy and convenient way to use pytorch dataloaders with TensorRT calibrators. ``DataLoaderCalibrator`` class can be used to create
148-
a TensorRT calibrator by providing desired configuration. The following code demonstrates an example on how to use it
149-
150-
.. code-block:: python
151-
152-
testing_dataset = torchvision.datasets.CIFAR10(root='./data',
153-
train=False,
154-
download=True,
155-
transform=transforms.Compose([
156-
transforms.ToTensor(),
157-
transforms.Normalize((0.4914, 0.4822, 0.4465),
158-
(0.2023, 0.1994, 0.2010))
159-
]))
160-
161-
testing_dataloader = torch.utils.data.DataLoader(testing_dataset,
162-
batch_size=1,
163-
shuffle=False,
164-
num_workers=1)
165-
calibrator = trtorch.ptq.DataLoaderCalibrator(testing_dataloader,
166-
cache_file='./calibration.cache',
167-
use_cache=False,
168-
algo_type=trtorch.ptq.CalibrationAlgo.ENTROPY_CALIBRATION_2,
169-
device=torch.device('cuda:0'))
170-
171-
compile_spec = {
172-
"input_shapes": [[1, 3, 32, 32]],
173-
"op_precision": torch.int8,
174-
"calibrator": calibrator,
175-
"device": {
176-
"device_type": trtorch.DeviceType.GPU,
177-
"gpu_id": 0,
178-
"dla_core": 0,
179-
"allow_gpu_fallback": False,
180-
"disable_tf32": False
181-
}
182-
}
183-
trt_mod = trtorch.compile(model, compile_spec)
184-
185-
In the cases where there is a pre-existing calibration cache file that users want to use, ``CacheCalibrator`` can be used without any dataloaders. The following example demonstrates how
186-
to use ``CacheCalibrator`` to use in INT8 mode.
187-
188-
.. code-block:: python
189-
190-
calibrator = trtorch.ptq.CacheCalibrator("./calibration.cache")
191-
192-
compile_settings = {
193-
"input_shapes": [[1, 3, 32, 32]],
194-
"op_precision": torch.int8,
195-
"calibrator": calibrator,
196-
"max_batch_size": 32,
197-
}
198-
199-
trt_mod = trtorch.compile(model, compile_settings)
200-
201-
If you already have an existing calibrator class (implemented directly using TensorRT API), you can directly set the calibrator field to your class which can be very convenient.
202-
For a demo on how PTQ can be performed on a VGG network using TRTorch API, you can refer to https://github.com/NVIDIA/TRTorch/blob/master/tests/py/test_ptq_dataloader_calibrator.py
203-
and https://github.com/NVIDIA/TRTorch/blob/master/tests/py/test_ptq_trt_calibrator.py
204-
205140
Citations
206141
^^^^^^^^^^^
207142

docs/_static/pygments.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/py_api/logging.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ <h1 id="py-api-logging--page-root">
432432
Debug
433433
</code>
434434
<em class="property">
435-
= LogLevel.DEBUG
435+
= &lt;LogLevel.DEBUG: 4&gt;
436436
</em>
437437
<a class="headerlink" href="#trtorch.logging.Level.Debug" title="Permalink to this definition">
438438
@@ -447,7 +447,7 @@ <h1 id="py-api-logging--page-root">
447447
Error
448448
</code>
449449
<em class="property">
450-
= LogLevel.ERROR
450+
= &lt;LogLevel.ERROR: 1&gt;
451451
</em>
452452
<a class="headerlink" href="#trtorch.logging.Level.Error" title="Permalink to this definition">
453453
@@ -462,7 +462,7 @@ <h1 id="py-api-logging--page-root">
462462
Info
463463
</code>
464464
<em class="property">
465-
= LogLevel.INFO
465+
= &lt;LogLevel.INFO: 3&gt;
466466
</em>
467467
<a class="headerlink" href="#trtorch.logging.Level.Info" title="Permalink to this definition">
468468
@@ -477,7 +477,7 @@ <h1 id="py-api-logging--page-root">
477477
InternalError
478478
</code>
479479
<em class="property">
480-
= LogLevel.INTERNAL_ERROR
480+
= &lt;LogLevel.INTERNAL_ERROR: 0&gt;
481481
</em>
482482
<a class="headerlink" href="#trtorch.logging.Level.InternalError" title="Permalink to this definition">
483483
@@ -492,7 +492,7 @@ <h1 id="py-api-logging--page-root">
492492
Warning
493493
</code>
494494
<em class="property">
495-
= LogLevel.WARNING
495+
= &lt;LogLevel.WARNING: 2&gt;
496496
</em>
497497
<a class="headerlink" href="#trtorch.logging.Level.Warning" title="Permalink to this definition">
498498

docs/py_api/trtorch.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ <h2 id="functions">
10111011
<span class="sig-paren">
10121012
)
10131013
</span>
1014-
→ &lt;torch._C.ScriptClass object at 0x7f34f707c260&gt;
1014+
→ &lt;torch._C.ScriptClass object at 0x7fb41dd1c618&gt;
10151015
<a class="headerlink" href="#trtorch.TensorRTCompileSpec" title="Permalink to this definition">
10161016
10171017
</a>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/tutorials/getting_started.html

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -614,44 +614,44 @@ <h3 id="creating-a-torchscript-module">
614614
<tr>
615615
<td class="linenos">
616616
<div class="linenodiv">
617-
<pre> 1
618-
2
619-
3
620-
4
621-
5
622-
6
623-
7
624-
8
625-
9
626-
10
627-
11
628-
12
629-
13
630-
14
631-
15
632-
16
633-
17
634-
18
635-
19
636-
20
637-
21
638-
22
639-
23
640-
24
641-
25
642-
26
643-
27
644-
28
645-
29
646-
30
647-
31
648-
32
649-
33
650-
34
651-
35
652-
36
653-
37
654-
38</pre>
617+
<pre><span class="normal"> 1</span>
618+
<span class="normal"> 2</span>
619+
<span class="normal"> 3</span>
620+
<span class="normal"> 4</span>
621+
<span class="normal"> 5</span>
622+
<span class="normal"> 6</span>
623+
<span class="normal"> 7</span>
624+
<span class="normal"> 8</span>
625+
<span class="normal"> 9</span>
626+
<span class="normal">10</span>
627+
<span class="normal">11</span>
628+
<span class="normal">12</span>
629+
<span class="normal">13</span>
630+
<span class="normal">14</span>
631+
<span class="normal">15</span>
632+
<span class="normal">16</span>
633+
<span class="normal">17</span>
634+
<span class="normal">18</span>
635+
<span class="normal">19</span>
636+
<span class="normal">20</span>
637+
<span class="normal">21</span>
638+
<span class="normal">22</span>
639+
<span class="normal">23</span>
640+
<span class="normal">24</span>
641+
<span class="normal">25</span>
642+
<span class="normal">26</span>
643+
<span class="normal">27</span>
644+
<span class="normal">28</span>
645+
<span class="normal">29</span>
646+
<span class="normal">30</span>
647+
<span class="normal">31</span>
648+
<span class="normal">32</span>
649+
<span class="normal">33</span>
650+
<span class="normal">34</span>
651+
<span class="normal">35</span>
652+
<span class="normal">36</span>
653+
<span class="normal">37</span>
654+
<span class="normal">38</span></pre>
655655
</div>
656656
</td>
657657
<td class="code">

docs/tutorials/ptq.html

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -498,52 +498,52 @@ <h2 id="how-to-create-your-own-ptq-application">
498498
<tr>
499499
<td class="linenos">
500500
<div class="linenodiv">
501-
<pre> 1
502-
2
503-
3
504-
4
505-
5
506-
6
507-
7
508-
8
509-
9
510-
10
511-
11
512-
12
513-
13
514-
14
515-
15
516-
16
517-
17
518-
18
519-
19
520-
20
521-
21
522-
22
523-
23
524-
24
525-
25
526-
26
527-
27
528-
28
529-
29
530-
30
531-
31
532-
32
533-
33
534-
34
535-
35
536-
36
537-
37
538-
38
539-
39
540-
40
541-
41
542-
42
543-
43
544-
44
545-
45
546-
46</pre>
501+
<pre><span class="normal"> 1</span>
502+
<span class="normal"> 2</span>
503+
<span class="normal"> 3</span>
504+
<span class="normal"> 4</span>
505+
<span class="normal"> 5</span>
506+
<span class="normal"> 6</span>
507+
<span class="normal"> 7</span>
508+
<span class="normal"> 8</span>
509+
<span class="normal"> 9</span>
510+
<span class="normal">10</span>
511+
<span class="normal">11</span>
512+
<span class="normal">12</span>
513+
<span class="normal">13</span>
514+
<span class="normal">14</span>
515+
<span class="normal">15</span>
516+
<span class="normal">16</span>
517+
<span class="normal">17</span>
518+
<span class="normal">18</span>
519+
<span class="normal">19</span>
520+
<span class="normal">20</span>
521+
<span class="normal">21</span>
522+
<span class="normal">22</span>
523+
<span class="normal">23</span>
524+
<span class="normal">24</span>
525+
<span class="normal">25</span>
526+
<span class="normal">26</span>
527+
<span class="normal">27</span>
528+
<span class="normal">28</span>
529+
<span class="normal">29</span>
530+
<span class="normal">30</span>
531+
<span class="normal">31</span>
532+
<span class="normal">32</span>
533+
<span class="normal">33</span>
534+
<span class="normal">34</span>
535+
<span class="normal">35</span>
536+
<span class="normal">36</span>
537+
<span class="normal">37</span>
538+
<span class="normal">38</span>
539+
<span class="normal">39</span>
540+
<span class="normal">40</span>
541+
<span class="normal">41</span>
542+
<span class="normal">42</span>
543+
<span class="normal">43</span>
544+
<span class="normal">44</span>
545+
<span class="normal">45</span>
546+
<span class="normal">46</span></pre>
547547
</div>
548548
</td>
549549
<td class="code">

0 commit comments

Comments
 (0)