mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08: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:
committed by
PyTorch MergeBot
parent
0582b32f6c
commit
920e4364b7
@ -16,9 +16,7 @@ if [[ "${DESIRED_CUDA}" =~ cu1[1-2][0-9] ]]; then
|
||||
fi
|
||||
|
||||
# Parse the parameters
|
||||
if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
|
||||
build_script='conda/build_pytorch.sh'
|
||||
elif [[ "$DESIRED_CUDA" == cpu ]]; then
|
||||
if [[ "$DESIRED_CUDA" == cpu ]]; then
|
||||
build_script='manywheel/build_cpu.sh'
|
||||
elif [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
|
||||
build_script='manywheel/build_rocm.sh'
|
||||
|
@ -22,10 +22,7 @@ fi
|
||||
python_nodot="\$(echo $DESIRED_PYTHON | tr -d m.u)"
|
||||
|
||||
# Set up Python
|
||||
if [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
retry conda create -qyn testenv python="$DESIRED_PYTHON"
|
||||
source activate testenv >/dev/null
|
||||
elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||
if [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||
python_path="/opt/python/cp\$python_nodot-cp\${python_nodot}"
|
||||
if [[ "\$python_nodot" = *t ]]; then
|
||||
python_digits="\$(echo $DESIRED_PYTHON | tr -cd [:digit:])"
|
||||
@ -69,30 +66,7 @@ else
|
||||
CHANNEL="test"
|
||||
fi
|
||||
|
||||
if [[ "$PACKAGE_TYPE" == conda ]]; 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 [[ "$PACKAGE_TYPE" != libtorch ]]; then
|
||||
if [[ "\$BUILD_ENVIRONMENT" != *s390x* ]]; then
|
||||
if [[ "$USE_SPLIT_BUILD" == "true" ]]; then
|
||||
pkg_no_python="$(ls -1 /final_pkgs/torch_no_python* | sort |tail -1)"
|
||||
|
@ -7,9 +7,5 @@ mkdir -p "$PYTORCH_FINAL_PACKAGE_DIR"
|
||||
# Build
|
||||
export USE_PYTORCH_METAL_EXPORT=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 '-' '_')"
|
||||
"${BUILDER_ROOT}/wheel/build_wheel.sh"
|
||||
fi
|
||||
export TORCH_PACKAGE_NAME="$(echo $TORCH_PACKAGE_NAME | tr '-' '_')"
|
||||
"${BUILDER_ROOT}/wheel/build_wheel.sh"
|
||||
|
@ -19,8 +19,6 @@ if [[ "$PACKAGE_TYPE" == libtorch ]]; then
|
||||
pkg="$(ls $workdir/final_pkgs/*-latest.zip)"
|
||||
unzip "$pkg" -d /tmp
|
||||
cd /tmp/libtorch
|
||||
elif [[ "$PACKAGE_TYPE" == conda ]]; then
|
||||
conda install -y "$pkg"
|
||||
else
|
||||
pip install "$pkg" -v
|
||||
fi
|
||||
|
@ -20,12 +20,8 @@ echo "Free space on filesystem before build:"
|
||||
df -h
|
||||
|
||||
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"
|
||||
./windows/internal/build_wheels.bat
|
||||
fi
|
||||
export NIGHTLIES_PYTORCH_ROOT="$PYTORCH_ROOT"
|
||||
./windows/internal/build_wheels.bat
|
||||
|
||||
echo "Free space on filesystem after build:"
|
||||
df -h
|
||||
|
Reference in New Issue
Block a user