Skip to content

Commit 325fefa

Browse files
authored
Build PyTorch with USE_STATIC_MKL=1 (#2792)
Build PyTorch with static MKL to minimize the number of runtime dependencies. Fixes #2791.
1 parent 229f7a1 commit 325fefa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/actions/setup-pytorch/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ runs:
8383
uses: ./.github/actions/load
8484
env:
8585
# Increase this value to reset cache
86-
CACHE_NUMBER: 12
86+
CACHE_NUMBER: 14
8787
with:
8888
path: pytorch
8989
key: pytorch-$PYTORCH_CACHE_KEY-$CACHE_NUMBER
@@ -120,7 +120,7 @@ runs:
120120
cd pytorch
121121
pip install wheel
122122
pip install -r requirements.txt
123-
python setup.py bdist_wheel
123+
USE_STATIC_MKL=1 python setup.py bdist_wheel
124124
125125
- name: Install PyTorch (built from source)
126126
if: ${{ inputs.mode == 'source' }}

scripts/compile-pytorch-ipex.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ if [[ $BUILD_PYTORCH = true ]]; then
117117
echo "****** Building $PYTORCH_PROJ ******"
118118
pip install -r requirements.txt
119119
pip install cmake ninja "numpy<2.0"
120-
python setup.py bdist_wheel
120+
USE_STATIC_MKL=1 python setup.py bdist_wheel
121121

122122
echo "****** Installing PyTorch ******"
123123
pip install dist/*.whl

scripts/install-pytorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ $SCRIPTS_DIR/patch-pytorch.sh
155155
echo "****** Building $PYTORCH_PROJ ******"
156156
pip install -r requirements.txt
157157
pip install cmake ninja
158-
python setup.py bdist_wheel
158+
USE_STATIC_MKL=1 python setup.py bdist_wheel
159159

160160
echo "****** Installing PyTorch ******"
161161
pip install dist/*.whl

0 commit comments

Comments
 (0)