Skip to content

Commit

Permalink
Merge remote-tracking branch 'gitlab/master-pt1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
EikanWang committed Jun 18, 2021
2 parents 82e3086 + 5e65aa0 commit e06371c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 44 deletions.
48 changes: 5 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,19 @@ Intel Extension for PyTorch is a Python package to extend official PyTorch. It i
|[v1.0.1](https://github.com/intel/intel-extension-for-pytorch/tree/v1.0.1)|[v1.5.0-rc3](https://github.com/pytorch/pytorch/tree/v1.5.0-rc3 "v1.5.0-rc3")|
|[v1.0.0](https://github.com/intel/intel-extension-for-pytorch/tree/v1.0.0)|[v1.5.0-rc3](https://github.com/pytorch/pytorch/tree/v1.5.0-rc3 "v1.5.0-rc3")|

Take Intel-Extension-for-Pytorch v1.8.0 as the example.

1. Install PyTorch from binary
```bash
conda install pytorch torchvision torchaudio cpuonly -c pytorch
```

2. Install PyTorch from source

Get PyTorch v1.8.0 source(Refer to [PyTorch guide](https://github.com/pytorch/pytorch#get-the-pytorch-source) for more details)
```bash
git clone --recursive https://github.com/pytorch/pytorch
```

Checkout PyTorch to the specified version
```bash
cd pytorch
git checkout v1.8.0
```

Update submodules
```bash
git submodule sync
git submodule update --init --recursive
```

Build and install PyTorch (Refer to [PyTorch guide](https://github.com/pytorch/pytorch#install-pytorch) for more details)
```bash
python setup.py install
```

### Install Intel Extension for PyTorch from Source

Get the source code of Intel Extension for PyTorch
For IPEX version earlier than 1.8.0, a patch has to be manually applied to PyTorch source code. Please check previous installation guide.

From IPEX 1.8.0, compiling PyTorch from source is not required. If you still want to compile PyTorch, please follow instructions [here](https://github.com/pytorch/pytorch#installation). Please make sure to checkout the correct PyTorch version according to the table above.

```bash
git clone --recursive https://github.com/intel/intel-extension-for-pytorch
cd intel-extension-for-pytorch

# if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive
```

Install dependencies
```bash
pip install lark-parser hypothesis
```

Install the extension
```bash
cd ${intel_extension_for_pytorch_directory}
# run setup.py to compile IPEX and install the binaries
python setup.py install
```

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def build_extension(self, ext):
'-DPYTHON_INCLUDE_DIR=' + python_include_dir,
'-DPYTORCH_INCLUDE_DIRS=' + pytorch_install_dir + "/include",
'-DPYTORCH_LIBRARY_DIRS=' + pytorch_install_dir + "/lib",
'-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=' + str(int(torch._C._GLIBCXX_USE_CXX11_ABI)),
]

if _check_env_flag("IPEX_DISP_OP"):
Expand Down
2 changes: 1 addition & 1 deletion third_party/torch_ccl
Submodule torch_ccl updated 2 files
+7 −7 CMakeLists.txt
+1 −1 README.md

0 comments on commit e06371c

Please sign in to comment.