Skip to content

Commit 456459a

Browse files
tye1jingxu10
andauthored
[Doc] Update installation.md for PVC and Arc GPU (#2127)
* Update installation.md for PVC and Arc GPU Co-authored-by: Xu, Jing <[email protected]>
1 parent e065cf7 commit 456459a

File tree

1 file changed

+90
-36
lines changed

1 file changed

+90
-36
lines changed

docs/tutorials/installation.md

Lines changed: 90 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,138 @@
1-
# Build and Install from Source Code
1+
Installation Guide
2+
==================
23

3-
This is guide to build an Intel® Extension for PyTorch* PyPI package from source and install it in Linux.
4-
5-
6-
## Prepare
4+
## System Requirements
75

86
### Hardware Requirement
97

108
Verified Hardware Platforms:
119
- Intel® Data Center GPU Flex Series 170
10+
- Intel® Data Center GPU Max Series
11+
- Intel® Arc™ A-Series Graphics (with limited validation)
1212

1313
### Software Requirements
1414

15-
- Ubuntu 20.04 (64-bit)
15+
- Ubuntu 22.04 (64-bit)
1616
- Intel GPU Drivers
17-
- Intel® Data Center GPU Flex Series [419.40](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html)
18-
- Intel® oneAPI Base Toolkit 2022.3
17+
- Intel® Data Center GPU Flex Series [TBD](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html)
18+
- Intel® Data Center GPU Max Series [TBD](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html)
19+
- Intel® Arc™ A-Series Graphics [TBD](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html)
20+
- Intel® oneAPI Base Toolkit 2023.0
1921
- Python 3.7-3.10
2022

23+
## PyTorch-Intel® Extension for PyTorch\* Version Mapping
24+
25+
Intel® Extension for PyTorch\* has to work with a corresponding version of PyTorch. Here are the PyTorch versions that we support and the mapping relationship:
26+
27+
|PyTorch Version|Extension Version|
28+
|--|--|
29+
|[v1.13.\*](https://github.com/pytorch/pytorch/tree/v1.13.0) (patches needed)|[v1.13.\*](https://github.com/intel/intel-extension-for-pytorch/tree/v1.13.10+xpu)|
30+
|[v1.10.\*](https://github.com/pytorch/pytorch/tree/v1.10.0) (patches needed)|[v1.10.\*](https://github.com/intel/intel-extension-for-pytorch/tree/v1.10.200+gpu)|
31+
32+
## Preparations
33+
2134
### Install Intel GPU Driver
2235

2336
|Release|OS|Intel GPU|Install Intel GPU Driver|
2437
|-|-|-|-|
25-
|v1.0.0|Ubuntu 20.04|Intel® Data Center GPU Flex Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal-dc.html) for latest driver installation. If install the verified Intel® Data Center GPU Flex Series [419.40](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html), please append the specific version after components, such as `sudo apt-get install intel-opencl-icd=22.28.23726.1+i419~u20.04`|
38+
|v1.0.0|Ubuntu 20.04|Intel® Data Center GPU Flex Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal-dc.html) for the latest driver installation. If installing the verified Intel® Data Center GPU Flex Series [419.40](https://dgpu-docs.intel.com/releases/stable_419_40_20220914.html), use a specific version for component package names, such as `sudo apt-get install intel-opencl-icd=22.28.23726.1+i419~u20.04`|
2639

2740
### Install oneAPI Base Toolkit
2841

29-
Please refer to [Install oneAPI Base Toolkit Packages](https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#base-kit)
42+
Please refer to [Install oneAPI Base Toolkit Packages](https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#base-kit).
3043

3144
Need to install components of Intel® oneAPI Base Toolkit:
3245
- Intel® oneAPI DPC++ Compiler
3346
- Intel® oneAPI Math Kernel Library (oneMKL)
3447

35-
Default installation location is /opt/intel/oneapi for root account, ${HOME}/intel/oneapi for other accounts.
48+
Default installation location *{ONEAPI_ROOT}* is `/opt/intel/oneapi` for root account, `${HOME}/intel/oneapi` for other accounts.
3649

37-
### Configure the AOT
50+
**_NOTE:_** You need to activate oneAPI environment when using Intel® Extension for PyTorch\* on Intel GPU.
3851

39-
Please refer to [AOT documentation](./AOT.md) for how to configure AOT.
52+
```bash
53+
source {ONEAPI_ROOT}/setvars.sh
54+
```
4055

41-
### Build and Install from Source Code
56+
## Install via wheel files
4257

43-
Make sure PyTorch is installed so that the extension will work properly. For each PyTorch release, we have a corresponding release of the extension. Here are the PyTorch versions that we support and the mapping relationship:
58+
Prebuilt wheel files availability matrix for Python versions:
4459

45-
|PyTorch Version|Intel® Extension for PyTorch* Version|
46-
|--|--|
47-
|[v1.10.\*](https://github.com/pytorch/pytorch/tree/v1.10.0 "v1.10.0")|[v1.10.\*](https://github.com/intel/intel-extension-for-pytorch/tree/v1.10.200)|
60+
| Extension Version | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 | Python 3.10 |
61+
| :--: | :--: | :--: | :--: | :--: | :--: |
62+
| 1.13.10+xpu | | ✔️ | ✔️ | ✔️ | ✔️ |
63+
| 1.10.200+gpu | ✔️ | ✔️ | ✔️ | ✔️ | |
4864

65+
### Install PyTorch and TorchVision
4966

50-
Build and Install PyTorch:
67+
```bash
68+
python -m pip install torch==1.13.0a0 torchvision==0.14.0 -f https://developer.intel.com/ipex-whl-stable-xpu
69+
```
70+
71+
**Note:** Installation of TorchVision is optional.
72+
73+
### Install Numpy
74+
75+
Numpy is required to work with PyTorch\*. Verified numpy versions differ according to python versions.
76+
77+
```bash
78+
python -m pip install numpy==1.19.5 # for Python 3.6
79+
python -m pip install numpy==1.21.6 # for Python 3.7
80+
python -m pip install numpy==1.23.4 # for Python 3.8 and 3.9
81+
```
82+
83+
### Install torchaudio (Optional)
84+
85+
Intel® Extension for PyTorch\* doesn't depend on torchaudio. If you need TorchAudio, please follow the [instructions](https://github.com/pytorch/audio/tree/v0.13.0#from-source) to compile it from source. According to torchaudio-pytorch dependency table, torchaudio 0.13.0 is recommended.
86+
87+
### Install Intel® Extension for PyTorch\*
88+
89+
```bash
90+
python -m pip install intel_extension_for_pytorch==1.13.10+xpu -f https://developer.intel.com/ipex-whl-stable-xpu
91+
```
92+
93+
## Install via compiling from source
94+
95+
### Download source code of PyTorch and Intel® Extension for PyTorch\*:
5196

5297
```bash
5398
$ git clone https://github.com/pytorch/pytorch.git
5499
$ cd pytorch
55-
# checkout to specific release branch if in need
56-
$ git checkout ${PYTORCH_RELEASE_BRANCH_NAME}
57-
# apply git patch to pytorch code, e.g., apply patch for pytorch v1.10.
58-
$ git apply ${intel_extension_for_pytorch_directory}/torch_patches/{xpu-1.10}.patch
100+
$ git checkout v1.13.0
101+
102+
$ git clone https://github.com/intel/intel-extension-for-pytorch.git
103+
$ cd intel-extension-for-pytorch
104+
$ git checkout v1.13.10+xpu
105+
```
106+
107+
### Install PyTorch:
108+
109+
```bash
110+
$ cd pytorch
111+
$ git apply ${intel_extension_for_pytorch_directory}/torch_patches/*.patch
112+
$ git submodule sync
59113
$ git submodule update --init --recursive
60114
$ pip install -r requirements.txt
61-
# configure MKL env to enable MKL features
62-
$ source ${oneAPI_HOME}/mkl/latest/env/vars.sh
63-
# build pypi package and install it locally
115+
$ source {ONEAPI_ROOT}/setvars.sh
64116
$ python setup.py bdist_wheel
65117
$ pip install dist/*.whl
66118
```
67119

68-
Build and Install Intel® Extension for PyTorch*:
120+
### Configure the AOT (Optional)
121+
122+
Please refer to [AOT documentation](./AOT.md) for how to configure `USE_AOT_DEVLIST`.
123+
124+
```bash
125+
$ export USE_AOT_DEVLIST='ats-m150,pvc'
126+
```
127+
128+
### Install Intel® Extension for PyTorch\*:
69129

70130
```bash
71-
$ git clone -b xpu-master https://github.com/intel/intel-extension-for-pytorch.git
72131
$ cd intel-extension-for-pytorch
73-
# checkout to specific release branch if in need
74-
$ git checkout ${IPEX_RELEASE_BRANCH_NAME}
132+
$ git submodule sync
75133
$ git submodule update --init --recursive
76134
$ pip install -r requirements.txt
77-
# configure dpcpp compiler env
78-
$ source ${oneAPI_HOME}/compiler/latest/env/vars.sh
79-
# configure MKL env to enable MKL features
80-
$ source ${oneAPI_HOME}/mkl/latest/env/vars.sh
81-
# build pypi package and install it locally
82-
$ ${USE_AOT_DEVLIST} python setup.py bdist_wheel
135+
$ source {ONEAPI_ROOT}/setvars.sh # If you have sourced the oneAPI environment when compiling PyTorch, please skip this step.
136+
$ python setup.py bdist_wheel
83137
$ pip install dist/*.whl
84138
```

0 commit comments

Comments
 (0)