Skip to content

Commit 4a10e9e

Browse files
xuhancnpytorchmergebot
authored andcommitted
update build guide to use mkl-static. (pytorch#116946)
# Background: We found current build guide use mkl dynamic link. It may trigger a mkl link issue. Detailed: In build environment, libtorch_cpu.so will dynamic link to system mkl binaries by default. If users install another version mkl library, it may lead to mkl symbol conflict. I also checked released pytorch binary it use static mkl link. The build script shows it: https://github.com/pytorch/builder/blob/main/common/install_mkl.sh#L10 # Solution: Update build guide to use mkl static link. And it is aligned to build script. Conda install command docs: https://anaconda.org/intel/mkl-static https://anaconda.org/intel/mkl-include # Validation No mkl libraries dependencing, after use `conda install intel::mkl-static intel::mkl-include`. ## Windows ![image](https://github.com/pytorch/pytorch/assets/8433590/cc554ded-d827-4de5-81c6-cc3039155580) ## Linux <img width="959" alt="image" src="https://github.com/pytorch/pytorch/assets/8433590/79766ad8-4ba2-4ff1-adc9-63affd8d419a"> Pull Request resolved: pytorch#116946 Approved by: https://github.com/jgong5, https://github.com/malfet
1 parent b4f1ab4 commit 4a10e9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pip install -r requirements.txt
194194
**On Linux**
195195

196196
```bash
197-
conda install mkl mkl-include
197+
conda install intel::mkl-static intel::mkl-include
198198
# CUDA only: Add LAPACK support for the GPU if needed
199199
conda install -c pytorch magma-cuda110 # or the magma-cuda* that matches your CUDA version from https://anaconda.org/pytorch/repo
200200

@@ -207,15 +207,15 @@ make triton
207207

208208
```bash
209209
# Add this package on intel x86 processor machines only
210-
conda install mkl mkl-include
210+
conda install intel::mkl-static intel::mkl-include
211211
# Add these packages if torch.distributed is needed
212212
conda install pkg-config libuv
213213
```
214214

215215
**On Windows**
216216

217217
```bash
218-
conda install mkl mkl-include
218+
conda install intel::mkl-static intel::mkl-include
219219
# Add these packages if torch.distributed is needed.
220220
# Distributed package support on Windows is a prototype feature and is subject to changes.
221221
conda install -c conda-forge libuv=1.39

0 commit comments

Comments
 (0)