forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CD] Enable pypi dependencies both for XPU linux and Windows whls (py…
…torch#141135) Enable xpu runtime pypi packages as dependencies of XPU CD wheels both for Linux and Windows. Fixes pytorch#135867 Works for pytorch#139722 and pytorch#114850 Pull Request resolved: pytorch#141135 Approved by: https://github.com/atalman
- Loading branch information
1 parent
44707b0
commit a23ac6f
Showing
7 changed files
with
140 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
export TH_BINARY_BUILD=1 | ||
export USE_CUDA=0 | ||
|
||
# Keep an array of cmake variables to add to | ||
if [[ -z "$CMAKE_ARGS" ]]; then | ||
# These are passed to tools/build_pytorch_libs.sh::build() | ||
CMAKE_ARGS=() | ||
fi | ||
if [[ -z "$EXTRA_CAFFE2_CMAKE_FLAGS" ]]; then | ||
# These are passed to tools/build_pytorch_libs.sh::build_caffe2() | ||
EXTRA_CAFFE2_CMAKE_FLAGS=() | ||
fi | ||
|
||
|
||
# Refer https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpus.html | ||
source /opt/intel/oneapi/compiler/latest/env/vars.sh | ||
source /opt/intel/oneapi/pti/latest/env/vars.sh | ||
source /opt/intel/oneapi/umf/latest/env/vars.sh | ||
export USE_STATIC_MKL=1 | ||
|
||
WHEELHOUSE_DIR="wheelhousexpu" | ||
LIBTORCH_HOUSE_DIR="libtorch_housexpu" | ||
if [[ -z "$PYTORCH_FINAL_PACKAGE_DIR" ]]; then | ||
if [[ -z "$BUILD_PYTHONLESS" ]]; then | ||
PYTORCH_FINAL_PACKAGE_DIR="/remote/wheelhousexpu" | ||
else | ||
PYTORCH_FINAL_PACKAGE_DIR="/remote/libtorch_housexpu" | ||
fi | ||
fi | ||
mkdir -p "$PYTORCH_FINAL_PACKAGE_DIR" || true | ||
|
||
OS_NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release) | ||
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then | ||
LIBGOMP_PATH="/usr/lib64/libgomp.so.1" | ||
elif [[ "$OS_NAME" == *"Red Hat Enterprise Linux"* ]]; then | ||
LIBGOMP_PATH="/usr/lib64/libgomp.so.1" | ||
elif [[ "$OS_NAME" == *"AlmaLinux"* ]]; then | ||
LIBGOMP_PATH="/usr/lib64/libgomp.so.1" | ||
elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then | ||
if [[ "$(uname -m)" == "s390x" ]]; then | ||
LIBGOMP_PATH="/usr/lib/s390x-linux-gnu/libgomp.so.1" | ||
else | ||
LIBGOMP_PATH="/usr/lib/x86_64-linux-gnu/libgomp.so.1" | ||
fi | ||
fi | ||
|
||
DEPS_LIST=( | ||
"$LIBGOMP_PATH" | ||
"/opt/intel/oneapi/compiler/latest/lib/libOpenCL.so.1" | ||
) | ||
|
||
DEPS_SONAME=( | ||
"libgomp.so.1" | ||
"libOpenCL.so.1" | ||
) | ||
|
||
if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then | ||
echo "Bundling with xpu support package libs." | ||
DEPS_LIST+=( | ||
"/opt/intel/oneapi/compiler/latest/lib/libsycl.so.8" | ||
"/opt/intel/oneapi/compiler/latest/lib/libur_loader.so.0" | ||
"/opt/intel/oneapi/compiler/latest/lib/libur_adapter_level_zero.so.0" | ||
"/opt/intel/oneapi/compiler/latest/lib/libur_adapter_opencl.so.0" | ||
"/opt/intel/oneapi/compiler/latest/lib/libsvml.so" | ||
"/opt/intel/oneapi/compiler/latest/lib/libirng.so" | ||
"/opt/intel/oneapi/compiler/latest/lib/libimf.so" | ||
"/opt/intel/oneapi/compiler/latest/lib/libintlc.so.5" | ||
"/opt/intel/oneapi/pti/latest/lib/libpti_view.so.0.10" | ||
"/opt/intel/oneapi/umf/latest/lib/libumf.so.0" | ||
"/opt/intel/oneapi/tcm/latest/lib/libhwloc.so.15" | ||
) | ||
DEPS_SONAME+=( | ||
"libsycl.so.8" | ||
"libur_loader.so.0" | ||
"libur_adapter_level_zero.so.0" | ||
"libur_adapter_opencl.so.0" | ||
"libsvml.so" | ||
"libirng.so" | ||
"libimf.so" | ||
"libintlc.so.5" | ||
"libpti_view.so.0.10" | ||
"libumf.so.0" | ||
"libhwloc.so.15" | ||
) | ||
else | ||
echo "Using xpu runtime libs from pypi." | ||
XPU_RPATHS=( | ||
'$ORIGIN/../../../..' | ||
) | ||
XPU_RPATHS=$(IFS=: ; echo "${XPU_RPATHS[*]}") | ||
export C_SO_RPATH=$XPU_RPATHS':$ORIGIN:$ORIGIN/lib' | ||
export LIB_SO_RPATH=$XPU_RPATHS':$ORIGIN' | ||
export FORCE_RPATH="--force-rpath" | ||
fi | ||
|
||
rm -rf /usr/local/cuda* | ||
|
||
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
if [[ -z "$BUILD_PYTHONLESS" ]]; then | ||
BUILD_SCRIPT=build_common.sh | ||
else | ||
BUILD_SCRIPT=build_libtorch.sh | ||
fi | ||
source ${SOURCE_DIR}/${BUILD_SCRIPT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
.github/workflows/generated-linux-binary-manywheel-nightly.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.