Revert "[CI] Use cmake from pip instead of conda in CI docker images (#152537)"

This reverts commit 3196a3aca0f16792820158cfd451cb977f99ac7e.

Reverted https://github.com/pytorch/pytorch/pull/152537 on behalf of https://github.com/huydhn due to We need signals from inductor, cmake version from pip is too old? ([comment](https://github.com/pytorch/pytorch/pull/152537#issuecomment-2852820175))
This commit is contained in:
PyTorch MergeBot
2025-05-06 00:22:22 +00:00
parent 103fe856e1
commit d197228d43
3 changed files with 12 additions and 12 deletions

View File

@ -80,7 +80,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
# following builds that we know should use conda. Specifically, Ubuntu bionic
# and focal cannot find conda mkl with stock cmake, so we need a cmake from conda
if [ -n "${CONDA_CMAKE}" ]; then
pip_install cmake
conda_install cmake
fi
# Magma package names are concatenation of CUDA major and minor ignoring revision

View File

@ -17,7 +17,7 @@ if [ -n "${UBUNTU_VERSION}" ];then
libopenblas-dev libeigen3-dev libatlas-base-dev libzstd-dev
fi
pip_install numpy scipy imageio cmake ninja
conda_install numpy scipy imageio cmake ninja
git clone --depth 1 --branch release/16.x --recursive https://github.com/llvm/llvm-project.git
cmake -DCMAKE_BUILD_TYPE=Release \

View File

@ -10,8 +10,12 @@ fi
source "$(dirname "${BASH_SOURCE[0]}")/common_utils.sh"
get_pip_version() {
conda_run pip list | grep -w $* | head -n 1 | awk '{print $2}'
get_conda_version() {
as_jenkins conda list -n py_$ANACONDA_PYTHON_VERSION | grep -w $* | head -n 1 | awk '{print $2}'
}
conda_reinstall() {
as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y --force-reinstall $*
}
if [ -n "${XPU_VERSION}" ]; then
@ -35,8 +39,8 @@ fi
if [ -n "${CONDA_CMAKE}" ]; then
# Keep the current cmake and numpy version here, so we can reinstall them later
CMAKE_VERSION=$(get_pip_version cmake)
NUMPY_VERSION=$(get_pip_version numpy)
CMAKE_VERSION=$(get_conda_version cmake)
NUMPY_VERSION=$(get_conda_version numpy)
fi
if [ -z "${MAX_JOBS}" ]; then
@ -89,11 +93,7 @@ if [ -n "${CONDA_CMAKE}" ]; then
# causes inconsistent environment. Without this, conda will attempt to install the
# latest numpy version, which fails ASAN tests with the following import error: Numba
# needs NumPy 1.20 or less.
conda_reinstall cmake="${CMAKE_VERSION}"
# Note that we install numpy with pip as conda might not have the version we want
if [ -n "${CMAKE_VERSION}" ]; then
pip_install "cmake==${CMAKE_VERSION}"
fi
if [ -n "${NUMPY_VERSION}" ]; then
pip_install "numpy==${NUMPY_VERSION}"
fi
pip_install --force-reinstall numpy=="${NUMPY_VERSION}"
fi