Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5de96a8

Browse files
[quant] Rename "2.0" to "2", remove "static" (#2576)
* [quant] Rename "2.0" to "2", remove "static" --------- Co-authored-by: Jerry Zhang <[email protected]>
1 parent c36e668 commit 5de96a8

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

prototype_source/prototype_index.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ Prototype features are not available as part of binary distributions like PyPI o
6969
:tags: Debugging,Quantization
7070

7171
.. customcarditem::
72-
:header: How to Write a Quantizer for PyTorch 2.0 Export Quantization
73-
:card_description: Learn how to implement a Quantizer for PT2.0 Export Quantization
72+
:header: How to Write a Quantizer for PyTorch 2 Export Quantization
73+
:card_description: Learn how to implement a Quantizer for PT2 Export Quantization
7474
:image: ../_static/img/thumbnails/cropped/generic-pytorch-logo.png
7575
:link: ../prototype/pt2e_quantizer.html
7676
:tags: Quantization
7777

7878
.. customcarditem::
79-
:header: PyTorch 2.0 Export Post Training Static Quantization
80-
:card_description: Learn how to use Post Training Static Quantization in PyTorch 2.0 Export.
79+
:header: PyTorch 2 Export Post Training Quantization
80+
:card_description: Learn how to use Post Training Quantization in PyTorch 2 Export.
8181
:image: ../_static/img/thumbnails/cropped/generic-pytorch-logo.png
82-
:link: ../prototype/pt2e_quant_ptq_static.html
82+
:link: ../prototype/pt2e_quant_ptq.html
8383
:tags: Quantization
8484

8585
.. customcarditem::
@@ -223,8 +223,10 @@ Prototype features are not available as part of binary distributions like PyPI o
223223
prototype/fx_graph_mode_ptq_dynamic.html
224224
prototype/fx_graph_mode_ptq_static.html
225225
prototype/graph_mode_dynamic_bert_tutorial.html
226-
prototype/quantization_in_pytorch_2_0_export_tutorial.html
227226
prototype/inductor_cpp_wrapper_tutorial.html
227+
prototype/pt2e_quantizer.html
228+
prototype/pt2e_quant_ptq.html
229+
prototype/pt2e_quant_qat.html
228230
prototype/ios_gpu_workflow.html
229231
prototype/nnapi_mobilenetv2.html
230232
prototype/tracing_based_selective_build.html

prototype_source/pt2e_quant_ptq_static.rst renamed to prototype_source/pt2e_quant_ptq.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(prototype) PyTorch 2.0 Export Post Training Static Quantization
1+
(prototype) PyTorch 2 Export Post Training Quantization
22
================================================================
33
**Author**: `Jerry Zhang <https://github.com/jerryzh168>`_
44

@@ -13,7 +13,7 @@ better programmability, and a simplified UX.
1313
Exportable by `torch.export.export` is a prerequisite to use the flow, you can
1414
find what are the constructs that's supported in `Export DB <https://pytorch.org/docs/main/generated/exportdb/index.html>`_.
1515

16-
The high level architecture of quantization 2.0 with quantizer could look like
16+
The high level architecture of quantization 2 with quantizer could look like
1717
this:
1818

1919
::
@@ -46,7 +46,7 @@ this:
4646
Executorch, Inductor or <Other Backends>
4747

4848

49-
The PyTorch 2.0 export quantization API looks like this:
49+
The PyTorch 2 export quantization API looks like this:
5050

5151
.. code:: python
5252
@@ -93,10 +93,10 @@ The PyTorch 2.0 export quantization API looks like this:
9393
# we have a model with aten ops doing integer computations when possible
9494
9595
96-
Motivation of PyTorch 2.0 Export Quantization
96+
Motivation of PyTorch 2 Export Quantization
9797
---------------------------------------------
9898

99-
In PyTorch versions prior to 2.0, we have FX Graph Mode Quantization that uses
99+
In PyTorch versions prior to 2, we have FX Graph Mode Quantization that uses
100100
`QConfigMapping <https://pytorch.org/docs/main/generated/torch.ao.quantization.qconfig_mapping.QConfigMapping.html>`_
101101
and `BackendConfig <https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendConfig.html>`_
102102
for customizations. ``QConfigMapping`` allows modeling users to specify how
@@ -394,7 +394,7 @@ the different configuration APIs supported by ``XNNPackQuantizer``:
394394
`tutorial <https://pytorch.org/tutorials/prototype/pt2e_quantizer.html>`_
395395
that describes how to write a new ``Quantizer``.
396396

397-
Prepare the Model for Post Training Static Quantization
397+
Prepare the Model for Post Training Quantization
398398
----------------------------------------------------------
399399

400400
``prepare_pt2e`` folds ``BatchNorm`` operators into preceding ``Conv2d``
@@ -572,7 +572,7 @@ Debugging the Quantized Model
572572

573573
You can use `Numeric Suite <https://pytorch.org/docs/stable/quantization-accuracy-debugging.html#numerical-debugging-tooling-prototype>`_
574574
that can help with debugging in eager mode and FX graph mode. The new version of
575-
Numeric Suite working with PyTorch 2.0 Export models is still in development.
575+
Numeric Suite working with PyTorch 2 Export models is still in development.
576576

577577
Lowering and Performance Evaluation
578578
------------------------------------
@@ -587,7 +587,7 @@ operators.
587587
Conclusion
588588
--------------
589589

590-
In this tutorial, we went through the overall quantization flow in PyTorch 2.0
590+
In this tutorial, we went through the overall quantization flow in PyTorch 2
591591
Export Quantization using ``XNNPACKQuantizer`` and got a quantized model that
592592
could be further lowered to a backend that supports inference with XNNPACK
593593
backend. To use this for your own backend, please first follow the

prototype_source/pt2e_quantizer.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
How to Write a ``Quantizer`` for PyTorch 2.0 Export Quantization
1+
How to Write a ``Quantizer`` for PyTorch 2 Export Quantization
22
================================================================
33

44
**Author**: `Leslie Fang <https://github.com/leslie-fang-intel>`_, `Weiwen Xia <https://github.com/Xia-Weiwen>`__, `Jiong Gong <https://github.com/jgong5>`__, `Kimish Patel <https://github.com/kimishpatel>`__, `Jerry Zhang <https://github.com/jerryzh168>`__
55

6-
.. note:: Quantization in PyTorch 2.0 export is still a work in progress.
7-
86
Prerequisites:
97
^^^^^^^^^^^^^^^^
108

@@ -14,7 +12,7 @@ Required:
1412

1513
- `Quantization concepts in PyTorch <https://pytorch.org/docs/master/quantization.html#quantization-api-summary>`__
1614

17-
- `(prototype) PyTorch 2.0 Export Post Training Static Quantization <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq_static.html>`__
15+
- `(prototype) PyTorch 2 Export Post Training Quantization <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html>`__
1816

1917
Optional:
2018

@@ -27,11 +25,11 @@ Optional:
2725
Introduction
2826
^^^^^^^^^^^^^
2927

30-
`(prototype) PyTorch 2.0 Export Post Training Static Quantization <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq_static.html>`__ introduced the overall API for pytorch 2.0 export quantization, main difference from fx graph mode quantization in terms of API is that we made it explicit that quantiation is targeting a specific backend. So to use the new flow, backend need to implement a ``Quantizer`` class that encodes:
28+
`(prototype) PyTorch 2 Export Post Training Quantization <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq.html>`__ introduced the overall API for pytorch 2 export quantization, main difference from fx graph mode quantization in terms of API is that we made it explicit that quantiation is targeting a specific backend. So to use the new flow, backend need to implement a ``Quantizer`` class that encodes:
3129
(1). What is supported quantized operator or patterns in the backend
3230
(2). How can users express the way they want their floating point model to be quantized, for example, quantized the whole model to be int8 symmetric quantization, or quantize only linear layers etc.
3331

34-
Please see `here <https://pytorch.org/tutorials/prototype/pt2e_quant_ptq_static.html#motivation-of-pytorch-2-0-export-quantization>`__ For motivations for the new API and ``Quantizer``.
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``.
3533

3634
An existing quantizer object defined for ``XNNPACK`` is in
3735
`QNNPackQuantizer <https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/pt2e/quantizer/xnnpack_quantizer.py>`__
@@ -307,7 +305,7 @@ functions that are used in the example:
307305
Conclusion
308306
^^^^^^^^^^^^^^^^^^^
309307

310-
With this tutorial, we introduce the new quantization path in PyTorch 2.0. Users can learn about
311-
how to define a ``BackendQuantizer`` with the ``QuantizationAnnotation API`` and integrate it into the quantization 2.0 flow.
308+
With this tutorial, we introduce the new quantization path in PyTorch 2. Users can learn about
309+
how to define a ``BackendQuantizer`` with the ``QuantizationAnnotation API`` and integrate it into the PyTorch 2 Export Quantization flow.
312310
Examples of ``QuantizationSpec``, ``SharedQuantizationSpec``, ``FixedQParamsQuantizationSpec``, and ``DerivedQuantizationSpec``
313-
are given for specific annotation use case. This is a prerequisite to be able to quantize a model in PyTorch 2.0 Export Quantization flow. 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_static.html>`_ to actually quantize your model.
311+
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.

0 commit comments

Comments
 (0)