From ed7683d9732d068776413f58e9c535f153dd9c74 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 13:53:30 +0800 Subject: [PATCH 01/19] Update [ghstack-poisoned] --- .ci/docker/manywheel/Dockerfile_2_28 | 2 +- .ci/docker/requirements-ci.txt | 2 +- .ci/manywheel/build_common.sh | 2 +- .ci/manywheel/build_libtorch.sh | 2 +- .ci/pytorch/run_tests.sh | 4 ++-- .ci/pytorch/windows/internal/install_python.bat | 2 +- .ci/pytorch/windows/setup_build.bat | 2 +- .ci/wheel/build_wheel.sh | 14 +++++++------- .github/requirements/pip-requirements-macOS.txt | 2 +- .github/scripts/lintrunner.sh | 2 +- .github/scripts/windows/build_triton.bat | 2 +- pyproject.toml | 9 ++------- requirements.txt | 2 +- 13 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.ci/docker/manywheel/Dockerfile_2_28 b/.ci/docker/manywheel/Dockerfile_2_28 index b150423e9954..b42407b60c4f 100644 --- a/.ci/docker/manywheel/Dockerfile_2_28 +++ b/.ci/docker/manywheel/Dockerfile_2_28 @@ -128,7 +128,7 @@ ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH # Install setuptools and wheel for python 3.12/3.13 RUN for cpython_version in "cp312-cp312" "cp313-cp313" "cp313-cp313t"; do \ - /opt/python/${cpython_version}/bin/python -m pip install setuptools wheel; \ + /opt/python/${cpython_version}/bin/python -m pip install "setuptools>=77.0.0" wheel; \ done; diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 9c8251989477..74fe13906cbf 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -365,7 +365,7 @@ pwlf==2.2.1 # To build PyTorch itself pyyaml pyzstd -setuptools>=70.1.0 +setuptools>=77.0.0 six scons==4.5.2 ; platform_machine == "aarch64" diff --git a/.ci/manywheel/build_common.sh b/.ci/manywheel/build_common.sh index 6437cf9f0d48..4c1758d31a26 100644 --- a/.ci/manywheel/build_common.sh +++ b/.ci/manywheel/build_common.sh @@ -97,7 +97,7 @@ if [[ -z "$PYTORCH_ROOT" ]]; then exit 1 fi pushd "$PYTORCH_ROOT" -retry pip install -q "setuptools>=70.1.0" packaging +retry pip install -q "setuptools>=77.0.0" packaging retry pip install -qU cmake ninja python setup.py clean retry pip install -qr requirements.txt diff --git a/.ci/manywheel/build_libtorch.sh b/.ci/manywheel/build_libtorch.sh index 30a723cb1095..18633240bf71 100644 --- a/.ci/manywheel/build_libtorch.sh +++ b/.ci/manywheel/build_libtorch.sh @@ -92,7 +92,7 @@ if [[ -z "$PYTORCH_ROOT" ]]; then exit 1 fi pushd "$PYTORCH_ROOT" -retry pip install -q "setuptools>=70.1.0" packaging +retry pip install -q "setuptools>=77.0.0" packaging retry pip install -qU cmake ninja python setup.py clean retry pip install -qr requirements.txt diff --git a/.ci/pytorch/run_tests.sh b/.ci/pytorch/run_tests.sh index 34ee40d7bcd0..6279a1136727 100755 --- a/.ci/pytorch/run_tests.sh +++ b/.ci/pytorch/run_tests.sh @@ -76,10 +76,10 @@ fi # Environment initialization if [[ "$(uname)" == Darwin ]]; then # Install the testing dependencies - retry pip install -q future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest setuptools six typing_extensions pyyaml + retry pip install -q future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest "setuptools>=77.0.0" six typing_extensions pyyaml else retry pip install -qr requirements.txt || true - retry pip install -q hypothesis protobuf pytest setuptools || true + retry pip install -q hypothesis protobuf pytest "setuptools>=77.0.0" || true numpy_ver=1.15 case "$(python --version 2>&1)" in *2* | *3.5* | *3.6*) diff --git a/.ci/pytorch/windows/internal/install_python.bat b/.ci/pytorch/windows/internal/install_python.bat index 73622bd736ed..535cd4af0064 100644 --- a/.ci/pytorch/windows/internal/install_python.bat +++ b/.ci/pytorch/windows/internal/install_python.bat @@ -18,5 +18,5 @@ start /wait "" python-amd64.exe /quiet InstallAllUsers=1 PrependPath=0 Include_t if errorlevel 1 exit /b 1 set "PATH=%CD%\Python\Scripts;%CD%\Python;%PATH%" -%PYTHON_EXEC% -m pip install --upgrade pip setuptools packaging wheel +%PYTHON_EXEC% -m pip install --upgrade pip "setuptools>=77.0.0" packaging wheel if errorlevel 1 exit /b 1 diff --git a/.ci/pytorch/windows/setup_build.bat b/.ci/pytorch/windows/setup_build.bat index 9b492eef664d..976ef00c1ddd 100644 --- a/.ci/pytorch/windows/setup_build.bat +++ b/.ci/pytorch/windows/setup_build.bat @@ -16,7 +16,7 @@ if "%DESIRED_PYTHON%" == "3.9" %PYTHON_EXEC% -m pip install numpy==2.0.2 cmake %PYTHON_EXEC% -m pip install pyyaml %PYTHON_EXEC% -m pip install mkl-include mkl-static -%PYTHON_EXEC% -m pip install boto3 ninja typing_extensions setuptools==72.1.0 +%PYTHON_EXEC% -m pip install boto3 ninja typing-extensions "setuptools>=77.0.0" where cmake.exe diff --git a/.ci/wheel/build_wheel.sh b/.ci/wheel/build_wheel.sh index 6070e967ef82..9476d5b3990c 100755 --- a/.ci/wheel/build_wheel.sh +++ b/.ci/wheel/build_wheel.sh @@ -127,7 +127,7 @@ export INSTALL_TEST=0 # dont install test binaries into site-packages export MACOSX_DEPLOYMENT_TARGET=10.15 export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} -SETUPTOOLS_PINNED_VERSION="==70.1.0" +SETUPTOOLS_PINNED_VERSION="==77.0.0" PYYAML_PINNED_VERSION="=5.3" EXTRA_CONDA_INSTALL_FLAGS="" CONDA_ENV_CREATE_FLAGS="" @@ -135,7 +135,7 @@ RENAME_WHEEL=true case $desired_python in 3.13t) echo "Using 3.13 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=6.0.1" NUMPY_PINNED_VERSION="=2.1.0" CONDA_ENV_CREATE_FLAGS="python-freethreading" @@ -145,31 +145,31 @@ case $desired_python in ;; 3.13) echo "Using 3.13 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=6.0.1" NUMPY_PINNED_VERSION="=2.1.0" ;; 3.12) echo "Using 3.12 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=6.0.1" NUMPY_PINNED_VERSION="=2.0.2" ;; 3.11) echo "Using 3.11 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=5.3" NUMPY_PINNED_VERSION="=2.0.2" ;; 3.10) echo "Using 3.10 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=5.3" NUMPY_PINNED_VERSION="=2.0.2" ;; 3.9) echo "Using 3.9 deps" - SETUPTOOLS_PINNED_VERSION=">=70.1.0" + SETUPTOOLS_PINNED_VERSION=">=77.0.0" PYYAML_PINNED_VERSION=">=5.3" NUMPY_PINNED_VERSION="=2.0.2" ;; diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index e8464f0a55ff..90f32507bd86 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -26,7 +26,7 @@ pytest-xdist==3.3.1 pytest==7.3.2 pyyaml==6.0.2 scipy==1.12.0 -setuptools==72.1.0 +setuptools==80.9.0 sympy==1.13.3 tlparse==0.3.30 tensorboard==2.13.0 diff --git a/.github/scripts/lintrunner.sh b/.github/scripts/lintrunner.sh index ef4741444f94..1411ff0397b5 100755 --- a/.github/scripts/lintrunner.sh +++ b/.github/scripts/lintrunner.sh @@ -2,7 +2,7 @@ set -ex # Use uv to speed up lintrunner init -python3 -m pip install uv==0.1.45 setuptools +python3 -m pip install -U uv setuptools CACHE_DIRECTORY="/tmp/.lintbin" # Try to recover the cached binaries diff --git a/.github/scripts/windows/build_triton.bat b/.github/scripts/windows/build_triton.bat index 97cd535a4988..90b445021cdd 100644 --- a/.github/scripts/windows/build_triton.bat +++ b/.github/scripts/windows/build_triton.bat @@ -10,7 +10,7 @@ if "%PY_VERS%" == "3.13t" ( call conda create -n %PYTHON_PREFIX% -y -c=conda-forge python=%PY_VERS% ) :: Fix cmake version for issue https://github.com/pytorch/pytorch/issues/150480 -call conda run -n %PYTHON_PREFIX% pip install wheel pybind11 certifi cython cmake==3.31.6 setuptools==72.1.0 ninja +call conda run -n %PYTHON_PREFIX% pip install wheel pybind11 certifi cython cmake==3.31.6 setuptools==78.1.0 ninja dir "%VC_INSTALL_PATH%" diff --git a/pyproject.toml b/pyproject.toml index 4420f46fcdfa..3efce2563aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,8 @@ [build-system] requires = [ - # 70.1.0: min version for integrated bdist_wheel command from wheel package # 77.0.0: min version for SPDX expression support for project.license - "setuptools>=70.1.0", + "setuptools>=77.0.0", "cmake>=3.27", "ninja", "numpy", @@ -21,11 +20,7 @@ name = "torch" description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration" readme = "README.md" requires-python = ">=3.9,<3.14" -# TODO: change to `license = "BSD-3-Clause"` and enable PEP 639 after pinning setuptools>=77 -# FIXME: As of 2025.06.20, it is hard to ensure the minimum version of setuptools in our CI environment. -# TOML-table-based license deprecated in setuptools>=77, and the deprecation warning will be changed -# to an error on 2026.02.18. See also: https://github.com/pypa/setuptools/issues/4903 -license = { text = "BSD-3-Clause" } +license = "BSD-3-Clause" authors = [{ name = "PyTorch Team", email = "packages@pytorch.org" }] keywords = ["pytorch", "machine learning"] classifiers = [ diff --git a/requirements.txt b/requirements.txt index f4a42c3d42cd..f53b2b07a311 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Python dependencies required for development # Build System requirements -setuptools>=70.1.0 +setuptools>=77.0.0 cmake>=3.27 ninja numpy From 39028563542c2801fdef2958e2430a7db76d57fc Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 16:44:59 +0800 Subject: [PATCH 02/19] Update [ghstack-poisoned] --- .ci/pytorch/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/pytorch/build.sh b/.ci/pytorch/build.sh index 994bd179e464..82b61b72a3a8 100755 --- a/.ci/pytorch/build.sh +++ b/.ci/pytorch/build.sh @@ -269,6 +269,9 @@ if [[ "$BUILD_ENVIRONMENT" == *-bazel-* ]]; then tools/bazel build --config=no-tty "${BAZEL_MEM_LIMIT}" "${BAZEL_CPU_LIMIT}" //... fi else + # install build-system requirements before running setup.py commands + python -mpip install -r requirements-build.txt + # check that setup.py would fail with bad arguments echo "The next three invocations are expected to fail with invalid command error messages." ( ! get_exit_code python setup.py bad_argument ) From e51f1b83ffc582f9a1a2bebcb51e66ec67cf7e8c Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 16:58:51 +0800 Subject: [PATCH 03/19] Update [ghstack-poisoned] --- .ci/docker/manywheel/Dockerfile_2_28 | 2 +- .ci/docker/requirements-ci.txt | 1 + .ci/pytorch/windows/setup_build.bat | 3 ++- pyproject.toml | 2 +- requirements-build.txt | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.ci/docker/manywheel/Dockerfile_2_28 b/.ci/docker/manywheel/Dockerfile_2_28 index b42407b60c4f..7f279a1c1a73 100644 --- a/.ci/docker/manywheel/Dockerfile_2_28 +++ b/.ci/docker/manywheel/Dockerfile_2_28 @@ -128,7 +128,7 @@ ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH # Install setuptools and wheel for python 3.12/3.13 RUN for cpython_version in "cp312-cp312" "cp313-cp313" "cp313-cp313t"; do \ - /opt/python/${cpython_version}/bin/python -m pip install "setuptools>=77.0.0" wheel; \ + /opt/python/${cpython_version}/bin/python -m pip install "setuptools>=77.0.0" "packaging>=24.2" wheel; \ done; diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 74fe13906cbf..76b048c60aae 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -363,6 +363,7 @@ pwlf==2.2.1 # To build PyTorch itself +packaging>=24.2 pyyaml pyzstd setuptools>=77.0.0 diff --git a/.ci/pytorch/windows/setup_build.bat b/.ci/pytorch/windows/setup_build.bat index 976ef00c1ddd..3a206b3fcef6 100644 --- a/.ci/pytorch/windows/setup_build.bat +++ b/.ci/pytorch/windows/setup_build.bat @@ -14,9 +14,10 @@ if "%DESIRED_PYTHON%" == "3.11" %PYTHON_EXEC% -m pip install numpy==2.0.2 cmake if "%DESIRED_PYTHON%" == "3.10" %PYTHON_EXEC% -m pip install numpy==2.0.2 cmake if "%DESIRED_PYTHON%" == "3.9" %PYTHON_EXEC% -m pip install numpy==2.0.2 cmake +%PYTHON_EXEC% -m pip install "setuptools>=77.0.0" "packaging>=24.2" %PYTHON_EXEC% -m pip install pyyaml %PYTHON_EXEC% -m pip install mkl-include mkl-static -%PYTHON_EXEC% -m pip install boto3 ninja typing-extensions "setuptools>=77.0.0" +%PYTHON_EXEC% -m pip install boto3 ninja typing-extensions where cmake.exe diff --git a/pyproject.toml b/pyproject.toml index 3efce2563aa5..c7d8b411169b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ "cmake>=3.27", "ninja", "numpy", - "packaging", + "packaging>=24.2", "pyyaml", "requests", "six", # dependency chain: NNPACK -> PeachPy -> six diff --git a/requirements-build.txt b/requirements-build.txt index 5310b49555a0..b6fefe2a1293 100644 --- a/requirements-build.txt +++ b/requirements-build.txt @@ -3,7 +3,7 @@ setuptools>=77.0.0 cmake>=3.27 ninja numpy -packaging +packaging>=24.2 pyyaml requests six # dependency chain: NNPACK -> PeachPy -> six From e097bfa49eac16b32cfabbb77be65032aee89398 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 17:04:24 +0800 Subject: [PATCH 04/19] Update [ghstack-poisoned] --- .github/requirements/pip-requirements-macOS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index 90f32507bd86..11aff0e441e9 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -12,7 +12,7 @@ numba==0.59.0 numpy==1.26.4 opt-einsum>=3.3 optree==0.13.0 -packaging==23.1 +packaging==25.0 parameterized==0.8.1 pillow==10.3.0 protobuf==5.29.4 From e060ff548b5c9bd1742b855759efed45aedfffa3 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 18:16:50 +0800 Subject: [PATCH 05/19] Update [ghstack-poisoned] --- .ci/docker/manywheel/Dockerfile_s390x | 6 +++--- .ci/pytorch/windows/internal/install_python.bat | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/docker/manywheel/Dockerfile_s390x b/.ci/docker/manywheel/Dockerfile_s390x index 46ec7f77ae8b..08335b5e43e8 100644 --- a/.ci/docker/manywheel/Dockerfile_s390x +++ b/.ci/docker/manywheel/Dockerfile_s390x @@ -124,10 +124,10 @@ RUN python3 -mpip install cmake==3.28.0 # install newest flatbuffers version first: # for some reason old version is getting pulled in otherwise. # packaging package is required for onnxruntime wheel build. -RUN pip3 install flatbuffers && \ - pip3 install cython 'pkgconfig>=1.5.5' 'setuptools>=77' 'numpy<2.3.0' && \ +RUN pip3 install 'setuptools>=77' 'packaging>=24.2' && \ + pip3 install flatbuffers && \ + pip3 install cython 'pkgconfig>=1.5.5' 'numpy<2.3.0' && \ pip3 install --no-build-isolation h5py==3.11.0 && \ - pip3 install packaging && \ git clone https://github.com/microsoft/onnxruntime && \ cd onnxruntime && git checkout v1.21.0 && \ git submodule update --init --recursive && \ diff --git a/.ci/pytorch/windows/internal/install_python.bat b/.ci/pytorch/windows/internal/install_python.bat index 535cd4af0064..65405a875b6b 100644 --- a/.ci/pytorch/windows/internal/install_python.bat +++ b/.ci/pytorch/windows/internal/install_python.bat @@ -18,5 +18,5 @@ start /wait "" python-amd64.exe /quiet InstallAllUsers=1 PrependPath=0 Include_t if errorlevel 1 exit /b 1 set "PATH=%CD%\Python\Scripts;%CD%\Python;%PATH%" -%PYTHON_EXEC% -m pip install --upgrade pip "setuptools>=77.0.0" packaging wheel +%PYTHON_EXEC% -m pip install --upgrade pip "setuptools>=77.0.0" "packaging>=24.2" wheel if errorlevel 1 exit /b 1 From 62b09c2e37b16a8c811b49fa5dbe90d2d0ef3df8 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 11 Jul 2025 20:09:38 +0800 Subject: [PATCH 06/19] Update [ghstack-poisoned] --- .ci/pytorch/win-test-helpers/build_pytorch.bat | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ci/pytorch/win-test-helpers/build_pytorch.bat b/.ci/pytorch/win-test-helpers/build_pytorch.bat index 7ceb425ce2d1..74c9183f2abb 100644 --- a/.ci/pytorch/win-test-helpers/build_pytorch.bat +++ b/.ci/pytorch/win-test-helpers/build_pytorch.bat @@ -126,6 +126,11 @@ if "%USE_CUDA%"=="1" ( set CMAKE_CUDA_COMPILER_LAUNCHER=%TMP_DIR%/bin/randomtemp.exe;%TMP_DIR%\bin\sccache.exe ) +:: Install build-system requirements before running setup.py commands +python -m pip install -r requirements-build.txt +if errorlevel 1 goto fail +if not errorlevel 0 goto fail + :: Print all existing environment variable for debugging set From 13979ae828ba0cd6e087732335a571dab09d2ab5 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sat, 12 Jul 2025 20:10:06 +0800 Subject: [PATCH 07/19] Update [ghstack-poisoned] --- .ci/docker/requirements-ci.txt | 2 +- .ci/pytorch/win-test.sh | 2 +- .github/requirements/pip-requirements-macOS.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 76b048c60aae..51970a1be91d 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -307,7 +307,7 @@ pytest-cpp==2.3.0 #Pinned versions: 2.3.0 #test that import: -z3-solver==4.12.6.0 +z3-solver==4.15.2 #Description: The Z3 Theorem Prover Project #Pinned versions: #test that import: diff --git a/.ci/pytorch/win-test.sh b/.ci/pytorch/win-test.sh index b61dd06ef562..7a74e85a7a60 100755 --- a/.ci/pytorch/win-test.sh +++ b/.ci/pytorch/win-test.sh @@ -41,7 +41,7 @@ fi python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 tensorboard==2.13.0 protobuf==5.29.4 pytest-subtests==0.13.1 # Install Z3 optional dependency for Windows builds. -python -m pip install z3-solver==4.12.2.0 +python -m pip install z3-solver==4.15.2 # Install tlparse for test\dynamo\test_structured_trace.py UTs. python -m pip install tlparse==0.3.30 diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index 11aff0e441e9..0c2a4819fc50 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -33,4 +33,4 @@ tensorboard==2.13.0 typing-extensions==4.12.2 unittest-xml-reporting<=3.2.0,>=2.0.0 xdoctest==1.1.0 -z3-solver==4.12.2.0 +z3-solver==4.15.2 From 50634100fbca15f964bd2df2215a3d565299bc82 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sat, 12 Jul 2025 20:12:12 +0800 Subject: [PATCH 08/19] Update [ghstack-poisoned] --- .ci/docker/requirements-ci.txt | 2 +- .ci/pytorch/win-test.sh | 40 +++++++++---------- .../requirements/pip-requirements-macOS.txt | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 51970a1be91d..3dedcebbc101 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -307,7 +307,7 @@ pytest-cpp==2.3.0 #Pinned versions: 2.3.0 #test that import: -z3-solver==4.15.2 +z3-solver==4.15.1.0 #Description: The Z3 Theorem Prover Project #Pinned versions: #test that import: diff --git a/.ci/pytorch/win-test.sh b/.ci/pytorch/win-test.sh index 7a74e85a7a60..7a0763c0eca2 100755 --- a/.ci/pytorch/win-test.sh +++ b/.ci/pytorch/win-test.sh @@ -3,7 +3,7 @@ set -ex -o pipefail SCRIPT_PARENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) # shellcheck source=./common.sh -source "$SCRIPT_PARENT_DIR/common.sh" +source "${SCRIPT_PARENT_DIR}/common.sh" export TMP_DIR="${PWD}/build/win_tmp" TMP_DIR_WIN=$(cygpath -w "${TMP_DIR}") @@ -21,16 +21,16 @@ export PYTORCH_FINAL_PACKAGE_DIR_WIN # enable debug asserts in serialization export TORCH_SERIALIZATION_DEBUG=1 -mkdir -p "$TMP_DIR"/build/torch +mkdir -p "${TMP_DIR}"/build/torch -export SCRIPT_HELPERS_DIR=$SCRIPT_PARENT_DIR/win-test-helpers +export SCRIPT_HELPERS_DIR=${SCRIPT_PARENT_DIR}/win-test-helpers -if [[ "$TEST_CONFIG" = "force_on_cpu" ]]; then +if [[ "${TEST_CONFIG}" = "force_on_cpu" ]]; then # run the full test suite for force_on_cpu test export USE_CUDA=0 fi -if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then +if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then # Used so that only cuda/rocm specific versions of tests are generated # mainly used so that we're not spending extra cycles testing cpu # devices on expensive gpu machines @@ -41,7 +41,7 @@ fi python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 tensorboard==2.13.0 protobuf==5.29.4 pytest-subtests==0.13.1 # Install Z3 optional dependency for Windows builds. -python -m pip install z3-solver==4.15.2 +python -m pip install z3-solver==4.15.1.0 # Install tlparse for test\dynamo\test_structured_trace.py UTs. python -m pip install tlparse==0.3.30 @@ -58,27 +58,27 @@ python -m pip install expecttest==0.3.0 run_tests() { # Run nvidia-smi if available for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do - if [[ -x "$path" ]]; then - "$path" || echo "true"; + if [[ -x "${path}" ]]; then + "${path}" || echo "true"; break fi done - if [[ $NUM_TEST_SHARDS -eq 1 ]]; then - "$SCRIPT_HELPERS_DIR"/test_python_shard.bat - "$SCRIPT_HELPERS_DIR"/test_custom_script_ops.bat - "$SCRIPT_HELPERS_DIR"/test_custom_backend.bat - "$SCRIPT_HELPERS_DIR"/test_libtorch.bat + if [[ ${NUM_TEST_SHARDS} -eq 1 ]]; then + "${SCRIPT_HELPERS_DIR}"/test_python_shard.bat + "${SCRIPT_HELPERS_DIR}"/test_custom_script_ops.bat + "${SCRIPT_HELPERS_DIR}"/test_custom_backend.bat + "${SCRIPT_HELPERS_DIR}"/test_libtorch.bat else - "$SCRIPT_HELPERS_DIR"/test_python_shard.bat - if [[ "${SHARD_NUMBER}" == 1 && $NUM_TEST_SHARDS -gt 1 ]]; then - "$SCRIPT_HELPERS_DIR"/test_libtorch.bat + "${SCRIPT_HELPERS_DIR}"/test_python_shard.bat + if [[ "${SHARD_NUMBER}" == 1 && ${NUM_TEST_SHARDS} -gt 1 ]]; then + "${SCRIPT_HELPERS_DIR}"/test_libtorch.bat if [[ "${USE_CUDA}" == "1" ]]; then - "$SCRIPT_HELPERS_DIR"/test_python_jit_legacy.bat + "${SCRIPT_HELPERS_DIR}"/test_python_jit_legacy.bat fi - elif [[ "${SHARD_NUMBER}" == 2 && $NUM_TEST_SHARDS -gt 1 ]]; then - "$SCRIPT_HELPERS_DIR"/test_custom_backend.bat - "$SCRIPT_HELPERS_DIR"/test_custom_script_ops.bat + elif [[ "${SHARD_NUMBER}" == 2 && ${NUM_TEST_SHARDS} -gt 1 ]]; then + "${SCRIPT_HELPERS_DIR}"/test_custom_backend.bat + "${SCRIPT_HELPERS_DIR}"/test_custom_script_ops.bat fi fi } diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index 0c2a4819fc50..7eaa962995b7 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -33,4 +33,4 @@ tensorboard==2.13.0 typing-extensions==4.12.2 unittest-xml-reporting<=3.2.0,>=2.0.0 xdoctest==1.1.0 -z3-solver==4.15.2 +z3-solver==4.15.1.0 From c61bc5474ecafdcf7585f10ed20cc1b3090dc908 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sat, 12 Jul 2025 20:20:07 +0800 Subject: [PATCH 09/19] Update [ghstack-poisoned] --- .ci/pytorch/win-test.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.ci/pytorch/win-test.sh b/.ci/pytorch/win-test.sh index 7a0763c0eca2..be7f3e4bb35c 100755 --- a/.ci/pytorch/win-test.sh +++ b/.ci/pytorch/win-test.sh @@ -3,7 +3,7 @@ set -ex -o pipefail SCRIPT_PARENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) # shellcheck source=./common.sh -source "${SCRIPT_PARENT_DIR}/common.sh" +source "$SCRIPT_PARENT_DIR/common.sh" export TMP_DIR="${PWD}/build/win_tmp" TMP_DIR_WIN=$(cygpath -w "${TMP_DIR}") @@ -21,16 +21,16 @@ export PYTORCH_FINAL_PACKAGE_DIR_WIN # enable debug asserts in serialization export TORCH_SERIALIZATION_DEBUG=1 -mkdir -p "${TMP_DIR}"/build/torch +mkdir -p "$TMP_DIR"/build/torch -export SCRIPT_HELPERS_DIR=${SCRIPT_PARENT_DIR}/win-test-helpers +export SCRIPT_HELPERS_DIR=$SCRIPT_PARENT_DIR/win-test-helpers -if [[ "${TEST_CONFIG}" = "force_on_cpu" ]]; then +if [[ "$TEST_CONFIG" = "force_on_cpu" ]]; then # run the full test suite for force_on_cpu test export USE_CUDA=0 fi -if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then +if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then # Used so that only cuda/rocm specific versions of tests are generated # mainly used so that we're not spending extra cycles testing cpu # devices on expensive gpu machines @@ -58,27 +58,27 @@ python -m pip install expecttest==0.3.0 run_tests() { # Run nvidia-smi if available for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do - if [[ -x "${path}" ]]; then - "${path}" || echo "true"; + if [[ -x "$path" ]]; then + "$path" || echo "true"; break fi done - if [[ ${NUM_TEST_SHARDS} -eq 1 ]]; then - "${SCRIPT_HELPERS_DIR}"/test_python_shard.bat - "${SCRIPT_HELPERS_DIR}"/test_custom_script_ops.bat - "${SCRIPT_HELPERS_DIR}"/test_custom_backend.bat - "${SCRIPT_HELPERS_DIR}"/test_libtorch.bat + if [[ $NUM_TEST_SHARDS -eq 1 ]]; then + "$SCRIPT_HELPERS_DIR"/test_python_shard.bat + "$SCRIPT_HELPERS_DIR"/test_custom_script_ops.bat + "$SCRIPT_HELPERS_DIR"/test_custom_backend.bat + "$SCRIPT_HELPERS_DIR"/test_libtorch.bat else - "${SCRIPT_HELPERS_DIR}"/test_python_shard.bat - if [[ "${SHARD_NUMBER}" == 1 && ${NUM_TEST_SHARDS} -gt 1 ]]; then - "${SCRIPT_HELPERS_DIR}"/test_libtorch.bat + "$SCRIPT_HELPERS_DIR"/test_python_shard.bat + if [[ "${SHARD_NUMBER}" == 1 && $NUM_TEST_SHARDS -gt 1 ]]; then + "$SCRIPT_HELPERS_DIR"/test_libtorch.bat if [[ "${USE_CUDA}" == "1" ]]; then - "${SCRIPT_HELPERS_DIR}"/test_python_jit_legacy.bat + "$SCRIPT_HELPERS_DIR"/test_python_jit_legacy.bat fi - elif [[ "${SHARD_NUMBER}" == 2 && ${NUM_TEST_SHARDS} -gt 1 ]]; then - "${SCRIPT_HELPERS_DIR}"/test_custom_backend.bat - "${SCRIPT_HELPERS_DIR}"/test_custom_script_ops.bat + elif [[ "${SHARD_NUMBER}" == 2 && $NUM_TEST_SHARDS -gt 1 ]]; then + "$SCRIPT_HELPERS_DIR"/test_custom_backend.bat + "$SCRIPT_HELPERS_DIR"/test_custom_script_ops.bat fi fi } From f78e7cd140dcd43addf148364172fef2058372c8 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sun, 13 Jul 2025 15:08:01 +0800 Subject: [PATCH 10/19] Update [ghstack-poisoned] --- test/dynamo/test_exc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/dynamo/test_exc.py b/test/dynamo/test_exc.py index 8951cdd76b01..acc3fd55f6fb 100644 --- a/test/dynamo/test_exc.py +++ b/test/dynamo/test_exc.py @@ -315,16 +315,16 @@ def fn(x, shape): %split : [num_users=3] = call_method[target=split](args = (%l_x_, (%l_shape_0_, %l_shape_1_, %l_shape_2_)), kwargs = {}) Model: - ==> L['shape'][0]: 0 - ==> L['shape'][1]: 0 + ==> L['shape'][0]: 1 + ==> L['shape'][1]: 1 ==> L['shape'][2]: 0 ==> L['x'].size()[0]: 3 ==> L['x'].storage_offset(): 0 ==> L['x'].stride()[0]: 1 ==> s3: 0 - ==> s52: 0 + ==> s52: 1 ==> s77: 3 - ==> s86: 0 + ==> s86: 1 Assertions: ==> (== 0 L['x'].storage_offset()) From 50a9de58276711d0e28e3369139adc56bd6f7a08 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sun, 13 Jul 2025 18:02:16 +0800 Subject: [PATCH 11/19] Update [ghstack-poisoned] --- test/dynamo/test_exc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/dynamo/test_exc.py b/test/dynamo/test_exc.py index acc3fd55f6fb..8951cdd76b01 100644 --- a/test/dynamo/test_exc.py +++ b/test/dynamo/test_exc.py @@ -315,16 +315,16 @@ def fn(x, shape): %split : [num_users=3] = call_method[target=split](args = (%l_x_, (%l_shape_0_, %l_shape_1_, %l_shape_2_)), kwargs = {}) Model: - ==> L['shape'][0]: 1 - ==> L['shape'][1]: 1 + ==> L['shape'][0]: 0 + ==> L['shape'][1]: 0 ==> L['shape'][2]: 0 ==> L['x'].size()[0]: 3 ==> L['x'].storage_offset(): 0 ==> L['x'].stride()[0]: 1 ==> s3: 0 - ==> s52: 1 + ==> s52: 0 ==> s77: 3 - ==> s86: 1 + ==> s86: 0 Assertions: ==> (== 0 L['x'].storage_offset()) From 8164bf51208f482c8c48fe348671445e2e29197c Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sun, 13 Jul 2025 18:59:56 +0800 Subject: [PATCH 12/19] Update [ghstack-poisoned] --- test/dynamo/test_exc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/dynamo/test_exc.py b/test/dynamo/test_exc.py index 8951cdd76b01..c340a2882d47 100644 --- a/test/dynamo/test_exc.py +++ b/test/dynamo/test_exc.py @@ -251,13 +251,13 @@ def fn(x, shape): Model: ==> L['shape'][0]: 0 - ==> L['shape'][1]: 1 - ==> L['shape'][2]: 1 + ==> L['shape'][1]: 0 + ==> L['shape'][2]: 0 ==> L['x'].size()[0]: 3 ==> L['x'].storage_offset(): 0 ==> L['x'].stride()[0]: 1 - ==> s3: 1 - ==> s52: 1 + ==> s3: 0 + ==> s52: 0 ==> s77: 3 ==> s86: 0 From b59c209378bff4005b56bf64bcfc05199dc53efa Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Thu, 17 Jul 2025 17:40:05 +0800 Subject: [PATCH 13/19] Update [ghstack-poisoned] --- test/quantization/core/test_quantized_functional.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/quantization/core/test_quantized_functional.py b/test/quantization/core/test_quantized_functional.py index a890c6358e08..b24bf1f1cf58 100644 --- a/test/quantization/core/test_quantized_functional.py +++ b/test/quantization/core/test_quantized_functional.py @@ -9,7 +9,7 @@ import numpy as np # Testing utils -from hypothesis import assume, given +from hypothesis import assume, given, HealthCheck, settings from hypothesis import strategies as st from torch.testing._internal.common_quantization import ( QuantizationTestCase, @@ -111,6 +111,7 @@ def test_conv1d_api( W_scale, W_zero_point, Y_scale, Y_zero_point, use_bias, use_channelwise) + @settings(suppress_health_check=[HealthCheck.differing_executors]) @given(batch_size=st.integers(1, 3), in_channels_per_group=st.sampled_from([2, 4, 5, 8, 16, 32]), H=st.integers(4, 16), From fa90ace2fc4b82515602e6cbcffd5d63b4c75b85 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 18 Jul 2025 01:35:52 +0800 Subject: [PATCH 14/19] Update [ghstack-poisoned] --- .ci/docker/requirements-ci.txt | 4 ++-- .github/requirements/pip-requirements-macOS.txt | 2 +- test/quantization/core/test_quantized_functional.py | 3 +-- test/quantization/core/test_quantized_op.py | 7 +++---- test/quantization/core/test_workflow_ops.py | 3 +-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index 926fc0a07c0d..bf808e0d2365 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -47,10 +47,10 @@ flatbuffers==24.12.23 #Pinned versions: 24.12.23 #test that import: -hypothesis==6.135.32 +hypothesis==5.49.0 # Pin hypothesis to avoid flakiness: https://github.com/pytorch/pytorch/issues/31136 #Description: advanced library for generating parametrized tests -#Pinned versions: 6.135.32 +#Pinned versions: 5.49.0 #test that import: test_xnnpack_integration.py, test_pruning_op.py, test_nn.py junitparser==2.1.1 diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index 0915f265ae3c..7eaa962995b7 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -3,7 +3,7 @@ cmake==3.27.* expecttest==0.3.0 fbscribelogger==0.1.7 filelock==3.6.0 -hypothesis==6.135.32 +hypothesis==6.56.4 librosa>=0.6.2 mpmath==1.3.0 networkx==2.8.7 diff --git a/test/quantization/core/test_quantized_functional.py b/test/quantization/core/test_quantized_functional.py index b24bf1f1cf58..a890c6358e08 100644 --- a/test/quantization/core/test_quantized_functional.py +++ b/test/quantization/core/test_quantized_functional.py @@ -9,7 +9,7 @@ import numpy as np # Testing utils -from hypothesis import assume, given, HealthCheck, settings +from hypothesis import assume, given from hypothesis import strategies as st from torch.testing._internal.common_quantization import ( QuantizationTestCase, @@ -111,7 +111,6 @@ def test_conv1d_api( W_scale, W_zero_point, Y_scale, Y_zero_point, use_bias, use_channelwise) - @settings(suppress_health_check=[HealthCheck.differing_executors]) @given(batch_size=st.integers(1, 3), in_channels_per_group=st.sampled_from([2, 4, 5, 8, 16, 32]), H=st.integers(4, 16), diff --git a/test/quantization/core/test_quantized_op.py b/test/quantization/core/test_quantized_op.py index 99b8e8e14972..d90d77b54786 100644 --- a/test/quantization/core/test_quantized_op.py +++ b/test/quantization/core/test_quantized_op.py @@ -5044,6 +5044,7 @@ def get_reference_result( include_last_offset=include_last_offset) torch.testing.assert_close(reference_result, result, atol=atol, rtol=rtol) + """ Tests the correctness of the embedding_bag_8bit quantized operator """ @given(num_embeddings=st.integers(10, 100), embedding_dim=st.integers(5, 50).filter(lambda x: x % 4 == 0), num_offsets=st.integers(1, 20), @@ -5061,7 +5062,6 @@ def test_embedding_bag_byte(self, num_embeddings, include_last_offset, fallback_to_no_sparse, sparsity): - """Tests the correctness of the embedding_bag_8bit quantized operator""" self.embedding_bag_rowwise_offsets_run( 8, num_embeddings, embedding_dim, num_offsets, use_32bit_indices, use_32bit_offsets, @@ -5069,6 +5069,7 @@ def test_embedding_bag_byte(self, num_embeddings, fallback_to_no_sparse, sparsity=sparsity, atol=0.005, rtol=1e-3) + """ Tests the correctness of the embedding_bag_4bit quantized operator """ @given(num_embeddings=st.integers(10, 100), embedding_dim=st.integers(5, 50).filter(lambda x: x % 4 == 0), num_offsets=st.integers(1, 20), @@ -5086,7 +5087,6 @@ def test_embedding_bag_4bit(self, num_embeddings, include_last_offset, fallback_to_no_sparse, sparsity): - """Tests the correctness of the embedding_bag_4bit quantized operator""" self.embedding_bag_rowwise_offsets_run(4, num_embeddings, embedding_dim, num_offsets, use_32bit_indices, use_32bit_offsets, @@ -5096,7 +5096,7 @@ def test_embedding_bag_4bit(self, num_embeddings, sparsity=sparsity, atol=0.1, rtol=1e-2) - @settings(suppress_health_check=[HealthCheck.differing_executors]) + """ Tests the correctness of the embedding_bag_2bit quantized operator """ @given(num_embeddings=st.integers(10, 100), embedding_dim=st.integers(5, 50).filter(lambda x: x % 8 == 0), num_offsets=st.integers(1, 20), @@ -5114,7 +5114,6 @@ def test_embedding_bag_2bit(self, num_embeddings, include_last_offset, fallback_to_no_sparse, sparsity): - """Tests the correctness of the embedding_bag_2bit quantized operator""" self.embedding_bag_rowwise_offsets_run(2, num_embeddings, embedding_dim, num_offsets, use_32bit_indices, use_32bit_offsets, diff --git a/test/quantization/core/test_workflow_ops.py b/test/quantization/core/test_workflow_ops.py index 568ad8f8bbe5..4cf34ac8c6c8 100644 --- a/test/quantization/core/test_workflow_ops.py +++ b/test/quantization/core/test_workflow_ops.py @@ -25,7 +25,7 @@ import numpy as np # Testing utils -from hypothesis import given, HealthCheck, settings +from hypothesis import given, settings from hypothesis import strategies as st import torch.testing._internal.hypothesis_utils as hu hu.assert_deadline_disabled() @@ -803,7 +803,6 @@ def _test_learnable_forward_per_channel(self, X_base, device, scale_base, zero_p torch.allclose(Y, Y_prime, rtol=tolerance, atol=tolerance), "Expected kernel forward function to have results match the reference forward function") - @settings(suppress_health_check=[HealthCheck.differing_executors]) @given(X=hu.per_channel_tensor(shapes=hu.array_shapes(1, 5,), qparams=hu.qparams(dtypes=torch.quint8))) def test_learnable_forward_per_channel_cpu(self, X): From c6ab1c714b66567a40afb18eb96e9f4d08294912 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Mon, 21 Jul 2025 14:26:45 +0800 Subject: [PATCH 15/19] Update [ghstack-poisoned] --- .ci/aarch64_linux/aarch64_ci_setup.sh | 2 +- .ci/docker/requirements-ci.txt | 4 ++-- .ci/pytorch/test.sh | 2 +- .github/requirements-gha-cache.txt | 2 +- .github/requirements/pip-requirements-macOS.txt | 2 +- .github/workflows/_mac-test.yml | 5 +++++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.ci/aarch64_linux/aarch64_ci_setup.sh b/.ci/aarch64_linux/aarch64_ci_setup.sh index 8ffba65d7fed..b18d27f2793f 100755 --- a/.ci/aarch64_linux/aarch64_ci_setup.sh +++ b/.ci/aarch64_linux/aarch64_ci_setup.sh @@ -12,7 +12,7 @@ fi SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" source $SCRIPTPATH/../manywheel/set_desired_python.sh -pip install -q numpy==${NUMPY_VERSION} pyyaml==6.0.2 scons==4.7.0 ninja==1.11.1 patchelf==0.17.2 +pip install -q numpy==${NUMPY_VERSION} pyyaml==6.0.2 scons==4.7.0 ninja==1.11.1.4 patchelf==0.17.2 for tool in python python3 pip pip3 ninja scons patchelf; do ln -sf ${DESIRED_PYTHON_BIN_DIR}/${tool} /usr/local/bin; diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index facc633f6a7a..a7486c40b121 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -104,10 +104,10 @@ networkx==2.8.8 #Pinned versions: 2.8.8 #test that import: functorch -ninja==1.11.1.3 +ninja==1.11.1.4 #Description: build system. Used in some tests. Used in build to generate build #time tracing information -#Pinned versions: 1.11.1.3 +#Pinned versions: 1.11.1.4 #test that import: run_test.py, test_cpp_extensions_aot.py,test_determination.py numba==0.49.0 ; python_version < "3.9" diff --git a/.ci/pytorch/test.sh b/.ci/pytorch/test.sh index ad6a48b2528e..2e7cc84138ce 100755 --- a/.ci/pytorch/test.sh +++ b/.ci/pytorch/test.sh @@ -201,7 +201,7 @@ fi if [[ "$BUILD_ENVIRONMENT" != *-bazel-* ]] ; then # JIT C++ extensions require ninja. - pip_install "ninja==1.10.2" + pip_install "ninja==1.11.1.4" # ninja is installed in $HOME/.local/bin, e.g., /var/lib/jenkins/.local/bin for CI user jenkins # but this script should be runnable by any user, including root export PATH="$HOME/.local/bin:$PATH" diff --git a/.github/requirements-gha-cache.txt b/.github/requirements-gha-cache.txt index 5c691e4bf9b3..381bccbee847 100644 --- a/.github/requirements-gha-cache.txt +++ b/.github/requirements-gha-cache.txt @@ -8,7 +8,7 @@ boto3==1.35.42 jinja2==3.1.6 lintrunner==0.10.7 -ninja==1.10.0.post1 +ninja==1.11.1.4 nvidia-ml-py==11.525.84 pyyaml==6.0 requests==2.32.4 diff --git a/.github/requirements/pip-requirements-macOS.txt b/.github/requirements/pip-requirements-macOS.txt index 7929ecfe1e4b..ea005956aefa 100644 --- a/.github/requirements/pip-requirements-macOS.txt +++ b/.github/requirements/pip-requirements-macOS.txt @@ -7,7 +7,7 @@ hypothesis==6.56.4 librosa>=0.6.2 mpmath==1.3.0 networkx==2.8.7 -ninja==1.10.2.4 +ninja==1.11.1.4 numba==0.59.0 numpy==1.26.4 opt-einsum>=3.3 diff --git a/.github/workflows/_mac-test.yml b/.github/workflows/_mac-test.yml index 063c97e449c7..8822aaf7df41 100644 --- a/.github/workflows/_mac-test.yml +++ b/.github/workflows/_mac-test.yml @@ -80,6 +80,11 @@ jobs: run: | sysctl machdep.cpu.brand_string kern.osproductversion + - name: Install build toolchain + run: | + brew update --quiet + brew install --formula cmake ninja + - name: Clean up leftover processes on MacOS pet runner continue-on-error: true run: | From 4fdcfc5cab17edca65f2d4a234c8451b4e3b8006 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 22 Jul 2025 17:44:51 +0800 Subject: [PATCH 16/19] Update [ghstack-poisoned] --- .ci/pytorch/macos-test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/pytorch/macos-test.sh b/.ci/pytorch/macos-test.sh index 83f8e4e04331..49fc87037e0e 100755 --- a/.ci/pytorch/macos-test.sh +++ b/.ci/pytorch/macos-test.sh @@ -21,8 +21,11 @@ setup_test_python() { # This environment variable makes ProcessGroupGloo default to # using the address associated with the loopback interface. export GLOO_SOCKET_IFNAME=lo0 - echo "Ninja version: $(ninja --version)" echo "Python version: $(which python) ($(python --version))" + python -m pip install -qr requirements-build.txt + + echo "CMake version: $(cmake --version)" + echo "Ninja version: $(ninja --version)" # Set the limit on open file handles to 16384 # might help with intermittent compiler test failures From 03917156ef005e55c0c7e63c1438267bf36575fb Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 22 Jul 2025 21:22:52 +0800 Subject: [PATCH 17/19] Update [ghstack-poisoned] --- .ci/pytorch/macos-build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/pytorch/macos-build.sh b/.ci/pytorch/macos-build.sh index d7447e7d4858..57ade48b96ae 100755 --- a/.ci/pytorch/macos-build.sh +++ b/.ci/pytorch/macos-build.sh @@ -33,6 +33,9 @@ if which sccache > /dev/null; then export PATH="${tmp_dir}:$PATH" fi +# Install build-system requirements before running setup.py commands +python -m pip install -r requirements-build.txt + print_cmake_info if [[ ${BUILD_ENVIRONMENT} == *"distributed"* ]]; then # Needed for inductor benchmarks, as lots of HF networks make `torch.distribtued` calls From dde688d16697f135c062e912a98a50dca2556c8b Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 12 Aug 2025 18:40:58 +0800 Subject: [PATCH 18/19] Update [ghstack-poisoned] --- .ci/pytorch/build.sh | 3 ++- .ci/pytorch/macos-build.sh | 1 + .ci/pytorch/win-test-helpers/build_pytorch.bat | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/pytorch/build.sh b/.ci/pytorch/build.sh index 1a1f2df0c2b4..8099eeeb902c 100755 --- a/.ci/pytorch/build.sh +++ b/.ci/pytorch/build.sh @@ -243,7 +243,8 @@ if [[ "$BUILD_ENVIRONMENT" == *-bazel-* ]]; then tools/bazel build --config=no-tty "${BAZEL_MEM_LIMIT}" "${BAZEL_CPU_LIMIT}" //... fi else - # install build-system requirements before running setup.py commands + # Install build-system requirements before running setup.py commands + # We need manage the build environment manually because we are not using build isolation python -m pip install -r requirements-build.txt # check that setup.py would fail with bad arguments diff --git a/.ci/pytorch/macos-build.sh b/.ci/pytorch/macos-build.sh index 57ade48b96ae..f8d8a6f23b80 100755 --- a/.ci/pytorch/macos-build.sh +++ b/.ci/pytorch/macos-build.sh @@ -34,6 +34,7 @@ if which sccache > /dev/null; then fi # Install build-system requirements before running setup.py commands +# We need manage the build environment manually because we are not using build isolation python -m pip install -r requirements-build.txt print_cmake_info diff --git a/.ci/pytorch/win-test-helpers/build_pytorch.bat b/.ci/pytorch/win-test-helpers/build_pytorch.bat index 74c9183f2abb..2e0c798d042a 100644 --- a/.ci/pytorch/win-test-helpers/build_pytorch.bat +++ b/.ci/pytorch/win-test-helpers/build_pytorch.bat @@ -127,6 +127,7 @@ if "%USE_CUDA%"=="1" ( ) :: Install build-system requirements before running setup.py commands +:: We need manage the build environment manually because we are not using build isolation python -m pip install -r requirements-build.txt if errorlevel 1 goto fail if not errorlevel 0 goto fail From ba8bd94b8886a1391034846d868d6e83687fac3a Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 12 Aug 2025 23:38:40 +0800 Subject: [PATCH 19/19] Update [ghstack-poisoned] --- .github/scripts/windows/build_triton.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/build_triton.bat b/.github/scripts/windows/build_triton.bat index da2e86b40432..97cd535a4988 100644 --- a/.github/scripts/windows/build_triton.bat +++ b/.github/scripts/windows/build_triton.bat @@ -10,7 +10,7 @@ if "%PY_VERS%" == "3.13t" ( call conda create -n %PYTHON_PREFIX% -y -c=conda-forge python=%PY_VERS% ) :: Fix cmake version for issue https://github.com/pytorch/pytorch/issues/150480 -call conda run -n %PYTHON_PREFIX% pip install wheel pybind11 certifi cython cmake==3.31.6 setuptools==78.1.1 ninja +call conda run -n %PYTHON_PREFIX% pip install wheel pybind11 certifi cython cmake==3.31.6 setuptools==72.1.0 ninja dir "%VC_INSTALL_PATH%"