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
Note: we fully use of PyTorch [observer methonds](https://pytorch.org/docs/stable/quantization-support.html#torch-quantization-observer), so you can use a different PyTorch obsever methond to define the [QConfig](https://pytorch.org/docs/1.11/generated/torch.quantization.qconfig.QConfig.html). For weight observer, we only support **torch.qint8** dtype now.
25
34
26
-
**Suggestion**: For activation observer, if your set **qscheme** with **torch.per_tensor_affine**, the dtype prefer to **torch.quint8**, if you set the **qscheme** with **torch.per_tensor_symmetric**, the dtype prefer to **torch.qint8**. For weight observer, setting **qscheme** to **torch.per_channel_symmetric** can get a better accuracy,
35
+
**Suggestion**:
36
+
37
+
1. For activation observer, if your set **qscheme** with **torch.per_tensor_affine**, **torch.quint8** is preferred, if you set the **qscheme** with **torch.per_tensor_symmetric**, **torch.qint8** is preferred. For weight observer, setting **qscheme** to **torch.per_channel_symmetric** can get a better accuracy.
38
+
2. If your CPU device doesn't support VNNI, seeting the observer's **reduce_range** to **True** can get a better accuracy, such as skylake.
27
39
28
40
### Prepare Model and Do Calibration
29
41
@@ -74,14 +86,29 @@ from intel_extension_for_pytorch.quantization import prepare, convert
Note: For weight observer, it only support dtype **torch.qint8**, and the qscheme only can be **torch.per_tensor_symmetric** or **torch.per_channel_symmetric**.
106
+
Note: For weight observer, it only supports dtype **torch.qint8**, and the qscheme only can be **torch.per_tensor_symmetric** or **torch.per_channel_symmetric**. For activation observer, it only supports dtype **torch.float**, and the compute_dtype can be **torch.quint8** or **torch.qint8**.
107
+
108
+
**Suggestion**:
109
+
110
+
1. For weight observer, setting **qscheme** to **torch.per_channel_symmetric** can get a better accuracy.
111
+
2. If your CPU device doesn't support VNNI, seeting the observer's **reduce_range** to **True** can get a better accuracy, such as skylake.
0 commit comments