Skip to content

Commit 74f4475

Browse files
committed
chore: Review comments incorporated
Signed-off-by: Anurag Dixit <[email protected]>
1 parent 79c8259 commit 74f4475

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

cpp/bin/torchtrtc/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ torchtrtc [input_file_path] [output_file_path]
108108
TorchScript program, save the created
109109
engine to the path specified as the
110110
output path
111+
--custom-torch-ops=[lib] (repeatable) Shared object/DLL containing custom torch operators
112+
--custom-converters=[lib] (repeatable) Shared object/DLL containing custom converters
111113
input_file_path Path to input TorchScript file
112114
output_file_path Path for compiled TorchScript (or
113115
TensorRT engine) file
@@ -131,3 +133,14 @@ e.g.
131133
```
132134
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@fp16%contiguous" -p f16
133135
```
136+
137+
138+
To run with custom torch operators
139+
```
140+
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts --custom-torch-ops=<path to custom library> "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@fp16%contiguous" -p f16
141+
```
142+
143+
To run with custom converters
144+
```
145+
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts --custom-converters=<path to custom library> "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@fp16%contiguous" -p f16
146+
```

cpp/bin/torchtrtc/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int main(int argc, char** argv) {
176176
args::ValueFlagList<std::string> custom_torch_ops(
177177
parser,
178178
"custom-torch-ops",
179-
"(repeatable) Shared object/DLL containing custom torch operator",
179+
"(repeatable) Shared object/DLL containing custom torch operators",
180180
{"custom-torch-ops"});
181181

182182
args::ValueFlagList<std::string> custom_converters(

docsrc/tutorials/torchtrtc.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ to standard TorchScript. Load with ``torch.jit.load()`` and run like you would r
111111
TorchScript program, save the created
112112
engine to the path specified as the
113113
output path
114+
--custom-torch-ops (repeatable) Shared object/DLL containing custom torch operators
115+
--custom-converters (repeatable) Shared object/DLL containing custom converters
114116
input_file_path Path to input TorchScript file
115117
output_file_path Path for compiled TorchScript (or
116118
TensorRT engine) file
@@ -132,3 +134,13 @@ e.g.
132134
.. code-block:: shell
133135
134136
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@f16%contiguous" -p f16
137+
138+
139+
To run with custom torch operators
140+
.. code-block:: shell
141+
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts --custom-torch-ops=<path to custom library> "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@fp16%contiguous" -p f16
142+
143+
144+
To run with custom converters
145+
.. code-block:: shell
146+
torchtrtc tests/modules/ssd_traced.jit.pt ssd_trt.ts --custom-converters=<path to custom library> "[(1,3,300,300); (1,3,512,512); (1, 3, 1024, 1024)]@fp16%contiguous" -p f16

0 commit comments

Comments
 (0)