Skip to content

Commit 5768422

Browse files
authored
Merge branch 'pytorch:main' into main
2 parents c70435d + b0d8372 commit 5768422

File tree

12,195 files changed

+638161
-463887
lines changed

Some content is hidden

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

12,195 files changed

+638161
-463887
lines changed

.ci/docker/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Docker images for Jenkins
1+
# Docker images for GitHub CI
22

33
This directory contains everything needed to build the Docker images
4-
that are used in our CI
4+
that are used in our CI.
55

66
The Dockerfiles located in subdirectories are parameterized to
77
conditionally run build stages depending on build arguments passed to
@@ -12,13 +12,14 @@ each image as the `BUILD_ENVIRONMENT` environment variable.
1212

1313
See `build.sh` for valid build environments (it's the giant switch).
1414

15-
Docker builds are now defined with `.circleci/cimodel/data/simple/docker_definitions.py`
16-
1715
## Contents
1816

1917
* `build.sh` -- dispatch script to launch all builds
2018
* `common` -- scripts used to execute individual Docker build stages
19+
* `ubuntu` -- Dockerfile for Ubuntu image for CPU build and test jobs
2120
* `ubuntu-cuda` -- Dockerfile for Ubuntu image with CUDA support for nvidia-docker
21+
* `ubuntu-rocm` -- Dockerfile for Ubuntu image with ROCm support
22+
* `ubuntu-xpu` -- Dockerfile for Ubuntu image with XPU support
2223

2324
## Usage
2425

.ci/docker/build.sh

+85-56
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ if [[ "$image" == *xla* ]]; then
4646
exit 0
4747
fi
4848

49-
if [[ "$image" == *-bionic* ]]; then
50-
UBUNTU_VERSION=18.04
51-
elif [[ "$image" == *-focal* ]]; then
49+
if [[ "$image" == *-focal* ]]; then
5250
UBUNTU_VERSION=20.04
5351
elif [[ "$image" == *-jammy* ]]; then
5452
UBUNTU_VERSION=22.04
@@ -73,6 +71,11 @@ if [[ "$image" == *cuda* && "$UBUNTU_VERSION" != "22.04" ]]; then
7371
DOCKERFILE="${OS}-cuda/Dockerfile"
7472
elif [[ "$image" == *rocm* ]]; then
7573
DOCKERFILE="${OS}-rocm/Dockerfile"
74+
elif [[ "$image" == *xpu* ]]; then
75+
DOCKERFILE="${OS}-xpu/Dockerfile"
76+
elif [[ "$image" == *cuda*linter* ]]; then
77+
# Use a separate Dockerfile for linter to keep a small image size
78+
DOCKERFILE="linter-cuda/Dockerfile"
7679
elif [[ "$image" == *linter* ]]; then
7780
# Use a separate Dockerfile for linter to keep a small image size
7881
DOCKERFILE="linter/Dockerfile"
@@ -88,8 +91,8 @@ _UCC_COMMIT=7cb07a76ccedad7e56ceb136b865eb9319c258ea
8891
# configuration, so we hardcode everything here rather than do it
8992
# from scratch
9093
case "$image" in
91-
pytorch-linux-bionic-cuda12.1-cudnn8-py3-gcc9)
92-
CUDA_VERSION=12.1.0
94+
pytorch-linux-focal-cuda12.1-cudnn8-py3-gcc9)
95+
CUDA_VERSION=12.1.1
9396
CUDNN_VERSION=8
9497
ANACONDA_PYTHON_VERSION=3.10
9598
GCC_VERSION=9
@@ -102,8 +105,8 @@ case "$image" in
102105
CONDA_CMAKE=yes
103106
TRITON=yes
104107
;;
105-
pytorch-linux-bionic-cuda12.1-cudnn8-py3-gcc9-inductor-benchmarks)
106-
CUDA_VERSION=12.1.0
108+
pytorch-linux-focal-cuda12.1-cudnn8-py3-gcc9-inductor-benchmarks)
109+
CUDA_VERSION=12.1.1
107110
CUDNN_VERSION=8
108111
ANACONDA_PYTHON_VERSION=3.10
109112
GCC_VERSION=9
@@ -117,7 +120,7 @@ case "$image" in
117120
TRITON=yes
118121
INDUCTOR_BENCHMARKS=yes
119122
;;
120-
pytorch-linux-bionic-cuda11.8-cudnn8-py3-gcc9)
123+
pytorch-linux-focal-cuda11.8-cudnn8-py3-gcc9)
121124
CUDA_VERSION=11.8.0
122125
CUDNN_VERSION=8
123126
ANACONDA_PYTHON_VERSION=3.10
@@ -131,25 +134,11 @@ case "$image" in
131134
CONDA_CMAKE=yes
132135
TRITON=yes
133136
;;
134-
pytorch-linux-bionic-cuda11.8-cudnn8-py3-gcc7)
135-
CUDA_VERSION=11.8.0
137+
pytorch-linux-focal-cuda12.1-cudnn8-py3-gcc9)
138+
CUDA_VERSION=12.1.1
136139
CUDNN_VERSION=8
137140
ANACONDA_PYTHON_VERSION=3.10
138-
GCC_VERSION=7
139-
PROTOBUF=yes
140-
DB=yes
141-
VISION=yes
142-
KATEX=yes
143-
UCX_COMMIT=${_UCX_COMMIT}
144-
UCC_COMMIT=${_UCC_COMMIT}
145-
CONDA_CMAKE=yes
146-
TRITON=yes
147-
;;
148-
pytorch-linux-bionic-cuda11.8-cudnn8-py3-gcc7-inductor-benchmarks)
149-
CUDA_VERSION=11.8.0
150-
CUDNN_VERSION=8
151-
ANACONDA_PYTHON_VERSION=3.10
152-
GCC_VERSION=7
141+
GCC_VERSION=9
153142
PROTOBUF=yes
154143
DB=yes
155144
VISION=yes
@@ -158,16 +147,6 @@ case "$image" in
158147
UCC_COMMIT=${_UCC_COMMIT}
159148
CONDA_CMAKE=yes
160149
TRITON=yes
161-
INDUCTOR_BENCHMARKS=yes
162-
;;
163-
pytorch-linux-focal-py3-clang7-asan)
164-
ANACONDA_PYTHON_VERSION=3.9
165-
CLANG_VERSION=7
166-
PROTOBUF=yes
167-
DB=yes
168-
VISION=yes
169-
CONDA_CMAKE=yes
170-
TRITON=yes
171150
;;
172151
pytorch-linux-focal-py3-clang10-onnx)
173152
ANACONDA_PYTHON_VERSION=3.8
@@ -178,19 +157,19 @@ case "$image" in
178157
CONDA_CMAKE=yes
179158
ONNX=yes
180159
;;
181-
pytorch-linux-focal-py3-clang7-android-ndk-r19c)
160+
pytorch-linux-focal-py3-clang9-android-ndk-r21e)
182161
ANACONDA_PYTHON_VERSION=3.8
183-
CLANG_VERSION=7
162+
CLANG_VERSION=9
184163
LLVMDEV=yes
185164
PROTOBUF=yes
186165
ANDROID=yes
187-
ANDROID_NDK_VERSION=r19c
166+
ANDROID_NDK_VERSION=r21e
188167
GRADLE_VERSION=6.8.3
189168
NINJA_VERSION=1.9.0
190169
;;
191-
pytorch-linux-bionic-py3.8-clang9)
170+
pytorch-linux-focal-py3.8-clang10)
192171
ANACONDA_PYTHON_VERSION=3.8
193-
CLANG_VERSION=9
172+
CLANG_VERSION=10
194173
PROTOBUF=yes
195174
DB=yes
196175
VISION=yes
@@ -199,9 +178,9 @@ case "$image" in
199178
CONDA_CMAKE=yes
200179
TRITON=yes
201180
;;
202-
pytorch-linux-bionic-py3.11-clang9)
181+
pytorch-linux-focal-py3.11-clang10)
203182
ANACONDA_PYTHON_VERSION=3.11
204-
CLANG_VERSION=9
183+
CLANG_VERSION=10
205184
PROTOBUF=yes
206185
DB=yes
207186
VISION=yes
@@ -210,7 +189,7 @@ case "$image" in
210189
CONDA_CMAKE=yes
211190
TRITON=yes
212191
;;
213-
pytorch-linux-bionic-py3.8-gcc9)
192+
pytorch-linux-focal-py3.8-gcc9)
214193
ANACONDA_PYTHON_VERSION=3.8
215194
GCC_VERSION=9
216195
PROTOBUF=yes
@@ -225,7 +204,7 @@ case "$image" in
225204
PROTOBUF=yes
226205
DB=yes
227206
VISION=yes
228-
ROCM_VERSION=5.3
207+
ROCM_VERSION=5.7
229208
NINJA_VERSION=1.9.0
230209
CONDA_CMAKE=yes
231210
TRITON=yes
@@ -236,25 +215,25 @@ case "$image" in
236215
PROTOBUF=yes
237216
DB=yes
238217
VISION=yes
239-
ROCM_VERSION=5.4.2
218+
ROCM_VERSION=6.0
240219
NINJA_VERSION=1.9.0
241220
CONDA_CMAKE=yes
242221
TRITON=yes
243222
;;
244-
pytorch-linux-focal-py3.8-gcc7)
223+
pytorch-linux-jammy-xpu-2024.0-py3)
245224
ANACONDA_PYTHON_VERSION=3.8
246-
GCC_VERSION=7
225+
GCC_VERSION=11
247226
PROTOBUF=yes
248227
DB=yes
249228
VISION=yes
250-
KATEX=yes
229+
BASEKIT_VERSION=2024.0.0-49522
230+
NINJA_VERSION=1.9.0
251231
CONDA_CMAKE=yes
252232
TRITON=yes
253-
DOCS=yes
254233
;;
255-
pytorch-linux-focal-py3.8-gcc7-inductor-benchmarks)
234+
pytorch-linux-jammy-py3.8-gcc11-inductor-benchmarks)
256235
ANACONDA_PYTHON_VERSION=3.8
257-
GCC_VERSION=7
236+
GCC_VERSION=11
258237
PROTOBUF=yes
259238
DB=yes
260239
VISION=yes
@@ -274,13 +253,60 @@ case "$image" in
274253
VISION=yes
275254
TRITON=yes
276255
;;
256+
pytorch-linux-jammy-py3-clang12-asan)
257+
ANACONDA_PYTHON_VERSION=3.9
258+
CLANG_VERSION=12
259+
PROTOBUF=yes
260+
DB=yes
261+
VISION=yes
262+
CONDA_CMAKE=yes
263+
TRITON=yes
264+
;;
265+
pytorch-linux-jammy-py3-clang15-asan)
266+
ANACONDA_PYTHON_VERSION=3.10
267+
CLANG_VERSION=15
268+
CONDA_CMAKE=yes
269+
VISION=yes
270+
;;
271+
pytorch-linux-jammy-py3.8-gcc11)
272+
ANACONDA_PYTHON_VERSION=3.8
273+
GCC_VERSION=11
274+
PROTOBUF=yes
275+
DB=yes
276+
VISION=yes
277+
KATEX=yes
278+
CONDA_CMAKE=yes
279+
TRITON=yes
280+
DOCS=yes
281+
UNINSTALL_DILL=yes
282+
;;
283+
pytorch-linux-jammy-py3-clang12-executorch)
284+
ANACONDA_PYTHON_VERSION=3.10
285+
CLANG_VERSION=12
286+
CONDA_CMAKE=yes
287+
EXECUTORCH=yes
288+
;;
277289
pytorch-linux-focal-linter)
278290
# TODO: Use 3.9 here because of this issue https://github.com/python/mypy/issues/13627.
279291
# We will need to update mypy version eventually, but that's for another day. The task
280292
# would be to upgrade mypy to 1.0.0 with Python 3.11
281293
ANACONDA_PYTHON_VERSION=3.9
282294
CONDA_CMAKE=yes
283295
;;
296+
pytorch-linux-jammy-cuda11.8-cudnn8-py3.9-linter)
297+
ANACONDA_PYTHON_VERSION=3.9
298+
CUDA_VERSION=11.8
299+
CONDA_CMAKE=yes
300+
;;
301+
pytorch-linux-jammy-aarch64-py3.10-gcc11)
302+
ANACONDA_PYTHON_VERSION=3.10
303+
GCC_VERSION=11
304+
ACL=yes
305+
PROTOBUF=yes
306+
DB=yes
307+
VISION=yes
308+
CONDA_CMAKE=yes
309+
;;
284310
*)
285311
# Catch-all for builds that are not hardcoded.
286312
PROTOBUF=yes
@@ -298,6 +324,9 @@ case "$image" in
298324
extract_version_from_image_name rocm ROCM_VERSION
299325
NINJA_VERSION=1.9.0
300326
TRITON=yes
327+
# To ensure that any ROCm config will build using conda cmake
328+
# and thus have LAPACK/MKL enabled
329+
CONDA_CMAKE=yes
301330
fi
302331
if [[ "$image" == *centos7* ]]; then
303332
NINJA_VERSION=1.10.2
@@ -331,14 +360,11 @@ if [[ "$image" == *cuda* && ${OS} == "ubuntu" ]]; then
331360
fi
332361

333362
# Build image
334-
# TODO: build-arg THRIFT is not turned on for any image, remove it once we confirm
335-
# it's no longer needed.
336-
docker build \
363+
DOCKER_BUILDKIT=1 docker build \
337364
--no-cache \
338365
--progress=plain \
339366
--build-arg "BUILD_ENVIRONMENT=${image}" \
340367
--build-arg "PROTOBUF=${PROTOBUF:-}" \
341-
--build-arg "THRIFT=${THRIFT:-}" \
342368
--build-arg "LLVMDEV=${LLVMDEV:-}" \
343369
--build-arg "DB=${DB:-}" \
344370
--build-arg "VISION=${VISION:-}" \
@@ -361,7 +387,7 @@ docker build \
361387
--build-arg "NINJA_VERSION=${NINJA_VERSION:-}" \
362388
--build-arg "KATEX=${KATEX:-}" \
363389
--build-arg "ROCM_VERSION=${ROCM_VERSION:-}" \
364-
--build-arg "PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH:-gfx906}" \
390+
--build-arg "PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH:-gfx906;gfx90a}" \
365391
--build-arg "IMAGE_NAME=${IMAGE_NAME}" \
366392
--build-arg "UCX_COMMIT=${UCX_COMMIT}" \
367393
--build-arg "UCC_COMMIT=${UCC_COMMIT}" \
@@ -370,6 +396,9 @@ docker build \
370396
--build-arg "ONNX=${ONNX}" \
371397
--build-arg "DOCS=${DOCS}" \
372398
--build-arg "INDUCTOR_BENCHMARKS=${INDUCTOR_BENCHMARKS}" \
399+
--build-arg "EXECUTORCH=${EXECUTORCH}" \
400+
--build-arg "BASEKIT_VERSION=${BASEKIT_VERSION}" \
401+
--build-arg "ACL=${ACL:-}" \
373402
-f $(dirname ${DOCKERFILE})/Dockerfile \
374403
-t "$tmp_tag" \
375404
"$@" \

.ci/docker/build_docker.sh

-55
This file was deleted.

.ci/docker/centos-rocm/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ COPY ./common/install_ninja.sh install_ninja.sh
9898
RUN if [ -n "${NINJA_VERSION}" ]; then bash ./install_ninja.sh; fi
9999
RUN rm install_ninja.sh
100100

101+
ARG TRITON
102+
# Install triton, this needs to be done before sccache because the latter will
103+
# try to reach out to S3, which docker build runners don't have access
104+
ENV CMAKE_C_COMPILER cc
105+
ENV CMAKE_CXX_COMPILER c++
106+
COPY ./common/install_triton.sh install_triton.sh
107+
COPY ./common/common_utils.sh common_utils.sh
108+
COPY ci_commit_pins/triton-rocm.txt triton-rocm.txt
109+
COPY triton_version.txt triton_version.txt
110+
RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
111+
RUN rm install_triton.sh common_utils.sh triton-rocm.txt triton_version.txt
112+
101113
# Install ccache/sccache (do this last, so we get priority in PATH)
102114
COPY ./common/install_cache.sh install_cache.sh
103115
ENV PATH /opt/cache/bin:$PATH
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d4b3e5cc607e97afdba79dc90f8ef968142f347c

0 commit comments

Comments
 (0)