Skip to content

Commit 08a06f1

Browse files
committed
Update on "[dynamo, nested graph breaks] small fixes to resume function generation"
Old: ~pack resume function stack + locals into a list: we need to be able to pass frame stack+locals in lists to hand off to nested functions in the future, so we implement this part first.~ We are no longer doing this right now since GraphModule/guard variable naming gets messed up. Going forward, our approach will be to keep the top frame unpacked, but pack the rest of the contents of other frames in a list. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
2 parents 76e763f + 84df05a commit 08a06f1

File tree

612 files changed

+16874
-4782
lines changed

Some content is hidden

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

612 files changed

+16874
-4782
lines changed

.ci/aarch64_linux/aarch64_wheel_ci_build.py

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,47 @@ def build_ArmComputeLibrary() -> None:
3131
"build=native",
3232
]
3333
acl_install_dir = "/acl"
34-
acl_checkout_dir = "ComputeLibrary"
35-
os.makedirs(acl_install_dir)
36-
check_call(
37-
[
38-
"git",
39-
"clone",
40-
"https://github.com/ARM-software/ComputeLibrary.git",
41-
"-b",
42-
"v25.02",
43-
"--depth",
44-
"1",
45-
"--shallow-submodules",
46-
]
47-
)
34+
acl_checkout_dir = os.getenv("ACL_SOURCE_DIR", "ComputeLibrary")
35+
if os.path.isdir(acl_install_dir):
36+
shutil.rmtree(acl_install_dir)
37+
if not os.path.isdir(acl_checkout_dir) or not len(os.listdir(acl_checkout_dir)):
38+
check_call(
39+
[
40+
"git",
41+
"clone",
42+
"https://github.com/ARM-software/ComputeLibrary.git",
43+
"-b",
44+
"v25.02",
45+
"--depth",
46+
"1",
47+
"--shallow-submodules",
48+
]
49+
)
4850

4951
check_call(
50-
["scons", "Werror=1", "-j8", f"build_dir=/{acl_install_dir}/build"]
51-
+ acl_build_flags,
52+
["scons", "Werror=1", f"-j{os.cpu_count()}"] + acl_build_flags,
5253
cwd=acl_checkout_dir,
5354
)
54-
for d in ["arm_compute", "include", "utils", "support", "src"]:
55+
for d in ["arm_compute", "include", "utils", "support", "src", "build"]:
5556
shutil.copytree(f"{acl_checkout_dir}/{d}", f"{acl_install_dir}/{d}")
5657

5758

58-
def update_wheel(wheel_path, desired_cuda) -> None:
59+
def replace_tag(filename) -> None:
60+
with open(filename) as f:
61+
lines = f.readlines()
62+
for i, line in enumerate(lines):
63+
if line.startswith("Tag:"):
64+
lines[i] = line.replace("-linux_", "-manylinux_2_28_")
65+
print(f"Updated tag from {line} to {lines[i]}")
66+
break
67+
68+
with open(filename, "w") as f:
69+
f.writelines(lines)
70+
71+
72+
def package_cuda_wheel(wheel_path, desired_cuda) -> None:
5973
"""
60-
Update the cuda wheel libraries
74+
Package the cuda wheel libraries
6175
"""
6276
folder = os.path.dirname(wheel_path)
6377
wheelname = os.path.basename(wheel_path)
@@ -88,30 +102,19 @@ def update_wheel(wheel_path, desired_cuda) -> None:
88102
"/usr/lib64/libgfortran.so.5",
89103
"/acl/build/libarm_compute.so",
90104
"/acl/build/libarm_compute_graph.so",
105+
"/usr/local/lib/libnvpl_lapack_lp64_gomp.so.0",
106+
"/usr/local/lib/libnvpl_blas_lp64_gomp.so.0",
107+
"/usr/local/lib/libnvpl_lapack_core.so.0",
108+
"/usr/local/lib/libnvpl_blas_core.so.0",
91109
]
92-
if enable_cuda:
93-
libs_to_copy += [
94-
"/usr/local/lib/libnvpl_lapack_lp64_gomp.so.0",
95-
"/usr/local/lib/libnvpl_blas_lp64_gomp.so.0",
96-
"/usr/local/lib/libnvpl_lapack_core.so.0",
97-
"/usr/local/lib/libnvpl_blas_core.so.0",
98-
]
99-
if "126" in desired_cuda:
100-
libs_to_copy += [
101-
"/usr/local/cuda/lib64/libnvrtc-builtins.so.12.6",
102-
"/usr/local/cuda/lib64/libcufile.so.0",
103-
"/usr/local/cuda/lib64/libcufile_rdma.so.1",
104-
]
105-
elif "128" in desired_cuda:
106-
libs_to_copy += [
107-
"/usr/local/cuda/lib64/libnvrtc-builtins.so.12.8",
108-
"/usr/local/cuda/lib64/libcufile.so.0",
109-
"/usr/local/cuda/lib64/libcufile_rdma.so.1",
110-
]
111-
else:
110+
111+
if "128" in desired_cuda:
112112
libs_to_copy += [
113-
"/opt/OpenBLAS/lib/libopenblas.so.0",
113+
"/usr/local/cuda/lib64/libnvrtc-builtins.so.12.8",
114+
"/usr/local/cuda/lib64/libcufile.so.0",
115+
"/usr/local/cuda/lib64/libcufile_rdma.so.1",
114116
]
117+
115118
# Copy libraries to unzipped_folder/a/lib
116119
for lib_path in libs_to_copy:
117120
lib_name = os.path.basename(lib_path)
@@ -120,6 +123,13 @@ def update_wheel(wheel_path, desired_cuda) -> None:
120123
f"cd {folder}/tmp/torch/lib/; "
121124
f"patchelf --set-rpath '$ORIGIN' --force-rpath {folder}/tmp/torch/lib/{lib_name}"
122125
)
126+
127+
# Make sure the wheel is tagged with manylinux_2_28
128+
for f in os.scandir(f"{folder}/tmp/"):
129+
if f.is_dir() and f.name.endswith(".dist-info"):
130+
replace_tag(f"{f.path}/WHEEL")
131+
break
132+
123133
os.mkdir(f"{folder}/cuda_wheel")
124134
os.system(f"cd {folder}/tmp/; zip -r {folder}/cuda_wheel/{wheelname} *")
125135
shutil.move(
@@ -194,8 +204,10 @@ def parse_arguments():
194204
).decode()
195205

196206
print("Building PyTorch wheel")
197-
build_vars = "MAX_JOBS=5 CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
198-
os.system("cd /pytorch; python setup.py clean")
207+
build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
208+
# MAX_JOB=5 is not required for CPU backend (see commit 465d98b)
209+
if enable_cuda:
210+
build_vars = "MAX_JOBS=5 " + build_vars
199211

200212
override_package_version = os.getenv("OVERRIDE_PACKAGE_VERSION")
201213
desired_cuda = os.getenv("DESIRED_CUDA")
@@ -242,6 +254,6 @@ def parse_arguments():
242254
print("Updating Cuda Dependency")
243255
filename = os.listdir("/pytorch/dist/")
244256
wheel_path = f"/pytorch/dist/{filename[0]}"
245-
update_wheel(wheel_path, desired_cuda)
257+
package_cuda_wheel(wheel_path, desired_cuda)
246258
pytorch_wheel_name = complete_wheel("/pytorch/")
247259
print(f"Build Complete. Created {pytorch_wheel_name}..")

.ci/docker/almalinux/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG CUDA_VERSION=12.4
22
ARG BASE_TARGET=cuda${CUDA_VERSION}
33
ARG ROCM_IMAGE=rocm/dev-almalinux-8:6.3-complete
4-
FROM amd64/almalinux:8 as base
4+
FROM amd64/almalinux:8.10-20250519 as base
55

66
ENV LC_ALL en_US.UTF-8
77
ENV LANG en_US.UTF-8
@@ -11,6 +11,8 @@ ARG DEVTOOLSET_VERSION=11
1111

1212
RUN yum -y update
1313
RUN yum -y install epel-release
14+
# install glibc-langpack-en make sure en_US.UTF-8 locale is available
15+
RUN yum -y install glibc-langpack-en
1416
RUN yum install -y sudo wget curl perl util-linux xz bzip2 git patch which perl zlib-devel openssl-devel yum-utils autoconf automake make gcc-toolset-${DEVTOOLSET_VERSION}-toolchain
1517
# Just add everything as a safe.directory for git since these will be used in multiple places with git
1618
RUN git config --global --add safe.directory '*'

.ci/docker/build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ case "$tag" in
109109
UCC_COMMIT=${_UCC_COMMIT}
110110
TRITON=yes
111111
;;
112-
pytorch-linux-focal-cuda12.8-cudnn9-py3-gcc9-inductor-benchmarks)
113-
CUDA_VERSION=12.8.0
112+
pytorch-linux-jammy-cuda12.8-cudnn9-py3-gcc9-inductor-benchmarks)
113+
CUDA_VERSION=12.8
114114
CUDNN_VERSION=9
115115
ANACONDA_PYTHON_VERSION=3.10
116116
GCC_VERSION=9
@@ -132,8 +132,8 @@ case "$tag" in
132132
UCC_COMMIT=${_UCC_COMMIT}
133133
TRITON=yes
134134
;;
135-
pytorch-linux-focal-cuda12.6-cudnn9-py3-gcc9-inductor-benchmarks)
136-
CUDA_VERSION=12.6.3
135+
pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc9-inductor-benchmarks)
136+
CUDA_VERSION=12.6
137137
CUDNN_VERSION=9
138138
ANACONDA_PYTHON_VERSION=3.10
139139
GCC_VERSION=9
@@ -144,8 +144,8 @@ case "$tag" in
144144
TRITON=yes
145145
INDUCTOR_BENCHMARKS=yes
146146
;;
147-
pytorch-linux-focal-cuda12.6-cudnn9-py3.12-gcc9-inductor-benchmarks)
148-
CUDA_VERSION=12.6.3
147+
pytorch-linux-jammy-cuda12.6-cudnn9-py3.12-gcc9-inductor-benchmarks)
148+
CUDA_VERSION=12.6
149149
CUDNN_VERSION=9
150150
ANACONDA_PYTHON_VERSION=3.12
151151
GCC_VERSION=9
@@ -156,8 +156,8 @@ case "$tag" in
156156
TRITON=yes
157157
INDUCTOR_BENCHMARKS=yes
158158
;;
159-
pytorch-linux-focal-cuda12.6-cudnn9-py3.13-gcc9-inductor-benchmarks)
160-
CUDA_VERSION=12.6.3
159+
pytorch-linux-jammy-cuda12.6-cudnn9-py3.13-gcc9-inductor-benchmarks)
160+
CUDA_VERSION=12.6
161161
CUDNN_VERSION=9
162162
ANACONDA_PYTHON_VERSION=3.13
163163
GCC_VERSION=9

.ci/docker/common/install_cuda.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ function prune_126 {
183183

184184
function install_128 {
185185
CUDNN_VERSION=9.8.0.87
186-
echo "Installing CUDA 12.8.0 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.6.3"
187-
# install CUDA 12.8.0 in the same container
188-
install_cuda 12.8.0 cuda_12.8.0_570.86.10_linux
186+
echo "Installing CUDA 12.8.1 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.6.3"
187+
# install CUDA 12.8.1 in the same container
188+
install_cuda 12.8.1 cuda_12.8.1_570.124.06_linux
189189

190190
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
191191
install_cudnn 12 $CUDNN_VERSION

.ci/docker/common/install_onnx.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ pip_install \
3131
pip_install coloredlogs packaging
3232

3333
pip_install onnxruntime==1.18.1
34-
pip_install onnx==1.17.0
35-
pip_install onnxscript==0.2.2 --no-deps
34+
pip_install onnxscript==0.2.6 --no-deps
3635
# required by onnxscript
3736
pip_install ml_dtypes
3837

.ci/docker/manywheel/Dockerfile_s390x

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ ENV LC_ALL=C.UTF-8
55
ENV LANG=C.UTF-8
66
ENV LANGUAGE=C.UTF-8
77

8-
ARG DEVTOOLSET_VERSION=13
8+
# there is a bugfix in gcc >= 14 for precompiled headers and s390x vectorization interaction.
9+
# with earlier gcc versions test/inductor/test_cpu_cpp_wrapper.py will fail.
10+
ARG DEVTOOLSET_VERSION=14
911
# Installed needed OS packages. This is to support all
1012
# the binary builds (torch, vision, audio, text, data)
1113
RUN yum -y install epel-release
@@ -58,7 +60,8 @@ RUN yum install -y \
5860
libxslt-devel \
5961
libxml2-devel \
6062
openssl-devel \
61-
valgrind
63+
valgrind \
64+
ninja-build
6265

6366
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
6467
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
@@ -103,9 +106,6 @@ CMD ["/bin/bash"]
103106
# install test dependencies:
104107
# - grpcio requires system openssl, bundled crypto fails to build
105108
RUN dnf install -y \
106-
protobuf-devel \
107-
protobuf-c-devel \
108-
protobuf-lite-devel \
109109
hdf5-devel \
110110
python3-h5py \
111111
git
@@ -129,6 +129,9 @@ RUN pip3 install flatbuffers && \
129129
git clone https://github.com/microsoft/onnxruntime && \
130130
cd onnxruntime && git checkout v1.21.0 && \
131131
git submodule update --init --recursive && \
132-
./build.sh --config Release --parallel 0 --enable_pybind --build_wheel --enable_training --enable_training_apis --enable_training_ops --skip_tests --allow_running_as_root && \
132+
./build.sh --config Release --parallel 0 --enable_pybind \
133+
--build_wheel --enable_training --enable_training_apis \
134+
--enable_training_ops --skip_tests --allow_running_as_root \
135+
--compile_no_warning_as_error && \
133136
pip3 install ./build/Linux/Release/dist/onnxruntime_training-*.whl && \
134137
cd .. && /bin/rm -rf ./onnxruntime

.ci/docker/requirements-ci.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ librosa>=0.6.2 ; python_version < "3.11"
9393
#Pinned versions:
9494
#test that import:
9595

96-
mypy==1.14.0
96+
mypy==1.15.0
9797
# Pin MyPy version because new errors are likely to appear with each release
9898
#Description: linter
9999
#Pinned versions: 1.14.0
@@ -166,10 +166,10 @@ pillow==11.0.0
166166
#Pinned versions: 10.3.0
167167
#test that import:
168168

169-
protobuf==3.20.2
170-
#Description: Googles data interchange format
171-
#Pinned versions: 3.20.1
172-
#test that import: test_tensorboard.py
169+
protobuf==5.29.4
170+
#Description: Google's data interchange format
171+
#Pinned versions: 5.29.4
172+
#test that import: test_tensorboard.py, test/onnx/*
173173

174174
psutil
175175
#Description: information on running processes and system utilization
@@ -337,12 +337,12 @@ sympy==1.13.3
337337
#Pinned versions:
338338
#test that import:
339339

340-
onnx==1.17.0
341-
#Description: Required by mypy and test_public_bindings.py when checking torch.onnx._internal
340+
onnx==1.18.0
341+
#Description: Required by onnx tests, and mypy and test_public_bindings.py when checking torch.onnx._internal
342342
#Pinned versions:
343343
#test that import:
344344

345-
onnxscript==0.2.2
345+
onnxscript==0.2.6
346346
#Description: Required by mypy and test_public_bindings.py when checking torch.onnx._internal
347347
#Pinned versions:
348348
#test that import:

.ci/docker/requirements-docs.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ sphinxext-opengraph==0.9.1
1515
#Description: This is used to generate PyTorch docs
1616
#Pinned versions: 0.9.1
1717

18+
sphinx_sitemap==2.6.0
19+
#Description: This is used to generate sitemap for PyTorch docs
20+
#Pinned versions: 2.6.0
21+
1822
matplotlib==3.5.3
1923
#Description: This is used to generate PyTorch docs
2024
#Pinned versions: 3.5.3

.ci/manywheel/build_common.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ retry () {
1818
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
1919
}
2020

21-
PLATFORM="manylinux2014_x86_64"
21+
PLATFORM=""
2222
# TODO move this into the Docker images
2323
OS_NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
24-
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
25-
retry yum install -q -y zip openssl
26-
elif [[ "$OS_NAME" == *"AlmaLinux"* ]]; then
24+
if [[ "$OS_NAME" == *"AlmaLinux"* ]]; then
2725
retry yum install -q -y zip openssl
2826
PLATFORM="manylinux_2_28_x86_64"
2927
elif [[ "$OS_NAME" == *"Red Hat Enterprise Linux"* ]]; then
@@ -36,6 +34,9 @@ elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then
3634

3735
retry apt-get update
3836
retry apt-get -y install zip openssl
37+
else
38+
echo "Unknown OS: '$OS_NAME'"
39+
exit 1
3940
fi
4041

4142
# We use the package name to test the package by passing this to 'pip install'
@@ -79,8 +80,6 @@ if [[ -e /opt/openssl ]]; then
7980
export CMAKE_INCLUDE_PATH="/opt/openssl/include":$CMAKE_INCLUDE_PATH
8081
fi
8182

82-
83-
8483
mkdir -p /tmp/$WHEELHOUSE_DIR
8584

8685
export PATCHELF_BIN=/usr/local/bin/patchelf

0 commit comments

Comments
 (0)