You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/tutorials_source/pt2e_quantizer.rst
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -32,16 +32,16 @@ Introduction
32
32
Please see `here <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html#motivation-of-pytorch-2-export-quantization>`__ For motivations for the new API and ``Quantizer``.
33
33
34
34
An existing quantizer object defined for ``XNNPACK`` is in
or `FakeQuantizeBase <https://github.com/pytorch/pytorch/blob/07104ca99c9d297975270fb58fda786e60b49b38/torch/ao/quantization/fake_quantize.py#L60>`__)
or `FakeQuantizeBase <https://github.com/pytorch/ao/blob/b96354087db6d0480ebbc10d5a63a9ca49c19dfa/torchao/quantization/pt2e/fake_quantize.py#L78>`__)
254
254
as input. From each ``ObserverOrFakeQuantize`` object, user can get the ``scale``, ``zero point`` value.
255
255
User can define its heuristic about how to derive new ``scale``, ``zero point`` value based on the
256
256
quantization parameters calculated from the observer or fake quant instances.
@@ -293,13 +293,13 @@ and run a `toy example <https://gist.github.com/leslie-fang-intel/b78ed682aa9b54
293
293
with ``Torchvision Resnet18``. To better understand the final example, here are the classes and utility
`get_weight_qspec <https://github.com/pytorch/pytorch/blob/47cfcf566ab76573452787335f10c9ca185752dc/torch/ao/quantization/_pt2e/quantizer/utils.py#L36>`__, and
`get_weight_qspec <https://github.com/pytorch/ao/blob/b96354087db6d0480ebbc10d5a63a9ca49c19dfa/torchao/quantization/pt2e/quantizer/utils.py#L74>`__, and
can be used to get the ``QuantizationSpec`` from ``QuantizationConfig`` for a specific pattern.
304
304
305
305
A Note on IR for PT2E Quantization Flow
@@ -378,4 +378,4 @@ Conclusion
378
378
With this tutorial, we introduce the new quantization path in PyTorch 2. Users can learn about
379
379
how to define a ``BackendQuantizer`` with the ``QuantizationAnnotation API`` and integrate it into the PyTorch 2 Export Quantization flow.
380
380
Examples of ``QuantizationSpec``, ``SharedQuantizationSpec``, ``FixedQParamsQuantizationSpec``, and ``DerivedQuantizationSpec``
381
-
are given for specific annotation use case. You can use `XNNPACKQuantizer <https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/quantizer/xnnpack_quantizer.py>`_ as an example to start implementing your own ``Quantizer``. After that please follow `this tutorial <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html>`_ to actually quantize your model.
381
+
are given for specific annotation use case. You can use `XNNPACKQuantizer <https://github.com/pytorch/executorch/blob/752f6a729d3a2090b43ace6915086d8b4e03644f/backends/xnnpack/quantizer/xnnpack_quantizer.py>`_ as an example to start implementing your own ``Quantizer``. After that please follow `this tutorial <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html>`_ to actually quantize your model.
0 commit comments