Skip to content

Commit da4c4c3

Browse files
authored
add numpy torchvison torchaudio installation (#1737)
1 parent fb26b62 commit da4c4c3

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

docs/tutorials/installation.md

+33-6
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,23 @@ Intel® Extension for PyTorch\* has to work with a corresponding version of PyTo
3434

3535
### Install oneAPI Base Toolkit
3636

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

3939
Need to install components of Intel® oneAPI Base Toolkit:
4040
- Intel® oneAPI DPC++ Compiler
4141
- Intel® oneAPI Math Kernel Library (oneMKL)
4242

43-
Default installation location is /opt/intel/oneapi for root account, ${HOME}/intel/oneapi for other accounts.
43+
Default installation location *{ONEAPI_ROOT}* is `/opt/intel/oneapi` for root account, `${HOME}/intel/oneapi` for other accounts.
44+
45+
**_NOTE:_** You need to activate oneAPI environment when using Intel® Extension for PyTorch\* on Intel GPU.
46+
47+
```bash
48+
source {ONEAPI_ROOT}/setvars.sh
49+
```
4450

4551
## Install via wheel files
4652

47-
Prebuilt wheel files availability matrix for Python versions
53+
Prebuilt wheel files availability matrix for Python versions:
4854

4955
| Extension Version | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 | Python 3.10 |
5056
| :--: | :--: | :--: | :--: | :--: | :--: |
@@ -56,6 +62,28 @@ Prebuilt wheel files availability matrix for Python versions
5662
python -m pip install torch==1.10.0a0 -f https://developer.intel.com/ipex-whl-stable-xpu
5763
```
5864

65+
### Install Numpy
66+
67+
Numpy is required to work with PyTorch\*. Verified numpy versions differ according to python versions.
68+
69+
```bash
70+
python -m pip install numpy==1.19.5 # for Python 3.6
71+
python -m pip install numpy==1.21.6 # for Python 3.7
72+
python -m pip install numpy==1.23.4 # for Python 3.8 and 3.9
73+
```
74+
75+
### Install torchvision and torchaudio (Optional)
76+
77+
Intel® Extension for PyTorch\* doesn't depend on torchvision or torchaudio.
78+
79+
You can install torchvision via the following command.
80+
81+
```bash
82+
python -m pip install torchvision==0.11.0+cpu --no-deps -f https://download.pytorch.org/whl/torch_stable.html
83+
```
84+
85+
For torchaudio installation, please follow the [instructions](https://github.com/pytorch/audio/tree/v0.10.0#from-source) to compile it from source. According to torchaudio-pytorch dependency table, torchaudio 0.10.0 is recommended.
86+
5987
### Install Intel® Extension for PyTorch\*
6088

6189
```bash
@@ -84,7 +112,7 @@ $ git apply ${intel_extension_for_pytorch_directory}/torch_patches/*.patch
84112
$ git submodule sync
85113
$ git submodule update --init --recursive
86114
$ pip install -r requirements.txt
87-
$ source ${oneAPI_HOME}/mkl/latest/env/vars.sh
115+
$ source {ONEAPI_ROOT}/setvars.sh
88116
$ python setup.py bdist_wheel
89117
$ pip install dist/*.whl
90118
```
@@ -104,8 +132,7 @@ $ cd intel-extension-for-pytorch
104132
$ git submodule sync
105133
$ git submodule update --init --recursive
106134
$ pip install -r requirements.txt
107-
$ source ${oneAPI_HOME}/compiler/latest/env/vars.sh
108-
$ source ${oneAPI_HOME}/mkl/latest/env/vars.sh
135+
$ source {ONEAPI_ROOT}/setvars.sh # If you have sourced the oneAPI environment when compiling PyTorch, please skip this step.
109136
$ python setup.py bdist_wheel
110137
$ pip install dist/*.whl
111138
```

0 commit comments

Comments
 (0)