8000 Update · pytorch/pytorch@e01be2f · GitHub
[go: up one dir, main page]

Skip to content

Commit e01be2f

Browse files
committed
Update
[ghstack-poisoned]
2 parents b90d264 + 228c59d commit e01be2f

File tree

264 files changed

+7327
-4036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+7327
-4036
lines changed

.ci/docker/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ if [[ "$image" == *rocm* ]]; then
9595
_UCC_COMMIT=0c0fc21559835044ab107199e334f7157d6a0d3d
9696
fi
9797

98+
tag=$(echo $image | awk -F':' '{print $2}')
99+
98100
# It's annoying to rename jobs every time you want to rewrite a
99101
# configuration, so we hardcode everything here rather than do it
100102
# from scratch
101-
case "$image" in
103+
case "$tag" in
102104
pytorch-linux-focal-cuda12.6-cudnn9-py3-gcc11)
103105
CUDA_VERSION=12.6.3
104106
CUDNN_VERSION=9
@@ -481,6 +483,7 @@ docker build \
481483
--build-arg "EXECUTORCH=${EXECUTORCH}" \
482484
--build-arg "HALIDE=${HALIDE}" \
483485
--build-arg "XPU_VERSION=${XPU_VERSION}" \
486+
--build-arg "UNINSTALL_DILL=${UNINSTALL_DILL}" \
484487
--build-arg "ACL=${ACL:-}" \
485488
--build-arg "SKIP_SCCACHE_INSTALL=${SKIP_SCCACHE_INSTALL:-}" \
486489
--build-arg "SKIP_LLVM_SRC_BUILD_INSTALL=${SKIP_LLVM_SRC_BUILD_INSTALL:-}" \

.ci/docker/common/install_cache.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ install_ubuntu() {
99
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
1010
apt-get install -y cargo
1111
echo "Checking out sccache repo"
12-
git clone https://github.com/mozilla/sccache -b v0.9.1
12+
git clone https://github.com/mozilla/sccache -b v0.10.0
1313
cd sccache
1414
echo "Building sccache"
1515
cargo build --release

.ci/pytorch/macos-test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ test_python_all() {
4242
assert_git_not_dirty
4343
}
4444

45+
test_python_mps() {
46+
setup_test_python
47+
48+
time python test/run_test.py --verbose --mps
49+
MTL_CAPTURE_ENABLED=1 ${CONDA_RUN} python3 test/test_mps.py --verbose -k test_metal_capture
50+
51+
assert_git_not_dirty
52+
}
53+
54+
4555
test_python_shard() {
4656
if [[ -z "$NUM_TEST_SHARDS" ]]; then
4757
echo "NUM_TEST_SHARDS must be defined to run a Python test shard"
@@ -305,6 +315,8 @@ elif [[ $TEST_CONFIG == *"perf_timm"* ]]; then
305315
test_timm_perf
306316
elif [[ $TEST_CONFIG == *"perf_smoketest"* ]]; then
307317
test_torchbench_smoketest
318+
elif [[ $TEST_CONFIG == *"mps"* ]]; then
319+
test_python_mps
308320
elif [[ $NUM_TEST_SHARDS -gt 1 ]]; then
309321
test_python_shard "${SHARD_NUMBER}"
310322
if [[ "${SHARD_NUMBER}" == 1 ]]; then

.ci/pytorch/run_tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fi
7676
# Environment initialization
7777
if [[ "$(uname)" == Darwin ]]; then
7878
# Install the testing dependencies
79-
retry conda install -yq future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest setuptools six typing_extensions pyyaml
79+
retry pip install -q future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest setuptools six typing_extensions pyyaml
8080
else
8181
retry pip install -qr requirements.txt || true
8282
retry pip install -q hypothesis protobuf pytest setuptools || true
@@ -91,7 +91,6 @@ fi
9191

9292
echo "Testing with:"
9393
pip freeze
94-
conda list || true
9594

9695
##############################################################################
9796
# Smoke tests

.ci/pytorch/windows/build_pytorch.bat

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22

3-
:: This script parses args, installs required libraries (miniconda, MKL,
4-
:: Magma), and then delegates to cpu.bat, cuda80.bat, etc.
3+
:: This script parses args, installs required libraries (MKL, Magma, libuv)
4+
:: and then delegates to cpu.bat, cuda80.bat, etc.
55

66
if not "%CUDA_VERSION%" == "" if not "%PYTORCH_BUILD_VERSION%" == "" if not "%PYTORCH_BUILD_NUMBER%" == "" goto env_end
77
if "%~1"=="" goto arg_error
@@ -36,28 +36,18 @@ set DESIRED_PYTHON_PREFIX=py%DESIRED_PYTHON_PREFIX:;=;py%
3636
set SRC_DIR=%~dp0
3737
pushd %SRC_DIR%
3838

39-
:: Install Miniconda3
40-
set "CONDA_HOME=%CD%\conda"
41-
set "tmp_conda=%CONDA_HOME%"
42-
set "miniconda_exe=%CD%\miniconda.exe"
43-
rmdir /s /q conda
44-
del miniconda.exe
45-
curl --retry 3 -k https://repo.anaconda.com/miniconda/Miniconda3-py311_23.9.0-0-Windows-x86_64.exe -o "%miniconda_exe%"
46-
start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda%
47-
if ERRORLEVEL 1 exit /b 1
4839
set "ORIG_PATH=%PATH%"
49-
set "PATH=%CONDA_HOME%;%CONDA_HOME%\scripts;%CONDA_HOME%\Library\bin;%PATH%"
5040

51-
:: create a new conda environment and install packages
41+
:: setup build environment
5242
:try
5343
SET /A tries=3
5444
:loop
5545
IF %tries% LEQ 0 GOTO :exception
56-
call condaenv.bat
46+
call setup_build.bat
5747
IF %ERRORLEVEL% EQU 0 GOTO :done
5848
SET /A "tries=%tries%-1"
5949
:exception
60-
echo "Failed to create conda env"
50+
echo "Failed to setup build environment"
6151
exit /B 1
6252
:done
6353

@@ -73,7 +63,7 @@ if "%DEBUG%" == "1" (
7363
if not "%CUDA_VERSION%" == "cpu" if not "%CUDA_VERSION%" == "xpu" (
7464
rmdir /s /q magma_%CUDA_PREFIX%_%BUILD_TYPE%
7565
del magma_%CUDA_PREFIX%_%BUILD_TYPE%.7z
76-
curl -k https://s3.amazonaws.com/ossci-windows/magma_%MAGMA_VERSION%_%CUDA_PREFIX%_%BUILD_TYPE%.7z -o magma_%CUDA_PREFIX%_%BUILD_TYPE%.7z
66+
curl -k https://s3.amazonaws.com/ossci-windows/magma_%MAGMA_VERSION%_%CUDA_PREFIX%_%BUILD_TYPE%.7z -o magma_%CUDA_PREFIX%_%BUILD_TYPE%.7z %= @lint-ignore =%
7767
7z x -aoa magma_%CUDA_PREFIX%_%BUILD_TYPE%.7z -omagma_%CUDA_PREFIX%_%BUILD_TYPE%
7868
)
7969

@@ -107,19 +97,20 @@ set TH_BINARY_BUILD=1
10797
set INSTALL_TEST=0
10898

10999
for %%v in (%DESIRED_PYTHON_PREFIX%) do (
110-
:: Activate Python Environment
111-
set PYTHON_PREFIX=%%v
112-
set "CONDA_LIB_PATH=%CONDA_HOME%\envs\%%v\Library\bin"
100+
101+
:: Set Environment vars for the build
102+
set "CMAKE_PREFIX_PATH=%CD%\Python\Library\;%PATH%"
103+
set "PYTHON_LIB_PATH=%CD%\Python\Library\bin"
104+
113105
if not "%ADDITIONAL_PATH%" == "" (
114-
set "PATH=%ADDITIONAL_PATH%;%CONDA_HOME%\envs\%%v;%CONDA_HOME%\envs\%%v\scripts;%CONDA_HOME%\envs\%%v\Library\bin;%ORIG_PATH%"
115-
) else (
116-
set "PATH=%CONDA_HOME%\envs\%%v;%CONDA_HOME%\envs\%%v\scripts;%CONDA_HOME%\envs\%%v\Library\bin;%ORIG_PATH%"
106+
set "PATH=%ADDITIONAL_PATH%;%PATH%"
117107
)
108+
118109
pip install ninja
119110
@setlocal
120111
:: Set Flags
121112
if not "%CUDA_VERSION%"=="cpu" if not "%CUDA_VERSION%" == "xpu" (
122-
set MAGMA_HOME=%cd%\magma_%CUDA_PREFIX%_%BUILD_TYPE%
113+
set "MAGMA_HOME=%cd%\magma_%CUDA_PREFIX%_%BUILD_TYPE%"
123114
)
124115
echo "Calling arch build script"
125116
call %CUDA_PREFIX%.bat

.ci/pytorch/windows/condaenv.bat

Lines changed: 0 additions & 27 deletions
This file was deleted.

.ci/pytorch/windows/internal/copy.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ copy "%CUDA_PATH%\bin\nvrtc*64_*.dll*" pytorch\torch\lib
1010
copy "%CUDA_PATH%\extras\CUPTI\lib64\cupti64_*.dll*" pytorch\torch\lib
1111

1212
copy "C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64\nvToolsExt64_1.dll*" pytorch\torch\lib
13-
copy "%CONDA_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib
13+
copy "%PYTHON_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib
1414

1515
:: Should be set in build_pytorch.bat
1616
copy "%libuv_ROOT%\bin\uv.dll" pytorch\torch\lib
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
copy "%CONDA_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib
1+
copy "%PYTHON_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib
22
:: Should be set in build_pytorch.bat
3-
copy "%libuv_ROOT%\bin\uv.dll" pytorch\torch\lib
3+
copy "%libuv_ROOT%\bin\uv.dll" pytorch\torch\lib

.ci/pytorch/windows/internal/env_fix.bat

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set ADDITIONAL_OPTIONS=""
2+
set PYTHON_EXEC="python"
3+
if "%DESIRED_PYTHON%" == "3.13t" (
4+
echo Python version is set to 3.13t
5+
set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe"
6+
set ADDITIONAL_OPTIONS="Include_freethreaded=1"
7+
set PYTHON_EXEC="python3.13t"
8+
) else (
9+
echo DESIRED_PYTHON not defined, Python version is set to %DESIRED_PYTHON%
10+
set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/%DESIRED_PYTHON%.0/python-%DESIRED_PYTHON%.0-amd64.exe" %= @lint-ignore =%
11+
)
12+
13+
del python-amd64.exe
14+
curl --retry 3 -kL "%PYTHON_INSTALLER_URL%" --output python-amd64.exe
15+
if errorlevel 1 exit /b 1
16+
17+
start /wait "" python-amd64.exe /quiet InstallAllUsers=1 PrependPath=0 Include_test=0 %ADDITIONAL_OPTIONS% TargetDir=%CD%\Python
18+
if errorlevel 1 exit /b 1
19+
20+
set "PATH=%CD%\Python\Scripts;%CD%\Python;%PATH%"

0 commit comments

Comments
 (0)
0