Skip to content

Commit 5a07177

Browse files
Add how to use C++ wrapper with X86InductorQuantizer
1 parent 79474b1 commit 5a07177

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

prototype_source/pt2e_quant_ptq_x86_inductor.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Prerequisites
88

99
- `PyTorch 2 Export Post Training Quantization <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html>`_
1010
- `TorchInductor and torch.compile concepts in PyTorch <https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html>`_
11+
- `Inductor C++ Wrapper concepts <https://pytorch.org/tutorials/prototype/inductor_cpp_wrapper_tutorial.html>`_
1112

1213
Introduction
1314
^^^^^^^^^^^^^^
@@ -161,7 +162,15 @@ After these steps, we finished running the quantization flow and we will get the
161162
3. Lower into Inductor
162163
------------------------
163164

164-
After we get the quantized model, we will further lower it to the inductor backend.
165+
After we get the quantized model, we will further lower it to the inductor backend. The default Inductor wrapper
166+
generates Python code to invoke both generated kernels and external kernels. Additionally, Inductor supports a C++ wrapper
167+
that generates pure C++ code, seamlessly combining the generated and external kernels.
168+
169+
::
170+
171+
# Optional: using the C++ wrapper instead of default Python wrapper
172+
import torch._inductor.config as config
173+
config.cpp_wrapper = True
165174

166175
::
167176

0 commit comments

Comments
 (0)