Skip to content

Commit

Permalink
Build PyTorch with USE_STATIC_MKL=1 (#2792)
Browse files Browse the repository at this point in the history
Build PyTorch with static MKL to minimize the number of runtime
dependencies.
Fixes #2791.
  • Loading branch information
pbchekin authored Nov 22, 2024
1 parent 229f7a1 commit 325fefa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-pytorch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ runs:
uses: ./.github/actions/load
env:
# Increase this value to reset cache
CACHE_NUMBER: 12
CACHE_NUMBER: 14
with:
path: pytorch
key: pytorch-$PYTORCH_CACHE_KEY-$CACHE_NUMBER
Expand Down Expand Up @@ -120,7 +120,7 @@ runs:
cd pytorch
pip install wheel
pip install -r requirements.txt
python setup.py bdist_wheel
USE_STATIC_MKL=1 python setup.py bdist_wheel
- name: Install PyTorch (built from source)
if: ${{ inputs.mode == 'source' }}
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile-pytorch-ipex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if [[ $BUILD_PYTORCH = true ]]; then
echo "****** Building $PYTORCH_PROJ ******"
pip install -r requirements.txt
pip install cmake ninja "numpy<2.0"
python setup.py bdist_wheel
USE_STATIC_MKL=1 python setup.py bdist_wheel

echo "****** Installing PyTorch ******"
pip install dist/*.whl
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ $SCRIPTS_DIR/patch-pytorch.sh
echo "****** Building $PYTORCH_PROJ ******"
pip install -r requirements.txt
pip install cmake ninja
python setup.py bdist_wheel
USE_STATIC_MKL=1 python setup.py bdist_wheel

echo "****** Installing PyTorch ******"
pip install dist/*.whl
Expand Down

0 comments on commit 325fefa

Please sign in to comment.