10000 Update base for Update on "use known_contiguous for _prim_elementwise… · pytorch/pytorch@3481961 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3481961

Browse files
committed
Update base for Update on "us 8000 e known_contiguous for _prim_elementwise_meta short circuit"
* This verifies that the check short circuit is not material. #153431 I still need to add a unit test but verified that this works just need to add it as unit test. ``` import torch from torch.export import Dim, export class MyModel(torch.nn.Module): def forward(self, x, ranks): first_k = ranks.max().item() torch._check_is_size(first_k) narrow = x.narrow(dim = 1, start = 0, length = first_k) lt = narrow < narrow.size(1) return lt inps = ( torch.randn((8, 16), device="cuda"), torch.arange(8, device="cuda", dtype=torch.int8) ) spec = { "x": (Dim.AUTO, Dim.AUTO), "ranks": (Dim.AUTO,), } traced = export(MyModel(), inps, dynamic_shapes=spec, strict=True).run_decompositions({}) ``` [ghstack-poisoned]
2 parents 08cc48a + 8ac82a1 commit 3481961

File tree

469 files changed

+17439
-9654
lines changed

Some content is hidden

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

469 files changed

+17439
-9654
lines changed

.ci/docker/build.sh

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ elif [[ "$image" == *linter* ]]; then
8585
DOCKERFILE="linter/Dockerfile"
8686
fi
8787

88-
# CMake 3.18 is needed to support CUDA17 language variant
89-
CMAKE_VERSION=3.18.5
90-
9188
_UCX_COMMIT=7bb2722ff2187a0cad557ae4a6afa090569f83fb
9289
_UCC_COMMIT=20eae37090a4ce1b32bcce6144ccad0b49943e0b
9390
if [[ "$image" == *rocm* ]]; then
@@ -110,7 +107,6 @@ case "$tag" in
110107
KATEX=yes
111108
UCX_COMMIT=${_UCX_COMMIT}
112109
UCC_COMMIT=${_UCC_COMMIT}
113-
CONDA_CMAKE=yes
114110
TRITON=yes
115111
;;
116112
pytorch-linux-focal-cuda12.4-cudnn9-py3-gcc9-inductor-benchmarks)
@@ -122,7 +118,6 @@ case "$tag" in
122118
KATEX=yes
123119
UCX_COMMIT=${_UCX_COMMIT}
124120
UCC_COMMIT=${_UCC_COMMIT}
125-
CONDA_CMAKE=yes
126121
TRITON=yes
127122
INDUCTOR_BENCHMARKS=yes
128123
;;
@@ -135,7 +130,6 @@ case "$tag" in
135130
KATEX=yes
136131
UCX_COMMIT=${_UCX_COMMIT}
137132
UCC_COMMIT=${_UCC_COMMIT}
138-
CONDA_CMAKE=yes
139133
TRITON=yes
140134
INDUCTOR_BENCHMARKS=yes
141135
;;
@@ -148,7 +142,6 @@ case "$tag" in
148142
KATEX=yes
149143
UCX_COMMIT=${_UCX_COMMIT}
150144
UCC_COMMIT=${_UCC_COMMIT}
151-
CONDA_CMAKE=yes
152145
TRITON=yes
153146
INDUCTOR_BENCHMARKS=yes
154147
;;
@@ -161,7 +154,6 @@ case "$tag" in
161154
KATEX=yes
162155
UCX_COMMIT=${_UCX_COMMIT}
163156
UCC_COMMIT=${_UCC_COMMIT}
164-
CONDA_CMAKE=yes
165157
TRITON=yes
166158
;;
167159
pytorch-linux-focal-cuda12.6-cudnn9-py3-gcc9-inductor-benchmarks)
@@ -173,7 +165,6 @@ case "$tag" in
173165
KATEX=yes
174166
UCX_COMMIT=${_UCX_COMMIT}
175167
UCC_COMMIT=${_UCC_COMMIT}
176-
CONDA_CMAKE=yes
177168
TRITON=yes
178169
INDUCTOR_BENCHMARKS=yes
179170
;;
@@ -186,7 +177,6 @@ case "$tag" in
186177
KATEX=yes
187178
UCX_COMMIT=${_UCX_COMMIT}
188179
UCC_COMMIT=${_UCC_COMMIT}
189-
CONDA_CMAKE=yes
190180
TRITON=yes
191181
INDUCTOR_BENCHMARKS=yes
192182
;;
@@ -199,7 +189,6 @@ case "$tag" in
199189
KATEX=yes
200190
UCX_COMMIT=${_UCX_COMMIT}
201191
UCC_COMMIT=${_UCC_COMMIT}
202-
CONDA_CMAKE=yes
203192
TRITON=yes
204193
INDUCTOR_BENCHMARKS=yes
205194
;;
@@ -212,57 +201,50 @@ case "$tag" in
212201
KATEX=yes
213202
UCX_COMMIT=${_UCX_COMMIT}
214203
UCC_COMMIT=${_UCC_COMMIT}
215-
CONDA_CMAKE=yes
216204
TRITON=yes
217205
;;
218206
pytorch-linux-focal-py3-clang10-onnx)
219207
ANACONDA_PYTHON_VERSION=3.9
220208
CLANG_VERSION=10
221209
VISION=yes
222-
CONDA_CMAKE=yes
223210
ONNX=yes
224211
;;
225212
pytorch-linux-focal-py3.9-clang10)
226213
ANACONDA_PYTHON_VERSION=3.9
227214
CLANG_VERSION=10
228215
VISION=yes
229-
CONDA_CMAKE=yes
230216
TRITON=yes
231217
;;
232218
pytorch-linux-focal-py3.11-clang10)
233219
ANACONDA_PYTHON_VERSION=3.11
234220
CLANG_VERSION=10
235221
VISION=yes
236-
CONDA_CMAKE=yes
237222
TRITON=yes
238223
;;
239224
pytorch-linux-focal-py3.9-gcc9)
240225
ANACONDA_PYTHON_VERSION=3.9
241226
GCC_VERSION=9
242227
VISION=yes
243-
CONDA_CMAKE=yes
244228
TRITON=yes
245229
;;
246-
pytorch-linux-focal-rocm-n-1-py3)
230+
pytorch-linux-jammy-rocm-n-1-py3)
247231
ANACONDA_PYTHON_VERSION=3.10
248232
GCC_VERSION=11
249233
VISION=yes
250-
ROCM_VERSION=6.2.4
234+
ROCM_VERSION=6.3
251235
NINJA_VERSION=1.9.0
252-
CONDA_CMAKE=yes
253236
TRITON=yes
254237
KATEX=yes
255238
UCX_COMMIT=${_UCX_COMMIT}
256239
UCC_COMMIT=${_UCC_COMMIT}
257240
INDUCTOR_BENCHMARKS=yes
258241
;;
259-
pytorch-linux-focal-rocm-n-py3)
242+
pytorch-linux-jammy-rocm-n-py3)
260243
ANACONDA_PYTHON_VERSION=3.10
261244
GCC_VERSION=11
262245
VISION=yes
263-
ROCM_VERSION=6.3
246+
ROCM_VERSION=6.4
264247
NINJA_VERSION=1.9.0
265-
CONDA_CMAKE=yes
266248
TRITON=yes
267249
KATEX=yes
268250
UCX_COMMIT=${_UCX_COMMIT}
@@ -275,7 +257,6 @@ case "$tag" in
275257
VISION=yes
276258
XPU_VERSION=0.5
277259
NINJA_VERSION=1.9.0
278-
CONDA_CMAKE=yes
279260
TRITON=yes
280261
;;
281262
pytorch-linux-jammy-xpu-2025.0-py3)
@@ -284,15 +265,13 @@ case "$tag" in
284265
VISION=yes
285266
XPU_VERSION=2025.0
286267
NINJA_VERSION=1.9.0
287-
CONDA_CMAKE=yes
288268
TRITON=yes
289269
;;
290270
pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks)
291271
ANACONDA_PYTHON_VERSION=3.9
292272
GCC_VERSION=11
293273
VISION=yes
294274
KATEX=yes
295-
CONDA_CMAKE=yes
296275
TRITON=yes
297276
DOCS=yes
298277
INDUCTOR_BENCHMARKS=yes
@@ -309,70 +288,60 @@ case "$tag" in
309288
ANACONDA_PYTHON_VERSION=3.9
310289
CLANG_VERSION=12
311290
VISION=yes
312-
CONDA_CMAKE=yes
313291
TRITON=yes
314292
;;
315293
pytorch-linux-jammy-py3-clang15-asan)
316294
ANACONDA_PYTHON_VERSION=3.10
317295
CLANG_VERSION=15
318-
CONDA_CMAKE=yes
319296
VISION=yes
320297
;;
321298
pytorch-linux-jammy-py3-clang18-asan)
322299
ANACONDA_PYTHON_VERSION=3.10
323300
CLANG_VERSION=18
324-
CONDA_CMAKE=yes
325301
VISION=yes
326302
;;
327303
pytorch-linux-jammy-py3.9-gcc11)
328304
ANACONDA_PYTHON_VERSION=3.9
329305
GCC_VERSION=11
330306
VISION=yes
331307
KATEX=yes
332-
CONDA_CMAKE=yes
333308
TRITON=yes
334309
DOCS=yes
335310
UNINSTALL_DILL=yes
336311
;;
337312
pytorch-linux-jammy-py3-clang12-executorch)
338313
ANACONDA_PYTHON_VERSION=3.10
339314
CLANG_VERSION=12
340-
CONDA_CMAKE=yes
341315
EXECUTORCH=yes
342316
;;
343317
pytorch-linux-jammy-py3.12-halide)
344318
CUDA_VERSION=12.6
345319
ANACONDA_PYTHON_VERSION=3.12
346320
GCC_VERSION=11
347-
CONDA_CMAKE=yes
348321
HALIDE=yes
349322
TRITON=yes
350323
;;
351324
pytorch-linux-jammy-py3.12-triton-cpu)
352325
CUDA_VERSION=12.6
353326
ANACONDA_PYTHON_VERSION=3.12
354327
GCC_VERSION=11
355-
CONDA_CMAKE=yes
356328
TRITON_CPU=yes
357329
;;
358330
pytorch-linux-focal-linter)
359331
# TODO: Use 3.9 here because of this issue https://github.com/python/mypy/issues/13627.
360332
# We will need to update mypy version eventually, but that's for another day. The task
361333
# would be to upgrade mypy to 1.0.0 with Python 3.11
362334
PYTHON_VERSION=3.9
363-
PIP_CMAKE=yes
364335
;;
365336
pytorch-linux-jammy-cuda11.8-cudnn9-py3.9-linter)
366337
PYTHON_VERSION=3.9
367338
CUDA_VERSION=11.8
368-
PIP_CMAKE=yes
369339
;;
370340
pytorch-linux-jammy-aarch64-py3.10-gcc11)
371341
ANACONDA_PYTHON_VERSION=3.10
372342
GCC_VERSION=11
373343
ACL=yes
374344
VISION=yes
375-
CONDA_CMAKE=yes
376345
# snadampal: skipping llvm src build install because the current version
377346
# from pytorch/llvm:9.0.1 is x86 specific
378347
SKIP_LLVM_SRC_BUILD_INSTALL=yes
@@ -382,7 +351,6 @@ case "$tag" in
382351
GCC_VERSION=11
383352
ACL=yes
384353
VISION=yes
385-
CONDA_CMAKE=yes
386354
# snadampal: skipping llvm src build install because the current version
387355
# from pytorch/llvm:9.0.1 is x86 specific
388356
SKIP_LLVM_SRC_BUILD_INSTALL=yes
@@ -405,8 +373,7 @@ case "$tag" in
405373
TRITON=yes
406374
# To ensure that any ROCm config will build using conda cmake
407375
# and thus have LAPACK/MKL enabled
408-
CONDA_CMAKE=yes
409-
fi
376+
fi
410377
if [[ "$image" == *centos7* ]]; then
411378
NINJA_VERSION=1.10.2
412379
fi
@@ -422,9 +389,6 @@ case "$tag" in
422389
if [[ "$image" == *glibc* ]]; then
423390
extract_version_from_image_name glibc GLIBC_VERSION
424391
fi
425-
if [[ "$image" == *cmake* ]]; then
426-
extract_version_from_image_name cmake CMAKE_VERSION
427-
fi
428392
;;
429393
esac
430394

@@ -465,16 +429,13 @@ docker build \
465429
--build-arg "CUDNN_VERSION=${CUDNN_VERSION}" \
466430
--build-arg "TENSORRT_VERSION=${TENSORRT_VERSION}" \
467431
--build-arg "GRADLE_VERSION=${GRADLE_VERSION}" \
468-
--build-arg "CMAKE_VERSION=${CMAKE_VERSION:-}" \
469432
--build-arg "NINJA_VERSION=${NINJA_VERSION:-}" \
470433
--build-arg "KATEX=${KATEX:-}" \
471434
--build-arg "ROCM_VERSION=${ROCM_VERSION:-}" \
472435
--build-arg "PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH:-gfx90a;gfx942}" \
473436
--build-arg "IMAGE_NAME=${IMAGE_NAME}" \
474437
--build-arg "UCX_COMMIT=${UCX_COMMIT}" \
475438
--build-arg "UCC_COMMIT=${UCC_COMMIT}" \
476-
--build-arg "CONDA_CMAKE=${CONDA_CMAKE}" \
477-
--build-arg "PIP_CMAKE=${PIP_CMAKE}" \
478439
--build-arg "TRITON=${TRITON}" \
479440
--build-arg "TRITON_CPU=${TRITON_CPU}" \
480441
--build-arg "ONNX=${ONNX}" \
@@ -560,3 +521,12 @@ elif [ "$HAS_TRITON" = "yes" ]; then
560521
echo "expecting triton to not be installed, but it is"
561522
exit 1
562523
fi
524+
525+
# Sanity check cmake version. Executorch reinstalls cmake and I'm not sure if
526+
# they support 4.0.0 yet, so exclude them from this check.
527+
CMAKE_VERSION=$(drun cmake --version)
528+
if [[ "$EXECUTORCH" != *yes* && "$CMAKE_VERSION" != *4.* ]]; then
529+
echo "CMake version is not 4.0.0:"
530+
drun cmake --version
531+
exit 1
532+
fi

.ci/docker/centos-rocm/Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ RUN bash ./install_user.sh && rm install_user.sh
4040

4141
# Install conda and other packages (e.g., numpy, pytest)
4242
ARG ANACONDA_PYTHON_VERSION
43-
ARG CONDA_CMAKE
4443
ENV ANACONDA_PYTHON_VERSION=$ANACONDA_PYTHON_VERSION
4544
ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH
4645
COPY requirements-ci.txt /opt/conda/requirements-ci.txt
@@ -75,12 +74,6 @@ ENV MAGMA_HOME /opt/rocm/magma
7574
ENV LANG en_US.utf8
7675
ENV LC_ALL en_US.utf8
7776

78-
# (optional) Install non-default CMake version
79-
ARG CMAKE_VERSION
80-
COPY ./common/install_cmake.sh install_cmake.sh
81-
RUN if [ -n "${CMAKE_VERSION}" ]; then bash ./install_cmake.sh; fi
82-
RUN rm install_cmake.sh
83-
8477
# (optional) Install non-default Ninja version
8578
ARG NINJA_VERSION
8679
COPY ./common/install_ninja.sh install_ninja.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a325c56864c5b25630c1ebda03c8f16a96a02a19
1+
b173722085b3f555d6ba4533d6bbaddfd7c71144

.ci/docker/common/install_cmake.sh

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

.ci/docker/common/install_conda.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
7575
# and libpython-static for torch deploy
7676
conda_install llvmdev=8.0.0 "libpython-static=${ANACONDA_PYTHON_VERSION}"
7777

78-
# Use conda cmake in some cases. Conda cmake will be newer than our supported
79-
# min version (3.5 for xenial and 3.10 for bionic), so we only do it in those
80-
# following builds that we know should use conda. Specifically, Ubuntu bionic
81-
# and focal cannot find conda mkl with stock cmake, so we need a cmake from conda
82-
if [ -n "${CONDA_CMAKE}" ]; then
83-
conda_install cmake
84-
fi
85-
8678
# Magma package names are concatenation of CUDA major and minor ignoring revision
8779
# I.e. magma-cuda102 package corresponds to CUDA_VERSION=10.2 and CUDA_VERSION=10.2.89
8880
# Magma is installed from a tarball in the ossci-linux bucket into the conda env

.ci/docker/common/install_executorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ clone_executorch() {
1313
# and fetch the target commit
1414
pushd executorch
1515
git checkout "${EXECUTORCH_PINNED_COMMIT}"
16-
git submodule update --init
16+
git submodule update --init --recursive
1717
popd
1818

1919
chown -R jenkins executorch

.ci/docker/common/install_halide.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ -n "${UBUNTU_VERSION}" ];then
1717
libopenblas-dev libeigen3-dev libatlas-base-dev libzstd-dev
1818
fi
1919

20-
conda_install numpy scipy imageio cmake ninja
20+
pip_install numpy scipy imageio cmake ninja
2121

2222
git clone --depth 1 --branch release/16.x --recursive https://github.com/llvm/llvm-project.git
2323
cmake -DCMAKE_BUILD_TYPE=Release \

.ci/docker/common/install_inductor_benchmark_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function install_timm() {
1616

1717
pip_install "git+https://github.com/huggingface/pytorch-image-models@${commit}"
1818
# Clean up
19-
conda_run pip uninstall -y cmake torch torchvision triton
19+
conda_run pip uninstall -y torch torchvision triton
2020
}
2121

2222
# Pango is needed for weasyprint which is needed for doctr

.ci/docker/common/install_python.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ source /var/lib/jenkins/ci_env/bin/activate
1313

1414
python -mpip install --upgrade pip
1515
python -mpip install -r /opt/requirements-ci.txt
16-
if [ -n "${PIP_CMAKE}" ]; then
17-
python -mpip install cmake==3.31.6
18-
fi

0 commit comments

Comments
 (0)
0