mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[BE] Remove "$PACKAGE_TYPE" == 'conda' logic from build scripts (#142019)
Please see: https://github.com/pytorch/pytorch/issues/138506 Pull Request resolved: https://github.com/pytorch/pytorch/pull/142019 Approved by: https://github.com/huydhn, https://github.com/malfet
This commit is contained in:
parent
0582b32f6c
commit
920e4364b7
|
|
@ -16,9 +16,7 @@ if [[ "${DESIRED_CUDA}" =~ cu1[1-2][0-9] ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Parse the parameters
|
# Parse the parameters
|
||||||
if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
|
if [[ "$DESIRED_CUDA" == cpu ]]; then
|
||||||
build_script='conda/build_pytorch.sh'
|
|
||||||
elif [[ "$DESIRED_CUDA" == cpu ]]; then
|
|
||||||
build_script='manywheel/build_cpu.sh'
|
build_script='manywheel/build_cpu.sh'
|
||||||
elif [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
|
elif [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
|
||||||
build_script='manywheel/build_rocm.sh'
|
build_script='manywheel/build_rocm.sh'
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@ fi
|
||||||
python_nodot="\$(echo $DESIRED_PYTHON | tr -d m.u)"
|
python_nodot="\$(echo $DESIRED_PYTHON | tr -d m.u)"
|
||||||
|
|
||||||
# Set up Python
|
# Set up Python
|
||||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
if [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||||
retry conda create -qyn testenv python="$DESIRED_PYTHON"
|
|
||||||
source activate testenv >/dev/null
|
|
||||||
elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
|
||||||
python_path="/opt/python/cp\$python_nodot-cp\${python_nodot}"
|
python_path="/opt/python/cp\$python_nodot-cp\${python_nodot}"
|
||||||
if [[ "\$python_nodot" = *t ]]; then
|
if [[ "\$python_nodot" = *t ]]; then
|
||||||
python_digits="\$(echo $DESIRED_PYTHON | tr -cd [:digit:])"
|
python_digits="\$(echo $DESIRED_PYTHON | tr -cd [:digit:])"
|
||||||
|
|
@ -69,30 +66,7 @@ else
|
||||||
CHANNEL="test"
|
CHANNEL="test"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
if [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||||
(
|
|
||||||
# For some reason conda likes to re-activate the conda environment when attempting this install
|
|
||||||
# which means that a deactivate is run and some variables might not exist when that happens,
|
|
||||||
# namely CONDA_MKL_INTERFACE_LAYER_BACKUP from libblas so let's just ignore unbound variables when
|
|
||||||
# it comes to the conda installation commands
|
|
||||||
set +u
|
|
||||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq \
|
|
||||||
"numpy\${NUMPY_PIN}" \
|
|
||||||
mkl>=2018 \
|
|
||||||
ninja \
|
|
||||||
sympy>=1.12 \
|
|
||||||
typing-extensions \
|
|
||||||
${PROTOBUF_PACKAGE}
|
|
||||||
if [[ "$DESIRED_CUDA" == 'cpu' ]]; then
|
|
||||||
retry conda install -c pytorch -y cpuonly
|
|
||||||
else
|
|
||||||
cu_ver="${DESIRED_CUDA:2:2}.${DESIRED_CUDA:4}"
|
|
||||||
CUDA_PACKAGE="pytorch-cuda"
|
|
||||||
retry conda install \${EXTRA_CONDA_FLAGS} -yq -c nvidia -c "pytorch-\${CHANNEL}" "pytorch-cuda=\${cu_ver}"
|
|
||||||
fi
|
|
||||||
conda install \${EXTRA_CONDA_FLAGS} -y "\$pkg" --offline
|
|
||||||
)
|
|
||||||
elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
|
||||||
if [[ "\$BUILD_ENVIRONMENT" != *s390x* ]]; then
|
if [[ "\$BUILD_ENVIRONMENT" != *s390x* ]]; then
|
||||||
if [[ "$USE_SPLIT_BUILD" == "true" ]]; then
|
if [[ "$USE_SPLIT_BUILD" == "true" ]]; then
|
||||||
pkg_no_python="$(ls -1 /final_pkgs/torch_no_python* | sort |tail -1)"
|
pkg_no_python="$(ls -1 /final_pkgs/torch_no_python* | sort |tail -1)"
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,5 @@ mkdir -p "$PYTORCH_FINAL_PACKAGE_DIR"
|
||||||
# Build
|
# Build
|
||||||
export USE_PYTORCH_METAL_EXPORT=1
|
export USE_PYTORCH_METAL_EXPORT=1
|
||||||
export USE_COREML_DELEGATE=1
|
export USE_COREML_DELEGATE=1
|
||||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
|
||||||
"${BUILDER_ROOT}/conda/build_pytorch.sh"
|
|
||||||
else
|
|
||||||
export TORCH_PACKAGE_NAME="$(echo $TORCH_PACKAGE_NAME | tr '-' '_')"
|
export TORCH_PACKAGE_NAME="$(echo $TORCH_PACKAGE_NAME | tr '-' '_')"
|
||||||
"${BUILDER_ROOT}/wheel/build_wheel.sh"
|
"${BUILDER_ROOT}/wheel/build_wheel.sh"
|
||||||
fi
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ if [[ "$PACKAGE_TYPE" == libtorch ]]; then
|
||||||
pkg="$(ls $workdir/final_pkgs/*-latest.zip)"
|
pkg="$(ls $workdir/final_pkgs/*-latest.zip)"
|
||||||
unzip "$pkg" -d /tmp
|
unzip "$pkg" -d /tmp
|
||||||
cd /tmp/libtorch
|
cd /tmp/libtorch
|
||||||
elif [[ "$PACKAGE_TYPE" == conda ]]; then
|
|
||||||
conda install -y "$pkg"
|
|
||||||
else
|
else
|
||||||
pip install "$pkg" -v
|
pip install "$pkg" -v
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,8 @@ echo "Free space on filesystem before build:"
|
||||||
df -h
|
df -h
|
||||||
|
|
||||||
pushd "$BUILDER_ROOT"
|
pushd "$BUILDER_ROOT"
|
||||||
if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
|
|
||||||
./windows/internal/build_conda.bat
|
|
||||||
elif [[ "$PACKAGE_TYPE" == 'wheel' || "$PACKAGE_TYPE" == 'libtorch' ]]; then
|
|
||||||
export NIGHTLIES_PYTORCH_ROOT="$PYTORCH_ROOT"
|
export NIGHTLIES_PYTORCH_ROOT="$PYTORCH_ROOT"
|
||||||
./windows/internal/build_wheels.bat
|
./windows/internal/build_wheels.bat
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Free space on filesystem after build:"
|
echo "Free space on filesystem after build:"
|
||||||
df -h
|
df -h
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user