Skip to content

Commit b40191b

Browse files
Merge remote-tracking branch 'upstream/main' into rocm7.1_internal_testing_IFU_2025-09-24
# Conflicts: # .ci/docker/ci_commit_pins/triton.txt # .ci/docker/common/install_rocm.sh # .ci/docker/requirements-ci.txt # CMakeLists.txt # aten/src/ATen/native/Normalization.cpp # aten/src/ATen/native/miopen/BatchNorm_miopen.cpp # requirements-build.txt # test/nn/test_convolution.py # test/test_binary_ufuncs.py # test/test_nn.py # torch/_inductor/runtime/triton_heuristics.py # torch/testing/_internal/common_utils.py
2 parents 48cac8f + 1495b35 commit b40191b

File tree

1,346 files changed

+39200
-16646
lines changed

Some content is hidden

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

1,346 files changed

+39200
-16646
lines changed

.ci/aarch64_linux/aarch64_ci_build.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ GPU_ARCH_VERSION=${GPU_ARCH_VERSION:-}
55

66
# Set CUDA architecture lists to match x86 build_cuda.sh
77
if [[ "$GPU_ARCH_VERSION" == *"12.6"* ]]; then
8-
export TORCH_CUDA_ARCH_LIST="5.0;6.0;7.0;8.0;9.0"
8+
export TORCH_CUDA_ARCH_LIST="8.0;9.0"
99
elif [[ "$GPU_ARCH_VERSION" == *"12.8"* ]]; then
10-
export TORCH_CUDA_ARCH_LIST="7.0;8.0;9.0;10.0;12.0"
10+
export TORCH_CUDA_ARCH_LIST="8.0;9.0;10.0;12.0"
1111
elif [[ "$GPU_ARCH_VERSION" == *"13.0"* ]]; then
1212
export TORCH_CUDA_ARCH_LIST="8.0;9.0;10.0;11.0;12.0+PTX"
1313
fi
@@ -31,8 +31,7 @@ pip install -r /pytorch/requirements.txt
3131
pip install auditwheel==6.2.0 wheel
3232
if [ "$DESIRED_CUDA" = "cpu" ]; then
3333
echo "BASE_CUDA_VERSION is not set. Building cpu wheel."
34-
#USE_PRIORITIZED_TEXT_FOR_LD for enable linker script optimization https://github.com/pytorch/pytorch/pull/121975/files
35-
USE_PRIORITIZED_TEXT_FOR_LD=1 python /pytorch/.ci/aarch64_linux/aarch64_wheel_ci_build.py --enable-mkldnn
34+
python /pytorch/.ci/aarch64_linux/aarch64_wheel_ci_build.py --enable-mkldnn
3635
else
3736
echo "BASE_CUDA_VERSION is set to: $DESIRED_CUDA"
3837
export USE_SYSTEM_NCCL=1
@@ -42,13 +41,9 @@ else
4241
echo "Bundling CUDA libraries with wheel for aarch64."
4342
else
4443
echo "Using nvidia libs from pypi for aarch64."
45-
# Fix platform constraints in PYTORCH_EXTRA_INSTALL_REQUIREMENTS for aarch64
46-
# Replace 'platform_machine == "x86_64"' with 'platform_machine == "aarch64"'
47-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS//platform_machine == \'x86_64\'/platform_machine == \'aarch64\'}"
4844
echo "Updated PYTORCH_EXTRA_INSTALL_REQUIREMENTS for aarch64: $PYTORCH_EXTRA_INSTALL_REQUIREMENTS"
4945
export USE_NVIDIA_PYPI_LIBS=1
5046
fi
5147

52-
#USE_PRIORITIZED_TEXT_FOR_LD for enable linker script optimization https://github.com/pytorch/pytorch/pull/121975/files
53-
USE_PRIORITIZED_TEXT_FOR_LD=1 python /pytorch/.ci/aarch64_linux/aarch64_wheel_ci_build.py --enable-mkldnn --enable-cuda
48+
python /pytorch/.ci/aarch64_linux/aarch64_wheel_ci_build.py --enable-mkldnn --enable-cuda
5449
fi

.ci/aarch64_linux/aarch64_wheel_ci_build.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None:
138138
folder = os.path.dirname(wheel_path)
139139
os.mkdir(f"{folder}/tmp")
140140
os.system(f"unzip {wheel_path} -d {folder}/tmp")
141+
# Delete original wheel since it will be repackaged
142+
os.system(f"rm {wheel_path}")
141143

142144
# Check if we should use PyPI NVIDIA libraries or bundle system libraries
143145
use_nvidia_pypi_libs = os.getenv("USE_NVIDIA_PYPI_LIBS", "0") == "1"
@@ -211,7 +213,8 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None:
211213
]
212214

213215
# CUDA version-specific libraries
214-
if "130" in desired_cuda:
216+
if "13" in desired_cuda:
217+
minor_version = desired_cuda[-1]
215218
version_specific_libs = [
216219
"/usr/local/cuda/extras/CUPTI/lib64/libcupti.so.13",
217220
"/usr/local/cuda/lib64/libcublas.so.13",
@@ -221,7 +224,7 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None:
221224
"/usr/local/cuda/lib64/libcusolver.so.12",
222225
"/usr/local/cuda/lib64/libnvJitLink.so.13",
223226
"/usr/local/cuda/lib64/libnvrtc.so.13",
224-
"/usr/local/cuda/lib64/libnvrtc-builtins.so.13.0",
227+
f"/usr/local/cuda/lib64/libnvrtc-builtins.so.13.{minor_version}",
225228
]
226229
elif "12" in desired_cuda:
227230
# Get the last character for libnvrtc-builtins version (e.g., "129" -> "9")
@@ -237,6 +240,8 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None:
237240
"/usr/local/cuda/lib64/libnvrtc.so.12",
238241
f"/usr/local/cuda/lib64/libnvrtc-builtins.so.12.{minor_version}",
239242
]
243+
else:
244+
raise ValueError(f"Unsupported CUDA version: {desired_cuda}.")
240245

241246
# Combine all libraries
242247
libs_to_copy = common_libs + version_specific_libs
@@ -275,14 +280,7 @@ def complete_wheel(folder: str) -> str:
275280
f"/{folder}/dist/{repaired_wheel_name}",
276281
)
277282
else:
278-
repaired_wheel_name = wheel_name.replace(
279-
"linux_aarch64", "manylinux_2_28_aarch64"
280-
)
281-
print(f"Renaming {wheel_name} wheel to {repaired_wheel_name}")
282-
os.rename(
283-
f"/{folder}/dist/{wheel_name}",
284-
f"/{folder}/dist/{repaired_wheel_name}",
285-
)
283+
repaired_wheel_name = list_dir(f"/{folder}/dist")[0]
286284

287285
print(f"Copying {repaired_wheel_name} to artifacts")
288286
shutil.copy2(
@@ -319,7 +317,7 @@ def parse_arguments():
319317
).decode()
320318

321319
print("Building PyTorch wheel")
322-
build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
320+
build_vars = ""
323321
# MAX_JOB=5 is not required for CPU backend (see commit 465d98b)
324322
if enable_cuda:
325323
build_vars += "MAX_JOBS=5 "

.ci/aarch64_linux/build_aarch64_wheel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def wait_for_connection(addr, port, timeout=15, attempt_cnt=5):
241241
try:
242242
with socket.create_connection((addr, port), timeout=timeout):
243243
return
244-
except (ConnectionRefusedError, socket.timeout): # noqa: PERF203
244+
except (ConnectionRefusedError, TimeoutError): # noqa: PERF203
245245
if i == attempt_cnt - 1:
246246
raise
247247
time.sleep(timeout)
@@ -1004,7 +1004,7 @@ def parse_arguments():
10041004
install_condaforge_python(host, args.python_version)
10051005
sys.exit(0)
10061006

1007-
python_version = args.python_version if args.python_version is not None else "3.9"
1007+
python_version = args.python_version if args.python_version is not None else "3.10"
10081008

10091009
if args.use_torch_from_pypi:
10101010
configure_system(host, compiler=args.compiler, python_version=python_version)

.ci/docker/build.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ case "$tag" in
214214
TRITON=yes
215215
;;
216216
pytorch-linux-jammy-py3-gcc11-inductor-benchmarks)
217-
# TODO (huydhn): Upgrade this to Python >= 3.10
218-
ANACONDA_PYTHON_VERSION=3.9
217+
ANACONDA_PYTHON_VERSION=3.10
219218
GCC_VERSION=11
220219
VISION=yes
221220
KATEX=yes
@@ -263,13 +262,10 @@ case "$tag" in
263262
TRITON_CPU=yes
264263
;;
265264
pytorch-linux-jammy-linter)
266-
# TODO: Use 3.9 here because of this issue https://github.com/python/mypy/issues/13627.
267-
# We will need to update mypy version eventually, but that's for another day. The task
268-
# would be to upgrade mypy to 1.0.0 with Python 3.11
269-
PYTHON_VERSION=3.9
265+
PYTHON_VERSION=3.10
270266
;;
271-
pytorch-linux-jammy-cuda12.8-cudnn9-py3.9-linter)
272-
PYTHON_VERSION=3.9
267+
pytorch-linux-jammy-cuda12.8-cudnn9-py3.10-linter)
268+
PYTHON_VERSION=3.10
273269
CUDA_VERSION=12.8.1
274270
;;
275271
pytorch-linux-jammy-aarch64-py3.10-gcc11)

.ci/docker/centos-rocm/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ ENV INSTALLED_VISION ${VISION}
5959

6060
# Install rocm
6161
ARG ROCM_VERSION
62+
RUN mkdir ci_commit_pins
63+
COPY ./common/common_utils.sh common_utils.sh
64+
COPY ./ci_commit_pins/rocm-composable-kernel.txt ci_commit_pins/rocm-composable-kernel.txt
6265
COPY ./common/install_rocm.sh install_rocm.sh
6366
RUN bash ./install_rocm.sh
64-
RUN rm install_rocm.sh
67+
RUN rm install_rocm.sh common_utils.sh
68+
RUN rm -r ci_commit_pins
6569
COPY ./common/install_rocm_magma.sh install_rocm_magma.sh
6670
RUN bash ./install_rocm_magma.sh ${ROCM_VERSION}
6771
RUN rm install_rocm_magma.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
56392aa978594cc155fa8af48cd949f5b5f1823a
1+
e0dda9059d082537cee36be6c5e4fe3b18c880c0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
transformers==4.54.0
1+
transformers==4.56.0
22
soxr==0.5.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7fe50dc3da2069d6645d9deb8c017a876472a977
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
<<<<<<< HEAD
12
6193b30becb1ac7be704cf87b8cb9bf13e7f9689
3+
=======
4+
bbb06c0334a6772b92d24bde54956e675c8c6604
5+
>>>>>>> upstream/main

.ci/docker/common/install_executorch.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,27 @@ install_pip_dependencies() {
4242
# A workaround, ExecuTorch has moved to numpy 2.0 which is not compatible with the current
4343
# numba and scipy version used in PyTorch CI
4444
conda_run pip uninstall -y numba scipy
45+
# Yaspin is needed for running CI test (get_benchmark_analysis_data.py)
46+
pip_install yaspin==3.1.0
4547

4648
popd
4749
}
4850

4951
setup_executorch() {
50-
pushd executorch
51-
5252
export PYTHON_EXECUTABLE=python
53-
export CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON"
53+
export CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON -DEXECUTORCH_BUILD_TESTS=ON"
5454

5555
as_jenkins .ci/scripts/setup-linux.sh --build-tool cmake || true
56-
popd
5756
}
5857

59-
clone_executorch
60-
install_buck2
61-
install_conda_dependencies
62-
install_pip_dependencies
63-
setup_executorch
58+
if [ $# -eq 0 ]; then
59+
clone_executorch
60+
install_buck2
61+
install_conda_dependencies
62+
install_pip_dependencies
63+
pushd executorch
64+
setup_executorch
65+
popd
66+
else
67+
"$@"
68+
fi

0 commit comments

Comments
 (0)