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: Intel® Extension for PyTorch* has PyTorch version requirement. Please check more detailed information via the URL below.
17
17
18
18
# Quantization
19
+
20
+
## 1. Quantization with CPU
19
21
If IPEX version is equal or higher than 1.12, please install transformers 4.19.0.
20
22
```shell
21
23
python run_qa.py
@@ -32,6 +34,72 @@ python run_qa.py
32
34
>
33
35
> /path/to/checkpoint/dir is the path to finetune output_dir
34
36
37
+
## 2. Quantization with XPU
38
+
Please build an IPEX docker container with following steps. Please also refer to the [official guide](https://github.com/intel/intel-extension-for-pytorch/tree/xpu-master/docker).
39
+
#### 2.1 Build Container and Environment Variables
You can run a simple sanity test to double confirm if the correct version is installed, and if the software stack can get correct hardware information onboard your system. The command should return PyTorch and IPEX versions installed, as well as GPU card(s) information detected.
82
+
```bash
83
+
source {DPCPPROOT}/env/vars.sh
84
+
source {MKLROOT}/env/vars.sh
85
+
python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.__version__); print(ipex.__version__); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"
86
+
```
87
+
Please also refer to this [tutorial](https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu&version=v2.0.110%2Bxpu) to check system requirements and install dependencies.
0 commit comments