mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-10-31 04:04:57 +08:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
			flex-flash
			...
			cublasltre
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 418d795d5f | |||
| 889394a39f | |||
| fbea61ca3c | |||
| cc0bd27f20 | |||
| 5886350d48 | |||
| b4277ce1dc | |||
| 10aabb25e4 | |||
| d96b0e7781 | 
							
								
								
									
										2
									
								
								.bazelrc
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.bazelrc
									
									
									
									
									
								
							| @ -2,7 +2,7 @@ build --cxxopt=--std=c++17 | ||||
| build --copt=-I. | ||||
| # Bazel does not support including its cc_library targets as system | ||||
| # headers. We work around this for generated code | ||||
| # (e.g. torch/headeronly/macros/cmake_macros.h) by making the generated directory a | ||||
| # (e.g. c10/macros/cmake_macros.h) by making the generated directory a | ||||
| # system include path. | ||||
| build --copt=-isystem --copt bazel-out/k8-fastbuild/bin | ||||
| build --copt=-isystem --copt bazel-out/darwin-fastbuild/bin | ||||
|  | ||||
| @ -3,8 +3,10 @@ set -eux -o pipefail | ||||
|  | ||||
| GPU_ARCH_VERSION=${GPU_ARCH_VERSION:-} | ||||
|  | ||||
| if [[ "$GPU_ARCH_VERSION" == *"12.9"* ]]; then | ||||
|     export TORCH_CUDA_ARCH_LIST="8.0;9.0;10.0;12.0" | ||||
| if [[ "$GPU_ARCH_VERSION" == *"12.6"* ]]; then | ||||
|     export TORCH_CUDA_ARCH_LIST="9.0" | ||||
| elif [[ "$GPU_ARCH_VERSION" == *"12.8"* ]]; then | ||||
|     export TORCH_CUDA_ARCH_LIST="9.0;10.0;12.0" | ||||
| fi | ||||
|  | ||||
| SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||||
|  | ||||
| @ -79,7 +79,6 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None: | ||||
|     os.system(f"unzip {wheel_path} -d {folder}/tmp") | ||||
|     libs_to_copy = [ | ||||
|         "/usr/local/cuda/extras/CUPTI/lib64/libcupti.so.12", | ||||
|         "/usr/local/cuda/extras/CUPTI/lib64/libnvperf_host.so", | ||||
|         "/usr/local/cuda/lib64/libcudnn.so.9", | ||||
|         "/usr/local/cuda/lib64/libcublas.so.12", | ||||
|         "/usr/local/cuda/lib64/libcublasLt.so.12", | ||||
| @ -89,7 +88,7 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None: | ||||
|         "/usr/local/cuda/lib64/libcusparseLt.so.0", | ||||
|         "/usr/local/cuda/lib64/libcusolver.so.11", | ||||
|         "/usr/local/cuda/lib64/libcurand.so.10", | ||||
|         "/usr/local/cuda/lib64/libnccl.so.2", | ||||
|         "/usr/local/cuda/lib64/libnvToolsExt.so.1", | ||||
|         "/usr/local/cuda/lib64/libnvJitLink.so.12", | ||||
|         "/usr/local/cuda/lib64/libnvrtc.so.12", | ||||
|         "/usr/local/cuda/lib64/libcudnn_adv.so.9", | ||||
| @ -109,9 +108,9 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None: | ||||
|         "/usr/local/lib/libnvpl_blas_core.so.0", | ||||
|     ] | ||||
|  | ||||
|     if "129" in desired_cuda: | ||||
|     if "128" in desired_cuda: | ||||
|         libs_to_copy += [ | ||||
|             "/usr/local/cuda/lib64/libnvrtc-builtins.so.12.9", | ||||
|             "/usr/local/cuda/lib64/libnvrtc-builtins.so.12.8", | ||||
|             "/usr/local/cuda/lib64/libcufile.so.0", | ||||
|             "/usr/local/cuda/lib64/libcufile_rdma.so.1", | ||||
|         ] | ||||
|  | ||||
| @ -5,7 +5,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/common.sh" | ||||
|  | ||||
| if [[ ${BUILD_ENVIRONMENT} == *onnx* ]]; then | ||||
|   pip install click mock tabulate networkx==2.0 | ||||
|   pip -q install "file:///var/lib/jenkins/workspace/third_party/onnx#egg=onnx" | ||||
|   pip -q install --user "file:///var/lib/jenkins/workspace/third_party/onnx#egg=onnx" | ||||
| fi | ||||
|  | ||||
| # Skip tests in environments where they are not built/applicable | ||||
| @ -147,8 +147,8 @@ export DNNL_MAX_CPU_ISA=AVX2 | ||||
| if [[ "${SHARD_NUMBER:-1}" == "1" ]]; then | ||||
|   # TODO(sdym@meta.com) remove this when the linked issue resolved. | ||||
|   # py is temporary until https://github.com/Teemu/pytest-sugar/issues/241 is fixed | ||||
|   pip install py==1.11.0 | ||||
|   pip install pytest-sugar | ||||
|   pip install --user py==1.11.0 | ||||
|   pip install --user pytest-sugar | ||||
|   # NB: Warnings are disabled because they make it harder to see what | ||||
|   # the actual erroring test is | ||||
|   "$PYTHON" \ | ||||
|  | ||||
| @ -36,104 +36,3 @@ See `build.sh` for valid build environments (it's the giant switch). | ||||
| # Set flags (see build.sh) and build image | ||||
| sudo bash -c 'TRITON=1 ./build.sh pytorch-linux-bionic-py3.8-gcc9 -t myimage:latest | ||||
| ``` | ||||
|  | ||||
| ## [Guidance] Adding a New Base Docker Image | ||||
|  | ||||
| ### Background | ||||
|  | ||||
| The base Docker images in directory `.ci/docker/` are built by the `docker-builds.yml` workflow. Those images are used throughout the PyTorch CI/CD pipeline. You should only create or modify a base Docker image if you need specific environment changes or dependencies before building PyTorch on CI. | ||||
|  | ||||
| 1. **Automatic Rebuilding**: | ||||
|    - The Docker image building process is triggered automatically when changes are made to files in the `.ci/docker/*` directory | ||||
|    - This ensures all images stay up-to-date with the latest dependencies and configurations | ||||
|  | ||||
| 2. **Image Reuse in PyTorch Build Workflows** (example: linux-build): | ||||
|    - The images generated by `docker-builds.yml` are reused in `_linux-build.yml` through the `calculate-docker-image` step | ||||
|    - The `_linux-build.yml` workflow: | ||||
|      - Pulls the Docker image determined by the `calculate-docker-image` step | ||||
|      - Runs a Docker container with that image | ||||
|      - Executes `.ci/pytorch/build.sh` inside the container to build PyTorch | ||||
|  | ||||
| 3. **Usage in Test Workflows** (example: linux-test): | ||||
|    - The same Docker images are also used in `_linux-test.yml` for running tests | ||||
|    - The `_linux-test.yml` workflow follows a similar pattern: | ||||
|      - It uses the `calculate-docker-image` step to determine which Docker image to use | ||||
|      - It pulls the Docker image and runs a container with that image | ||||
|      - It installs the wheels from the artifacts generated by PyTorch build jobs | ||||
|      - It executes test scripts (like `.ci/pytorch/test.sh` or `.ci/pytorch/multigpu-test.sh`) inside the container | ||||
|  | ||||
| ### Understanding File Purposes | ||||
|  | ||||
| #### `.ci/docker/build.sh` vs `.ci/pytorch/build.sh` | ||||
| - **`.ci/docker/build.sh`**: | ||||
|   - Used for building base Docker images | ||||
|   - Executed by the `docker-builds.yml` workflow to pre-build Docker images for CI | ||||
|   - Contains configurations for different Docker build environments | ||||
|  | ||||
| - **`.ci/pytorch/build.sh`**: | ||||
|   - Used for building PyTorch inside a Docker container | ||||
|   - Called by workflows like `_linux-build.yml` after the Docker container is started | ||||
|   - Builds PyTorch wheels and other artifacts | ||||
|  | ||||
| #### `.ci/docker/ci_commit_pins/` vs `.github/ci_commit_pins` | ||||
| - **`.ci/docker/ci_commit_pins/`**: | ||||
|   - Used for pinning dependency versions during base Docker image building | ||||
|   - Ensures consistent environments for building PyTorch | ||||
|   - Changes here trigger base Docker image rebuilds | ||||
|  | ||||
| - **`.github/ci_commit_pins`**: | ||||
|   - Used for pinning dependency versions during PyTorch building and tests | ||||
|   - Ensures consistent dependencies for PyTorch across different builds | ||||
|   - Used by build scripts running inside Docker containers | ||||
|  | ||||
| ### Step-by-Step Guide for Adding a New Base Docker Image | ||||
|  | ||||
| #### 1. Add Pinned Commits (If Applicable) | ||||
|  | ||||
| We use pinned commits for build stability. The `nightly.yml` workflow checks and updates pinned commits for certain repository dependencies daily. | ||||
|  | ||||
| If your new Docker image needs a library installed from a specific pinned commit or built from source: | ||||
|  | ||||
| 1. Add the repository you want to track in `nightly.yml` and `merge-rules.yml` | ||||
| 2. Add the initial pinned commit in `.ci/docker/ci_commit_pins/`. The text filename should match the one defined in step 1 | ||||
|  | ||||
| #### 2. Configure the Base Docker Image | ||||
| 1. **Add new Base Docker image configuration** (if applicable): | ||||
|  | ||||
|    Add the configuration in `.ci/docker/build.sh`. For example: | ||||
|    ```bash | ||||
|    pytorch-linux-jammy-cuda12.8-cudnn9-py3.12-gcc11-new1) | ||||
|      CUDA_VERSION=12.8.1 | ||||
|      ANACONDA_PYTHON_VERSION=3.12 | ||||
|      GCC_VERSION=11 | ||||
|      VISION=yes | ||||
|      KATEX=yes | ||||
|      UCX_COMMIT=${_UCX_COMMIT} | ||||
|      UCC_COMMIT=${_UCC_COMMIT} | ||||
|      TRITON=yes | ||||
|      NEW_ARG_1=yes | ||||
|      ;; | ||||
|    ``` | ||||
|  | ||||
| 2. **Add build arguments to Docker build command**: | ||||
|  | ||||
|    If you're introducing a new argument to the Docker build, make sure to add it in the Docker build step in `.ci/docker/build.sh`: | ||||
|    ```bash | ||||
|    docker build \ | ||||
|       .... | ||||
|       --build-arg "NEW_ARG_1=${NEW_ARG_1}" | ||||
|    ``` | ||||
|  | ||||
| 3. **Update Dockerfile logic**: | ||||
|  | ||||
|    Update the Dockerfile to use the new argument. For example, in `ubuntu/Dockerfile`: | ||||
|    ```dockerfile | ||||
|    ARG NEW_ARG_1 | ||||
|    # Set up environment for NEW_ARG_1 | ||||
|    RUN if [ -n "${NEW_ARG_1}" ]; then bash ./do_something.sh; fi | ||||
|    ``` | ||||
|  | ||||
| 4. **Add the Docker configuration** in `.github/workflows/docker-builds.yml`: | ||||
|  | ||||
|    The `docker-builds.yml` workflow pre-builds the Docker images whenever changes occur in the `.ci/docker/` directory. This includes the | ||||
|    pinned commit updates. | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| ARG CUDA_VERSION=12.6 | ||||
| ARG CUDA_VERSION=12.4 | ||||
| ARG BASE_TARGET=cuda${CUDA_VERSION} | ||||
| ARG ROCM_IMAGE=rocm/dev-almalinux-8:6.3-complete | ||||
| FROM amd64/almalinux:8.10-20250519 as base | ||||
| @ -52,6 +52,10 @@ ENV CUDA_VERSION=${CUDA_VERSION} | ||||
| # Make things in our path by default | ||||
| ENV PATH=/usr/local/cuda-${CUDA_VERSION}/bin:$PATH | ||||
|  | ||||
| FROM cuda as cuda11.8 | ||||
| RUN bash ./install_cuda.sh 11.8 | ||||
| ENV DESIRED_CUDA=11.8 | ||||
|  | ||||
| FROM cuda as cuda12.6 | ||||
| RUN bash ./install_cuda.sh 12.6 | ||||
| ENV DESIRED_CUDA=12.6 | ||||
| @ -60,10 +64,6 @@ FROM cuda as cuda12.8 | ||||
| RUN bash ./install_cuda.sh 12.8 | ||||
| ENV DESIRED_CUDA=12.8 | ||||
|  | ||||
| FROM cuda as cuda12.9 | ||||
| RUN bash ./install_cuda.sh 12.9 | ||||
| ENV DESIRED_CUDA=12.9 | ||||
|  | ||||
| FROM ${ROCM_IMAGE} as rocm | ||||
| ENV PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" | ||||
| ADD ./common/install_mkl.sh install_mkl.sh | ||||
| @ -79,7 +79,6 @@ FROM base as all_cuda | ||||
| COPY --from=cuda11.8  /usr/local/cuda-11.8 /usr/local/cuda-11.8 | ||||
| COPY --from=cuda12.6  /usr/local/cuda-12.6 /usr/local/cuda-12.6 | ||||
| COPY --from=cuda12.8  /usr/local/cuda-12.8 /usr/local/cuda-12.8 | ||||
| COPY --from=cuda12.9  /usr/local/cuda-12.9 /usr/local/cuda-12.9 | ||||
|  | ||||
| # Final step | ||||
| FROM ${BASE_TARGET} as final | ||||
|  | ||||
| @ -52,8 +52,6 @@ fi | ||||
|  | ||||
| if [[ "$image" == *-jammy* ]]; then | ||||
|   UBUNTU_VERSION=22.04 | ||||
| elif [[ "$image" == *-noble* ]]; then | ||||
|   UBUNTU_VERSION=24.04 | ||||
| elif [[ "$image" == *ubuntu* ]]; then | ||||
|   extract_version_from_image_name ubuntu UBUNTU_VERSION | ||||
| fi | ||||
| @ -91,18 +89,9 @@ tag=$(echo $image | awk -F':' '{print $2}') | ||||
| # configuration, so we hardcode everything here rather than do it | ||||
| # from scratch | ||||
| case "$tag" in | ||||
|   pytorch-linux-jammy-cuda12.4-cudnn9-py3-gcc11) | ||||
|     CUDA_VERSION=12.4 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
|     KATEX=yes | ||||
|     UCX_COMMIT=${_UCX_COMMIT} | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3-gcc11) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|   pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc11) | ||||
|     CUDA_VERSION=12.6.3 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
| @ -113,6 +102,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -124,6 +114,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3.12-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.12 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -135,6 +126,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3.13-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.13 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -146,6 +138,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc9) | ||||
|     CUDA_VERSION=12.6.3 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -154,18 +147,9 @@ case "$tag" in | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3.12-gcc11-vllm) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     ANACONDA_PYTHON_VERSION=3.12 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
|     KATEX=yes | ||||
|     UCX_COMMIT=${_UCX_COMMIT} | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.6 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -177,6 +161,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.6-cudnn9-py3.12-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.6 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.12 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -188,6 +173,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.6-cudnn9-py3.13-gcc9-inductor-benchmarks) | ||||
|     CUDA_VERSION=12.6 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.13 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -199,6 +185,7 @@ case "$tag" in | ||||
|     ;; | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3-gcc9) | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     CUDNN_VERSION=9 | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=9 | ||||
|     VISION=yes | ||||
| @ -231,12 +218,20 @@ case "$tag" in | ||||
|     VISION=yes | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-rocm-n-py3 | pytorch-linux-noble-rocm-n-py3) | ||||
|     if [[ $tag =~ "jammy" ]]; then | ||||
|       ANACONDA_PYTHON_VERSION=3.10 | ||||
|     else | ||||
|       ANACONDA_PYTHON_VERSION=3.12 | ||||
|     fi | ||||
|   pytorch-linux-jammy-rocm-n-1-py3) | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
|     ROCM_VERSION=6.3 | ||||
|     NINJA_VERSION=1.9.0 | ||||
|     TRITON=yes | ||||
|     KATEX=yes | ||||
|     UCX_COMMIT=${_UCX_COMMIT} | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     INDUCTOR_BENCHMARKS=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-rocm-n-py3) | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
|     ROCM_VERSION=6.4 | ||||
| @ -247,19 +242,6 @@ case "$tag" in | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     INDUCTOR_BENCHMARKS=yes | ||||
|     ;; | ||||
|   pytorch-linux-noble-rocm-alpha-py3) | ||||
|     ANACONDA_PYTHON_VERSION=3.12 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
|     ROCM_VERSION=7.0 | ||||
|     NINJA_VERSION=1.9.0 | ||||
|     TRITON=yes | ||||
|     KATEX=yes | ||||
|     UCX_COMMIT=${_UCX_COMMIT} | ||||
|     UCC_COMMIT=${_UCC_COMMIT} | ||||
|     INDUCTOR_BENCHMARKS=yes | ||||
|     PYTORCH_ROCM_ARCH="gfx90a;gfx942;gfx950" | ||||
|     ;; | ||||
|   pytorch-linux-jammy-xpu-2025.0-py3) | ||||
|     ANACONDA_PYTHON_VERSION=3.9 | ||||
|     GCC_VERSION=11 | ||||
| @ -276,7 +258,7 @@ case "$tag" in | ||||
|     NINJA_VERSION=1.9.0 | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks) | ||||
|     pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks) | ||||
|     ANACONDA_PYTHON_VERSION=3.9 | ||||
|     GCC_VERSION=11 | ||||
|     VISION=yes | ||||
| @ -288,10 +270,22 @@ case "$tag" in | ||||
|   pytorch-linux-jammy-cuda12.8-cudnn9-py3.9-clang12) | ||||
|     ANACONDA_PYTHON_VERSION=3.9 | ||||
|     CUDA_VERSION=12.8.1 | ||||
|     CUDNN_VERSION=9 | ||||
|     CLANG_VERSION=12 | ||||
|     VISION=yes | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-py3-clang12-asan) | ||||
|     ANACONDA_PYTHON_VERSION=3.9 | ||||
|     CLANG_VERSION=12 | ||||
|     VISION=yes | ||||
|     TRITON=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-py3-clang15-asan) | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     CLANG_VERSION=15 | ||||
|     VISION=yes | ||||
|     ;; | ||||
|   pytorch-linux-jammy-py3-clang18-asan) | ||||
|     ANACONDA_PYTHON_VERSION=3.10 | ||||
|     CLANG_VERSION=18 | ||||
| @ -339,8 +333,6 @@ case "$tag" in | ||||
|     GCC_VERSION=11 | ||||
|     ACL=yes | ||||
|     VISION=yes | ||||
|     CONDA_CMAKE=yes | ||||
|     OPENBLAS=yes | ||||
|     # snadampal: skipping llvm src build install because the current version | ||||
|     # from pytorch/llvm:9.0.1 is x86 specific | ||||
|     SKIP_LLVM_SRC_BUILD_INSTALL=yes | ||||
| @ -350,8 +342,6 @@ case "$tag" in | ||||
|     GCC_VERSION=11 | ||||
|     ACL=yes | ||||
|     VISION=yes | ||||
|     CONDA_CMAKE=yes | ||||
|     OPENBLAS=yes | ||||
|     # snadampal: skipping llvm src build install because the current version | ||||
|     # from pytorch/llvm:9.0.1 is x86 specific | ||||
|     SKIP_LLVM_SRC_BUILD_INSTALL=yes | ||||
| @ -366,6 +356,7 @@ case "$tag" in | ||||
|     fi | ||||
|     if [[ "$image" == *cuda* ]]; then | ||||
|       extract_version_from_image_name cuda CUDA_VERSION | ||||
|       extract_version_from_image_name cudnn CUDNN_VERSION | ||||
|     fi | ||||
|     if [[ "$image" == *rocm* ]]; then | ||||
|       extract_version_from_image_name rocm ROCM_VERSION | ||||
| @ -417,6 +408,9 @@ docker build \ | ||||
|        --build-arg "PYTHON_VERSION=${PYTHON_VERSION}" \ | ||||
|        --build-arg "GCC_VERSION=${GCC_VERSION}" \ | ||||
|        --build-arg "CUDA_VERSION=${CUDA_VERSION}" \ | ||||
|        --build-arg "CUDNN_VERSION=${CUDNN_VERSION}" \ | ||||
|        --build-arg "TENSORRT_VERSION=${TENSORRT_VERSION}" \ | ||||
|        --build-arg "GRADLE_VERSION=${GRADLE_VERSION}" \ | ||||
|        --build-arg "NINJA_VERSION=${NINJA_VERSION:-}" \ | ||||
|        --build-arg "KATEX=${KATEX:-}" \ | ||||
|        --build-arg "ROCM_VERSION=${ROCM_VERSION:-}" \ | ||||
| @ -434,7 +428,6 @@ docker build \ | ||||
|        --build-arg "XPU_VERSION=${XPU_VERSION}" \ | ||||
|        --build-arg "UNINSTALL_DILL=${UNINSTALL_DILL}" \ | ||||
|        --build-arg "ACL=${ACL:-}" \ | ||||
|        --build-arg "OPENBLAS=${OPENBLAS:-}" \ | ||||
|        --build-arg "SKIP_SCCACHE_INSTALL=${SKIP_SCCACHE_INSTALL:-}" \ | ||||
|        --build-arg "SKIP_LLVM_SRC_BUILD_INSTALL=${SKIP_LLVM_SRC_BUILD_INSTALL:-}" \ | ||||
|        -f $(dirname ${DOCKERFILE})/Dockerfile \ | ||||
|  | ||||
| @ -39,7 +39,6 @@ RUN bash ./install_user.sh && rm install_user.sh | ||||
|  | ||||
| # Install conda and other packages (e.g., numpy, pytest) | ||||
| ARG ANACONDA_PYTHON_VERSION | ||||
| ARG BUILD_ENVIRONMENT | ||||
| ENV ANACONDA_PYTHON_VERSION=$ANACONDA_PYTHON_VERSION | ||||
| ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH | ||||
| COPY requirements-ci.txt /opt/conda/requirements-ci.txt | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 56392aa978594cc155fa8af48cd949f5b5f1823a | ||||
| f50bfa92602b45dca884a9e511e5d9ddbe8ba314 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| v2.27.5-1 | ||||
| v2.26.5-1 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| ae324eeac8e102a2b40370e341460f3791353398 | ||||
| b0e26b7359c147b8aa0af686c20510fb9b15990a | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 11ec6354315768a85da41032535e3b7b99c5f706 | ||||
| c8757738a7418249896224430ce84888e8ecdd79 | ||||
|  | ||||
| @ -23,10 +23,6 @@ conda_install() { | ||||
|   as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $* | ||||
| } | ||||
|  | ||||
| conda_install_through_forge() { | ||||
|   as_jenkins conda install -c conda-forge -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $* | ||||
| } | ||||
|  | ||||
| conda_run() { | ||||
|   as_jenkins conda run -n py_$ANACONDA_PYTHON_VERSION --no-capture-output $* | ||||
| } | ||||
|  | ||||
| @ -15,9 +15,6 @@ install_ubuntu() { | ||||
|   elif [[ "$UBUNTU_VERSION" == "22.04"* ]]; then | ||||
|     cmake3="cmake=3.22*" | ||||
|     maybe_libiomp_dev="" | ||||
|   elif [[ "$UBUNTU_VERSION" == "24.04"* ]]; then | ||||
|     cmake3="cmake=3.28*" | ||||
|     maybe_libiomp_dev="" | ||||
|   else | ||||
|     cmake3="cmake=3.5*" | ||||
|     maybe_libiomp_dev="libiomp-dev" | ||||
| @ -33,6 +30,16 @@ install_ubuntu() { | ||||
|     maybe_libomp_dev="" | ||||
|   fi | ||||
|  | ||||
|   # HACK: UCC testing relies on libnccl library from NVIDIA repo, and version 2.16 crashes | ||||
|   # See https://github.com/pytorch/pytorch/pull/105260#issuecomment-1673399729 | ||||
|   # TODO: Eliminate this hack, we should not relay on apt-get installation | ||||
|   # See https://github.com/pytorch/pytorch/issues/144768 | ||||
|   if [[ "$UBUNTU_VERSION" == "20.04"* && "$CUDA_VERSION" == "11.8"* ]]; then | ||||
|     maybe_libnccl_dev="libnccl2=2.15.5-1+cuda11.8 libnccl-dev=2.15.5-1+cuda11.8 --allow-downgrades --allow-change-held-packages" | ||||
|   else | ||||
|     maybe_libnccl_dev="" | ||||
|   fi | ||||
|  | ||||
|   # Install common dependencies | ||||
|   apt-get update | ||||
|   # TODO: Some of these may not be necessary | ||||
| @ -61,6 +68,7 @@ install_ubuntu() { | ||||
|     libasound2-dev \ | ||||
|     libsndfile-dev \ | ||||
|     ${maybe_libomp_dev} \ | ||||
|     ${maybe_libnccl_dev} \ | ||||
|     software-properties-common \ | ||||
|     wget \ | ||||
|     sudo \ | ||||
|  | ||||
| @ -4,8 +4,12 @@ set -ex | ||||
|  | ||||
| # Optionally install conda | ||||
| if [ -n "$ANACONDA_PYTHON_VERSION" ]; then | ||||
|   BASE_URL="https://github.com/conda-forge/miniforge/releases/latest/download"  # @lint-ignore | ||||
|   CONDA_FILE="Miniforge3-Linux-$(uname -m).sh" | ||||
|   BASE_URL="https://repo.anaconda.com/miniconda" | ||||
|   CONDA_FILE="Miniconda3-latest-Linux-x86_64.sh" | ||||
|   if [[ $(uname -m) == "aarch64" ]] || [[ "$BUILD_ENVIRONMENT" == *xpu* ]]; then | ||||
|     BASE_URL="https://github.com/conda-forge/miniforge/releases/latest/download"  # @lint-ignore | ||||
|     CONDA_FILE="Miniforge3-Linux-$(uname -m).sh" | ||||
|   fi | ||||
|  | ||||
|   MAJOR_PYTHON_VERSION=$(echo "$ANACONDA_PYTHON_VERSION" | cut -d . -f 1) | ||||
|   MINOR_PYTHON_VERSION=$(echo "$ANACONDA_PYTHON_VERSION" | cut -d . -f 2) | ||||
| @ -17,6 +21,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then | ||||
|       exit 1 | ||||
|       ;; | ||||
|   esac | ||||
|  | ||||
|   mkdir -p /opt/conda | ||||
|   chown jenkins:jenkins /opt/conda | ||||
|  | ||||
| @ -59,16 +64,11 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then | ||||
|   # which is provided in libstdcxx 12 and up. | ||||
|   conda_install libstdcxx-ng=12.3.0 --update-deps -c conda-forge | ||||
|  | ||||
|   # Miniforge installer doesn't install sqlite by default | ||||
|   if [[ "$BUILD_ENVIRONMENT" == *rocm* ]]; then | ||||
|     conda_install sqlite | ||||
|   fi | ||||
|  | ||||
|   # Install PyTorch conda deps, as per https://github.com/pytorch/pytorch README | ||||
|   if [[ $(uname -m) != "aarch64" ]]; then | ||||
|     pip_install mkl==2024.2.0 | ||||
|     pip_install mkl-static==2024.2.0 | ||||
|     pip_install mkl-include==2024.2.0 | ||||
|   if [[ $(uname -m) == "aarch64" ]]; then | ||||
|     conda_install "openblas==0.3.29=*openmp*" | ||||
|   else | ||||
|     conda_install "mkl=2021.4.0 mkl-include=2021.4.0" | ||||
|   fi | ||||
|  | ||||
|   # Install llvm-8 as it is required to compile llvmlite-0.30.0 from source | ||||
| @ -82,10 +82,6 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then | ||||
|     conda_run ${SCRIPT_FOLDER}/install_magma_conda.sh $(cut -f1-2 -d'.' <<< ${CUDA_VERSION}) | ||||
|   fi | ||||
|  | ||||
|   if [[ "$UBUNTU_VERSION" == "24.04"* ]] ; then | ||||
|     conda_install_through_forge libstdcxx-ng=14 | ||||
|   fi | ||||
|  | ||||
|   # Install some other packages, including those needed for Python test reporting | ||||
|   pip_install -r /opt/conda/requirements-ci.txt | ||||
|  | ||||
|  | ||||
| @ -3,10 +3,11 @@ | ||||
| set -uex -o pipefail | ||||
|  | ||||
| PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python | ||||
| PYTHON_DOWNLOAD_GITHUB_BRANCH=https://github.com/python/cpython/archive/refs/heads  # @lint-ignore | ||||
| GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py | ||||
|  | ||||
| # Python versions to be installed in /opt/$VERSION_NO | ||||
| CPYTHON_VERSIONS=${CPYTHON_VERSIONS:-"3.9.0 3.10.1 3.11.0 3.12.0 3.13.0 3.13.0t 3.14.0 3.14.0t"} | ||||
| CPYTHON_VERSIONS=${CPYTHON_VERSIONS:-"3.9.0 3.10.1 3.11.0 3.12.0 3.13.0 3.13.0t"} | ||||
|  | ||||
| function check_var { | ||||
|     if [ -z "$1" ]; then | ||||
| @ -23,8 +24,9 @@ function do_cpython_build { | ||||
|     tar -xzf Python-$py_ver.tgz | ||||
|  | ||||
|     local additional_flags="" | ||||
|     if [[ "$py_ver" == *"t" ]]; then | ||||
|     if [ "$py_ver" == "3.13.0t" ]; then | ||||
|         additional_flags=" --disable-gil" | ||||
|         mv cpython-3.13/ cpython-3.13t/ | ||||
|     fi | ||||
|  | ||||
|     pushd $py_folder | ||||
| @ -66,7 +68,7 @@ function do_cpython_build { | ||||
|         ln -s pip3 ${prefix}/bin/pip | ||||
|     fi | ||||
|     # install setuptools since python 3.12 is required to use distutils | ||||
|     ${prefix}/bin/pip install wheel==0.45.1 setuptools==80.9.0 | ||||
|     ${prefix}/bin/pip install wheel==0.34.2 setuptools==68.2.2 | ||||
|     local abi_tag=$(${prefix}/bin/python -c "from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag; print('{0}{1}-{2}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()))") | ||||
|     ln -sf ${prefix} /opt/python/${abi_tag} | ||||
| } | ||||
| @ -74,20 +76,24 @@ function do_cpython_build { | ||||
| function build_cpython { | ||||
|     local py_ver=$1 | ||||
|     check_var $py_ver | ||||
|     local py_suffix=$py_ver | ||||
|     local py_folder=$py_ver | ||||
|     check_var $PYTHON_DOWNLOAD_URL | ||||
|     local py_ver_folder=$py_ver | ||||
|  | ||||
|     # Special handling for nogil | ||||
|     if [[ "${py_ver}" == *"t" ]]; then | ||||
|         py_suffix=${py_ver::-1} | ||||
|         py_folder=$py_suffix | ||||
|     if [ "$py_ver" = "3.13.0t" ]; then | ||||
|         PY_VER_SHORT="3.13" | ||||
|         PYT_VER_SHORT="3.13t" | ||||
|         check_var $PYTHON_DOWNLOAD_GITHUB_BRANCH | ||||
|         wget $PYTHON_DOWNLOAD_GITHUB_BRANCH/$PY_VER_SHORT.tar.gz -O Python-$py_ver.tgz | ||||
|         do_cpython_build $py_ver cpython-$PYT_VER_SHORT | ||||
|     elif [ "$py_ver" = "3.13.0" ]; then | ||||
|         PY_VER_SHORT="3.13" | ||||
|         check_var $PYTHON_DOWNLOAD_GITHUB_BRANCH | ||||
|         wget $PYTHON_DOWNLOAD_GITHUB_BRANCH/$PY_VER_SHORT.tar.gz -O Python-$py_ver.tgz | ||||
|         do_cpython_build $py_ver cpython-$PY_VER_SHORT | ||||
|     else | ||||
|         wget -q $PYTHON_DOWNLOAD_URL/$py_ver_folder/Python-$py_ver.tgz | ||||
|         do_cpython_build $py_ver Python-$py_ver | ||||
|     fi | ||||
|     # Only b3 is available now | ||||
|     if [ "$py_suffix" == "3.14.0" ]; then | ||||
|         py_suffix="3.14.0b3" | ||||
|     fi | ||||
|     wget -q $PYTHON_DOWNLOAD_URL/$py_folder/Python-$py_suffix.tgz -O Python-$py_ver.tgz | ||||
|     do_cpython_build $py_ver Python-$py_suffix | ||||
|  | ||||
|     rm -f Python-$py_ver.tgz | ||||
| } | ||||
|  | ||||
| @ -10,8 +10,6 @@ else | ||||
|   arch_path='sbsa' | ||||
| fi | ||||
|  | ||||
| NVSHMEM_VERSION=3.3.9 | ||||
|  | ||||
| function install_cuda { | ||||
|   version=$1 | ||||
|   runfile=$2 | ||||
| @ -42,65 +40,27 @@ function install_cudnn { | ||||
|   rm -rf tmp_cudnn | ||||
| } | ||||
|  | ||||
| function install_nvshmem { | ||||
|   cuda_major_version=$1      # e.g. "12" | ||||
|   nvshmem_version=$2         # e.g. "3.3.9" | ||||
| function install_118 { | ||||
|     CUDNN_VERSION=9.1.0.70 | ||||
|     echo "Installing CUDA 11.8 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.4.0" | ||||
|     install_cuda 11.8.0 cuda_11.8.0_520.61.05_linux | ||||
|  | ||||
|   case "${arch_path}" in | ||||
|     sbsa) | ||||
|       dl_arch="aarch64" | ||||
|       ;; | ||||
|     x86_64) | ||||
|       dl_arch="x64" | ||||
|       ;; | ||||
|     *) | ||||
|       dl_arch="${arch}" | ||||
|       ;; | ||||
|   esac | ||||
|     install_cudnn 11 $CUDNN_VERSION | ||||
|  | ||||
|   tmpdir="tmp_nvshmem" | ||||
|   mkdir -p "${tmpdir}" && cd "${tmpdir}" | ||||
|     CUDA_VERSION=11.8 bash install_nccl.sh | ||||
|  | ||||
|   # nvSHMEM license: https://docs.nvidia.com/nvshmem/api/sla.html | ||||
|   filename="libnvshmem_cuda${cuda_major_version}-linux-${arch_path}-${nvshmem_version}" | ||||
|   url="https://developer.download.nvidia.com/compute/redist/nvshmem/${nvshmem_version}/builds/cuda${cuda_major_version}/txz/agnostic/${dl_arch}/${filename}.tar.gz" | ||||
|     CUDA_VERSION=11.8 bash install_cusparselt.sh | ||||
|  | ||||
|   # download, unpack, install | ||||
|   wget -q "${url}" | ||||
|   tar xf "${filename}.tar.gz" | ||||
|   cp -a "libnvshmem/include/"* /usr/local/include/ | ||||
|   cp -a "libnvshmem/lib/"*     /usr/local/lib/ | ||||
|  | ||||
|   # cleanup | ||||
|   cd .. | ||||
|   rm -rf "${tmpdir}" | ||||
|  | ||||
|   echo "nvSHMEM ${nvshmem_version} for CUDA ${cuda_major_version} (${arch_path}) installed." | ||||
| } | ||||
|  | ||||
| function install_124 { | ||||
|   CUDNN_VERSION=9.1.0.70 | ||||
|   echo "Installing CUDA 12.4.1 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.6.2" | ||||
|   install_cuda 12.4.1 cuda_12.4.1_550.54.15_linux | ||||
|  | ||||
|   install_cudnn 12 $CUDNN_VERSION | ||||
|  | ||||
|   CUDA_VERSION=12.4 bash install_nccl.sh | ||||
|  | ||||
|   CUDA_VERSION=12.4 bash install_cusparselt.sh | ||||
|  | ||||
|   ldconfig | ||||
|     ldconfig | ||||
| } | ||||
|  | ||||
| function install_126 { | ||||
|   CUDNN_VERSION=9.10.2.21 | ||||
|   echo "Installing CUDA 12.6.3 and cuDNN ${CUDNN_VERSION} and NVSHMEM and NCCL and cuSparseLt-0.7.1" | ||||
|   CUDNN_VERSION=9.5.1.17 | ||||
|   echo "Installing CUDA 12.6.3 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.6.3" | ||||
|   install_cuda 12.6.3 cuda_12.6.3_560.35.05_linux | ||||
|  | ||||
|   install_cudnn 12 $CUDNN_VERSION | ||||
|  | ||||
|   install_nvshmem 12 $NVSHMEM_VERSION | ||||
|  | ||||
|   CUDA_VERSION=12.6 bash install_nccl.sh | ||||
|  | ||||
|   CUDA_VERSION=12.6 bash install_cusparselt.sh | ||||
| @ -108,56 +68,35 @@ function install_126 { | ||||
|   ldconfig | ||||
| } | ||||
|  | ||||
| function install_129 { | ||||
|   CUDNN_VERSION=9.10.2.21 | ||||
|   echo "Installing CUDA 12.9.1 and cuDNN ${CUDNN_VERSION} and NVSHMEM and NCCL and cuSparseLt-0.7.1" | ||||
|   # install CUDA 12.9.1 in the same container | ||||
|   install_cuda 12.9.1 cuda_12.9.1_575.57.08_linux | ||||
| function prune_118 { | ||||
|     echo "Pruning CUDA 11.8 and cuDNN" | ||||
|     ##################################################################################### | ||||
|     # CUDA 11.8 prune static libs | ||||
|     ##################################################################################### | ||||
|     export NVPRUNE="/usr/local/cuda-11.8/bin/nvprune" | ||||
|     export CUDA_LIB_DIR="/usr/local/cuda-11.8/lib64" | ||||
|  | ||||
|   # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement | ||||
|   install_cudnn 12 $CUDNN_VERSION | ||||
|     export GENCODE="-gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90" | ||||
|     export GENCODE_CUDNN="-gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90" | ||||
|  | ||||
|   install_nvshmem 12 $NVSHMEM_VERSION | ||||
|     if [[ -n "$OVERRIDE_GENCODE" ]]; then | ||||
|         export GENCODE=$OVERRIDE_GENCODE | ||||
|     fi | ||||
|  | ||||
|   CUDA_VERSION=12.9 bash install_nccl.sh | ||||
|  | ||||
|   CUDA_VERSION=12.9 bash install_cusparselt.sh | ||||
|  | ||||
|   ldconfig | ||||
| } | ||||
|  | ||||
| function prune_124 { | ||||
|   echo "Pruning CUDA 12.4" | ||||
|   ##################################################################################### | ||||
|   # CUDA 12.4 prune static libs | ||||
|   ##################################################################################### | ||||
|   export NVPRUNE="/usr/local/cuda-12.4/bin/nvprune" | ||||
|   export CUDA_LIB_DIR="/usr/local/cuda-12.4/lib64" | ||||
|  | ||||
|   export GENCODE="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90" | ||||
|   export GENCODE_CUDNN="-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90" | ||||
|  | ||||
|   if [[ -n "$OVERRIDE_GENCODE" ]]; then | ||||
|       export GENCODE=$OVERRIDE_GENCODE | ||||
|   fi | ||||
|   if [[ -n "$OVERRIDE_GENCODE_CUDNN" ]]; then | ||||
|       export GENCODE_CUDNN=$OVERRIDE_GENCODE_CUDNN | ||||
|   fi | ||||
|  | ||||
|   # all CUDA libs except CuDNN and CuBLAS | ||||
|   ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis"  \ | ||||
|     # all CUDA libs except CuDNN and CuBLAS (cudnn and cublas need arch 3.7 included) | ||||
|     ls $CUDA_LIB_DIR/ | grep "\.a" | grep -v "culibos" | grep -v "cudart" | grep -v "cudnn" | grep -v "cublas" | grep -v "metis"  \ | ||||
|       | xargs -I {} bash -c \ | ||||
|                 "echo {} && $NVPRUNE $GENCODE $CUDA_LIB_DIR/{} -o $CUDA_LIB_DIR/{}" | ||||
|  | ||||
|   # prune CuDNN and CuBLAS | ||||
|   $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a | ||||
|   $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a | ||||
|     # prune CuDNN and CuBLAS | ||||
|     $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublas_static.a -o $CUDA_LIB_DIR/libcublas_static.a | ||||
|     $NVPRUNE $GENCODE_CUDNN $CUDA_LIB_DIR/libcublasLt_static.a -o $CUDA_LIB_DIR/libcublasLt_static.a | ||||
|  | ||||
|   ##################################################################################### | ||||
|   # CUDA 12.4 prune visual tools | ||||
|   ##################################################################################### | ||||
|   export CUDA_BASE="/usr/local/cuda-12.4/" | ||||
|   rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2024.1.0 $CUDA_BASE/nsight-systems-2023.4.4/ | ||||
|     ##################################################################################### | ||||
|     # CUDA 11.8 prune visual tools | ||||
|     ##################################################################################### | ||||
|     export CUDA_BASE="/usr/local/cuda-11.8/" | ||||
|     rm -rf $CUDA_BASE/libnvvp $CUDA_BASE/nsightee_plugins $CUDA_BASE/nsight-compute-2022.3.0 $CUDA_BASE/nsight-systems-2022.4.2/ | ||||
| } | ||||
|  | ||||
| function prune_126 { | ||||
| @ -196,15 +135,13 @@ function prune_126 { | ||||
|  | ||||
| function install_128 { | ||||
|   CUDNN_VERSION=9.8.0.87 | ||||
|   echo "Installing CUDA 12.8.1 and cuDNN ${CUDNN_VERSION} and NVSHMEM and NCCL and cuSparseLt-0.7.1" | ||||
|   echo "Installing CUDA 12.8.1 and cuDNN ${CUDNN_VERSION} and NCCL and cuSparseLt-0.6.3" | ||||
|   # install CUDA 12.8.1 in the same container | ||||
|   install_cuda 12.8.1 cuda_12.8.1_570.124.06_linux | ||||
|  | ||||
|   # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement | ||||
|   install_cudnn 12 $CUDNN_VERSION | ||||
|  | ||||
|   install_nvshmem 12 $NVSHMEM_VERSION | ||||
|  | ||||
|   CUDA_VERSION=12.8 bash install_nccl.sh | ||||
|  | ||||
|   CUDA_VERSION=12.8 bash install_cusparselt.sh | ||||
| @ -216,14 +153,12 @@ function install_128 { | ||||
| while test $# -gt 0 | ||||
| do | ||||
|     case "$1" in | ||||
|     12.4) install_124; prune_124 | ||||
|     11.8) install_118; prune_118 | ||||
|         ;; | ||||
|     12.6|12.6.*) install_126; prune_126 | ||||
|         ;; | ||||
|     12.8|12.8.*) install_128; | ||||
|         ;; | ||||
|     12.9|12.9.*) install_129; | ||||
|         ;; | ||||
|     *) echo "bad argument $1"; exit 1 | ||||
|         ;; | ||||
|     esac | ||||
|  | ||||
							
								
								
									
										24
									
								
								.ci/docker/common/install_cudnn.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								.ci/docker/common/install_cudnn.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| if [[ -n "${CUDNN_VERSION}" ]]; then | ||||
|     # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement | ||||
|     mkdir tmp_cudnn | ||||
|     pushd tmp_cudnn | ||||
|     if [[ ${CUDA_VERSION:0:4} == "12.8" ]]; then | ||||
|         CUDNN_NAME="cudnn-linux-x86_64-9.8.0.87_cuda12-archive" | ||||
|     elif [[ ${CUDA_VERSION:0:4} == "12.6" ]]; then | ||||
|         CUDNN_NAME="cudnn-linux-x86_64-9.5.1.17_cuda12-archive" | ||||
|     elif [[ ${CUDA_VERSION:0:2} == "11" ]]; then | ||||
|         CUDNN_NAME="cudnn-linux-x86_64-9.1.0.70_cuda11-archive" | ||||
|     else | ||||
|         print "Unsupported CUDA version ${CUDA_VERSION}" | ||||
|         exit 1 | ||||
|     fi | ||||
|     curl --retry 3 -OLs https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/${CUDNN_NAME}.tar.xz | ||||
|     tar xf ${CUDNN_NAME}.tar.xz | ||||
|     cp -a ${CUDNN_NAME}/include/* /usr/local/cuda/include/ | ||||
|     cp -a ${CUDNN_NAME}/lib/* /usr/local/cuda/lib64/ | ||||
|     popd | ||||
|     rm -rf tmp_cudnn | ||||
|     ldconfig | ||||
| fi | ||||
| @ -5,22 +5,17 @@ set -ex | ||||
| # cuSPARSELt license: https://docs.nvidia.com/cuda/cusparselt/license.html | ||||
| mkdir tmp_cusparselt && cd tmp_cusparselt | ||||
|  | ||||
| if [[ ${CUDA_VERSION:0:4} =~ ^12\.[5-9]$ ]]; then | ||||
| if [[ ${CUDA_VERSION:0:4} =~ ^12\.[5-8]$ ]]; then | ||||
|     arch_path='sbsa' | ||||
|     export TARGETARCH=${TARGETARCH:-$(uname -m)} | ||||
|     if [ ${TARGETARCH} = 'amd64' ] || [ "${TARGETARCH}" = 'x86_64' ]; then | ||||
|         arch_path='x86_64' | ||||
|     fi | ||||
|     CUSPARSELT_NAME="libcusparse_lt-linux-${arch_path}-0.7.1.0-archive" | ||||
|     curl --retry 3 -OLs https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-${arch_path}/${CUSPARSELT_NAME}.tar.xz | ||||
| elif [[ ${CUDA_VERSION:0:4} == "12.4" ]]; then | ||||
|     arch_path='sbsa' | ||||
|     export TARGETARCH=${TARGETARCH:-$(uname -m)} | ||||
|     if [ ${TARGETARCH} = 'amd64' ] || [ "${TARGETARCH}" = 'x86_64' ]; then | ||||
|         arch_path='x86_64' | ||||
|     fi | ||||
|     CUSPARSELT_NAME="libcusparse_lt-linux-${arch_path}-0.6.2.3-archive" | ||||
|     CUSPARSELT_NAME="libcusparse_lt-linux-${arch_path}-0.6.3.2-archive" | ||||
|     curl --retry 3 -OLs https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-${arch_path}/${CUSPARSELT_NAME}.tar.xz | ||||
| elif [[ ${CUDA_VERSION:0:4} == "11.8" ]]; then | ||||
|     CUSPARSELT_NAME="libcusparse_lt-linux-x86_64-0.4.0.7-archive" | ||||
|     curl --retry 3 -OLs https://developer.download.nvidia.com/compute/cusparselt/redist/libcusparse_lt/linux-x86_64/${CUSPARSELT_NAME}.tar.xz | ||||
| else | ||||
|     echo "Not sure which libcusparselt version to install for this ${CUDA_VERSION}" | ||||
| fi | ||||
|  | ||||
| @ -20,7 +20,7 @@ pip_install \ | ||||
|  | ||||
| pip_install coloredlogs packaging | ||||
| pip_install onnxruntime==1.18.1 | ||||
| pip_install onnxscript==0.3.1 | ||||
| pip_install onnxscript==0.3.0 | ||||
|  | ||||
| # Cache the transformers model to be used later by ONNX tests. We need to run the transformers | ||||
| # package to download the model. By default, the model is cached at ~/.cache/huggingface/hub/ | ||||
|  | ||||
| @ -4,9 +4,8 @@ | ||||
| set -ex | ||||
|  | ||||
| cd / | ||||
| git clone https://github.com/OpenMathLib/OpenBLAS.git -b "${OPENBLAS_VERSION:-v0.3.30}" --depth 1 --shallow-submodules | ||||
| git clone https://github.com/OpenMathLib/OpenBLAS.git -b "${OPENBLAS_VERSION:-v0.3.29}" --depth 1 --shallow-submodules | ||||
|  | ||||
| OPENBLAS_CHECKOUT_DIR="OpenBLAS" | ||||
| OPENBLAS_BUILD_FLAGS=" | ||||
| NUM_THREADS=128 | ||||
| USE_OPENMP=1 | ||||
| @ -14,8 +13,9 @@ NO_SHARED=0 | ||||
| DYNAMIC_ARCH=1 | ||||
| TARGET=ARMV8 | ||||
| CFLAGS=-O3 | ||||
| BUILD_BFLOAT16=1 | ||||
| " | ||||
|  | ||||
| OPENBLAS_CHECKOUT_DIR="OpenBLAS" | ||||
|  | ||||
| make -j8 ${OPENBLAS_BUILD_FLAGS} -C ${OPENBLAS_CHECKOUT_DIR} | ||||
| make -j8 ${OPENBLAS_BUILD_FLAGS} install -C ${OPENBLAS_CHECKOUT_DIR} | ||||
|  | ||||
| @ -8,11 +8,9 @@ ver() { | ||||
|  | ||||
| install_ubuntu() { | ||||
|     apt-get update | ||||
|     # gpg-agent is not available by default | ||||
|     apt-get install -y --no-install-recommends gpg-agent | ||||
|     if [[ $(ver $UBUNTU_VERSION) -ge $(ver 22.04) ]]; then | ||||
|         echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ | ||||
|             | sudo tee /etc/apt/preferences.d/rocm-pin-600 | ||||
|     if [[ $UBUNTU_VERSION == 20.04 ]]; then | ||||
|       # gpg-agent is not available by default on 20.04 | ||||
|       apt-get install -y --no-install-recommends gpg-agent | ||||
|     fi | ||||
|     apt-get install -y kmod | ||||
|     apt-get install -y wget | ||||
| @ -28,27 +26,13 @@ Pin: release o=repo.radeon.com | ||||
| Pin-Priority: 600 | ||||
| EOF | ||||
|  | ||||
|     # we want the patch version of 6.4 instead | ||||
|     if [[ $(ver $ROCM_VERSION) -eq $(ver 6.4) ]]; then | ||||
|         ROCM_VERSION="${ROCM_VERSION}.2" | ||||
|     fi | ||||
|  | ||||
|     # Default url values | ||||
|     rocm_baseurl="http://repo.radeon.com/rocm/apt/${ROCM_VERSION}" | ||||
|     amdgpu_baseurl="https://repo.radeon.com/amdgpu/${ROCM_VERSION}/ubuntu" | ||||
|  | ||||
|     # Special case for ROCM_VERSION == 7.0 | ||||
|     if [[ $(ver "$ROCM_VERSION") -eq $(ver 7.0) ]]; then | ||||
|         rocm_baseurl="https://repo.radeon.com/rocm/apt/7.0_alpha2" | ||||
|         amdgpu_baseurl="https://repo.radeon.com/amdgpu/30.10_alpha2/ubuntu" | ||||
|     fi | ||||
|  | ||||
|     # Add amdgpu repository | ||||
|     UBUNTU_VERSION_NAME=`cat /etc/os-release | grep UBUNTU_CODENAME | awk -F= '{print $2}'` | ||||
|     echo "deb [arch=amd64] ${amdgpu_baseurl} ${UBUNTU_VERSION_NAME} main" > /etc/apt/sources.list.d/amdgpu.list | ||||
|     echo "deb [arch=amd64] https://repo.radeon.com/amdgpu/${ROCM_VERSION}/ubuntu ${UBUNTU_VERSION_NAME} main" > /etc/apt/sources.list.d/amdgpu.list | ||||
|  | ||||
|     # Add rocm repository | ||||
|     wget -qO - http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - | ||||
|     local rocm_baseurl="http://repo.radeon.com/rocm/apt/${ROCM_VERSION}" | ||||
|     echo "deb [arch=amd64] ${rocm_baseurl} ${UBUNTU_VERSION_NAME} main" > /etc/apt/sources.list.d/rocm.list | ||||
|     apt-get update --allow-insecure-repositories | ||||
|  | ||||
| @ -82,33 +66,25 @@ EOF | ||||
|     done | ||||
|  | ||||
|     # ROCm 6.3 had a regression where initializing static code objects had significant overhead | ||||
|     # CI no longer builds for ROCm 6.3, but | ||||
|     # ROCm 6.4 did not yet fix the regression, also HIP branch names are different | ||||
|     if [[ $(ver $ROCM_VERSION) -ge $(ver 6.4) ]] && [[ $(ver $ROCM_VERSION) -lt $(ver 7.0) ]]; then | ||||
|         if [[ $(ver $ROCM_VERSION) -eq $(ver 6.4.2) ]]; then | ||||
|             HIP_TAG=rocm-6.4.2 | ||||
|             CLR_HASH=74d78ba3ac4bac235d02bcb48511c30b5cfdd457  # branch release/rocm-rel-6.4.2-statco-hotfix | ||||
|         elif [[ $(ver $ROCM_VERSION) -eq $(ver 6.4.1) ]]; then | ||||
|             HIP_TAG=rocm-6.4.1 | ||||
|             CLR_HASH=efe6c35790b9206923bfeed1209902feff37f386  # branch release/rocm-rel-6.4.1-statco-hotfix | ||||
|     if [[ $(ver $ROCM_VERSION) -eq $(ver 6.3) ]] || [[ $(ver $ROCM_VERSION) -eq $(ver 6.4) ]]; then | ||||
|         if [[ $(ver $ROCM_VERSION) -eq $(ver 6.3) ]]; then | ||||
|             HIP_BRANCH=rocm-6.3.x | ||||
|             VER_STR=6.3 | ||||
|         elif [[ $(ver $ROCM_VERSION) -eq $(ver 6.4) ]]; then | ||||
|             HIP_TAG=rocm-6.4.0 | ||||
|             CLR_HASH=600f5b0d2baed94d5121e2174a9de0851b040b0c  # branch release/rocm-rel-6.4-statco-hotfix | ||||
|             HIP_BRANCH=release/rocm-rel-6.4 | ||||
|             VER_STR=6.4 | ||||
|         fi | ||||
|         # clr build needs CppHeaderParser but can only find it using conda's python | ||||
|         python -m pip install CppHeaderParser | ||||
|         git clone https://github.com/ROCm/HIP -b $HIP_TAG | ||||
|         /opt/conda/bin/python -m pip install CppHeaderParser | ||||
|         git clone https://github.com/ROCm/HIP -b $HIP_BRANCH | ||||
|         HIP_COMMON_DIR=$(readlink -f HIP) | ||||
|         git clone https://github.com/jeffdaily/clr | ||||
|         pushd clr | ||||
|         git checkout $CLR_HASH | ||||
|         popd | ||||
|         git clone https://github.com/jeffdaily/clr -b release/rocm-rel-${VER_STR}-statco-hotfix | ||||
|         mkdir -p clr/build | ||||
|         pushd clr/build | ||||
|         # Need to point CMake to the correct python installation to find CppHeaderParser | ||||
|         cmake .. -DPython3_EXECUTABLE=/opt/conda/envs/py_${ANACONDA_PYTHON_VERSION}/bin/python3 -DCLR_BUILD_HIP=ON -DHIP_COMMON_DIR=$HIP_COMMON_DIR | ||||
|         cmake .. -DCLR_BUILD_HIP=ON -DHIP_COMMON_DIR=$HIP_COMMON_DIR | ||||
|         make -j | ||||
|         cp hipamd/lib/libamdhip64.so.6.4.* /opt/rocm/lib/libamdhip64.so.6.4.* | ||||
|         cp hipamd/lib/libamdhip64.so.${VER_STR}.* /opt/rocm/lib/libamdhip64.so.${VER_STR}.* | ||||
|         popd | ||||
|         rm -rf HIP clr | ||||
|     fi | ||||
|  | ||||
| @ -5,12 +5,7 @@ set -eou pipefail | ||||
|  | ||||
| function do_install() { | ||||
|     rocm_version=$1 | ||||
|     if [[ ${rocm_version} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||||
|         # chop off any patch version | ||||
|         rocm_version="${rocm_version%.*}" | ||||
|     fi | ||||
|  | ||||
|     rocm_version_nodot=${rocm_version//./} | ||||
|     rocm_version_nodot=${1//./} | ||||
|  | ||||
|     # Version 2.7.2 + ROCm related updates | ||||
|     MAGMA_VERSION=a1625ff4d9bc362906bd01f805dbbe12612953f6 | ||||
|  | ||||
| @ -98,10 +98,3 @@ fi | ||||
| if [ -n "${NUMPY_VERSION}" ]; then | ||||
|   pip_install "numpy==${NUMPY_VERSION}" | ||||
| fi | ||||
|  | ||||
| # IMPORTANT: helion needs to be installed without dependencies. | ||||
| # It depends on torch and triton. We don't want to install | ||||
| # triton and torch from production on Docker CI images | ||||
| if [[ "$ANACONDA_PYTHON_VERSION" != 3.9* ]]; then | ||||
|   pip_install helion==0.0.10 --no-deps | ||||
| fi | ||||
|  | ||||
| @ -56,10 +56,14 @@ function install_ubuntu() { | ||||
|  | ||||
| function install_rhel() { | ||||
|     . /etc/os-release | ||||
|  | ||||
|     if [[ ! " 8.8 8.10 9.0 9.2 9.3 " =~ " ${VERSION_ID} " ]]; then | ||||
|         echo "RHEL version ${VERSION_ID} not supported" | ||||
|         exit | ||||
|     if [[ "${ID}" == "rhel" ]]; then | ||||
|         if [[ ! " 8.8 8.9 9.0 9.2 9.3 " =~ " ${VERSION_ID} " ]]; then | ||||
|             echo "RHEL version ${VERSION_ID} not supported" | ||||
|             exit | ||||
|         fi | ||||
|     elif [[ "${ID}" == "almalinux" ]]; then | ||||
|         # Workaround for almalinux8 which used by quay.io/pypa/manylinux_2_28_x86_64 | ||||
|         VERSION_ID="8.8" | ||||
|     fi | ||||
|  | ||||
|     dnf install -y 'dnf-command(config-manager)' | ||||
|  | ||||
| @ -54,6 +54,16 @@ COPY ./ci_commit_pins/nccl-cu* /ci_commit_pins/ | ||||
| COPY ./common/install_cusparselt.sh install_cusparselt.sh | ||||
| ENV CUDA_HOME /usr/local/cuda | ||||
|  | ||||
| FROM cuda as cuda11.8 | ||||
| RUN bash ./install_cuda.sh 11.8 | ||||
| RUN bash ./install_magma.sh 11.8 | ||||
| RUN ln -sf /usr/local/cuda-11.8 /usr/local/cuda | ||||
|  | ||||
| FROM cuda as cuda12.4 | ||||
| RUN bash ./install_cuda.sh 12.4 | ||||
| RUN bash ./install_magma.sh 12.4 | ||||
| RUN ln -sf /usr/local/cuda-12.4 /usr/local/cuda | ||||
|  | ||||
| FROM cuda as cuda12.6 | ||||
| RUN bash ./install_cuda.sh 12.6 | ||||
| RUN bash ./install_magma.sh 12.6 | ||||
| @ -64,11 +74,6 @@ RUN bash ./install_cuda.sh 12.8 | ||||
| RUN bash ./install_magma.sh 12.8 | ||||
| RUN ln -sf /usr/local/cuda-12.8 /usr/local/cuda | ||||
|  | ||||
| FROM cuda as cuda12.9 | ||||
| RUN bash ./install_cuda.sh 12.9 | ||||
| RUN bash ./install_magma.sh 12.9 | ||||
| RUN ln -sf /usr/local/cuda-12.9 /usr/local/cuda | ||||
|  | ||||
| FROM cpu as rocm | ||||
| ARG ROCM_VERSION | ||||
| ARG PYTORCH_ROCM_ARCH | ||||
|  | ||||
| @ -39,10 +39,6 @@ case ${DOCKER_TAG_PREFIX} in | ||||
|         DOCKER_GPU_BUILD_ARG="" | ||||
|         ;; | ||||
|     rocm*) | ||||
|         # we want the patch version of 6.4 instead | ||||
|         if [[ $(ver $GPU_ARCH_VERSION) -eq $(ver 6.4) ]]; then | ||||
|             GPU_ARCH_VERSION="${GPU_ARCH_VERSION}.2" | ||||
|         fi | ||||
|         BASE_TARGET=rocm | ||||
|         GPU_IMAGE=rocm/dev-ubuntu-22.04:${GPU_ARCH_VERSION}-complete | ||||
|         PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" | ||||
|  | ||||
| @ -27,7 +27,5 @@ COPY ./common/install_linter.sh install_linter.sh | ||||
| RUN bash ./install_linter.sh | ||||
| RUN rm install_linter.sh | ||||
|  | ||||
| RUN chown -R jenkins:jenkins /var/lib/jenkins/ci_env | ||||
|  | ||||
| USER jenkins | ||||
| CMD ["bash"] | ||||
|  | ||||
| @ -26,7 +26,7 @@ ADD ./common/install_openssl.sh install_openssl.sh | ||||
| RUN bash ./install_openssl.sh && rm install_openssl.sh | ||||
|  | ||||
|  | ||||
| # remove unnecessary python versions | ||||
| # remove unncessary python versions | ||||
| RUN rm -rf /opt/python/cp26-cp26m /opt/_internal/cpython-2.6.9-ucs2 | ||||
| RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4 | ||||
| RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6 | ||||
| @ -103,7 +103,6 @@ ENV SSL_CERT_FILE=/opt/_internal/certs.pem | ||||
| # Install LLVM version | ||||
| COPY --from=openssl            /opt/openssl                          /opt/openssl | ||||
| COPY --from=base               /opt/python                           /opt/python | ||||
| COPY --from=base               /usr/local/lib/                       /usr/local/lib/ | ||||
| COPY --from=base               /opt/_internal                        /opt/_internal | ||||
| COPY --from=base               /usr/local/bin/auditwheel             /usr/local/bin/auditwheel | ||||
| COPY --from=intel              /opt/intel                            /opt/intel | ||||
|  | ||||
| @ -2,7 +2,7 @@ FROM quay.io/pypa/manylinux_2_28_aarch64 as base | ||||
|  | ||||
| ARG GCCTOOLSET_VERSION=13 | ||||
|  | ||||
| # Language variables | ||||
| # Language variabes | ||||
| ENV LC_ALL=en_US.UTF-8 | ||||
| ENV LANG=en_US.UTF-8 | ||||
| ENV LANGUAGE=en_US.UTF-8 | ||||
| @ -64,7 +64,7 @@ RUN bash ./install_openblas.sh && rm install_openblas.sh | ||||
|  | ||||
| FROM base as final | ||||
|  | ||||
| # remove unnecessary python versions | ||||
| # remove unncessary python versions | ||||
| RUN rm -rf /opt/python/cp26-cp26m /opt/_internal/cpython-2.6.9-ucs2 | ||||
| RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4 | ||||
| RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6 | ||||
|  | ||||
| @ -60,7 +60,7 @@ RUN bash ./install_openssl.sh && rm install_openssl.sh | ||||
| ENV SSL_CERT_FILE=/opt/_internal/certs.pem | ||||
|  | ||||
| FROM openssl as final | ||||
| # remove unnecessary python versions | ||||
| # remove unncessary python versions | ||||
| RUN rm -rf /opt/python/cp26-cp26m /opt/_internal/cpython-2.6.9-ucs2 | ||||
| RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4 | ||||
| RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6 | ||||
|  | ||||
| @ -120,19 +120,15 @@ RUN python3 -mpip install cmake==3.28.0 | ||||
| # so just build it from upstream repository. | ||||
| # h5py is dependency of onnxruntime_training. | ||||
| # h5py==3.11.0 builds with hdf5-devel 1.10.5 from repository. | ||||
| # h5py 3.11.0 doesn't build with numpy >= 2.3.0. | ||||
| # install newest flatbuffers version first: | ||||
| # for some reason old version is getting pulled in otherwise. | ||||
| # packaging package is required for onnxruntime wheel build. | ||||
| RUN pip3 install flatbuffers && \ | ||||
|   pip3 install cython 'pkgconfig>=1.5.5' 'setuptools>=77' 'numpy<2.3.0' && \ | ||||
|   pip3 install --no-build-isolation h5py==3.11.0 && \ | ||||
|   pip3 install h5py==3.11.0 && \ | ||||
|   pip3 install packaging && \ | ||||
|   git clone https://github.com/microsoft/onnxruntime && \ | ||||
|   cd onnxruntime && git checkout v1.21.0 && \ | ||||
|   git submodule update --init --recursive && \ | ||||
|   wget https://github.com/microsoft/onnxruntime/commit/f57db79743c4d1a3553aa05cf95bcd10966030e6.patch && \ | ||||
|   patch -p1 < f57db79743c4d1a3553aa05cf95bcd10966030e6.patch && \ | ||||
|   ./build.sh --config Release --parallel 0 --enable_pybind \ | ||||
|   --build_wheel --enable_training --enable_training_apis \ | ||||
|   --enable_training_ops --skip_tests --allow_running_as_root \ | ||||
|  | ||||
| @ -41,7 +41,7 @@ case ${image} in | ||||
|         GPU_IMAGE=arm64v8/almalinux:8 | ||||
|         DOCKER_GPU_BUILD_ARG=" --build-arg DEVTOOLSET_VERSION=13 --build-arg NINJA_VERSION=1.12.1" | ||||
|         MANY_LINUX_VERSION="2_28_aarch64" | ||||
|         OPENBLAS_VERSION="v0.3.30" | ||||
|         OPENBLAS_VERSION="v0.3.29" | ||||
|         ;; | ||||
|     manylinuxcxx11-abi-builder:cpu-cxx11-abi) | ||||
|         TARGET=final | ||||
| @ -75,10 +75,6 @@ case ${image} in | ||||
|         DOCKERFILE_SUFFIX="_cuda_aarch64" | ||||
|         ;; | ||||
|     manylinux2_28-builder:rocm*) | ||||
|         # we want the patch version of 6.4 instead | ||||
|         if [[ $(ver $GPU_ARCH_VERSION) -eq $(ver 6.4) ]]; then | ||||
|             GPU_ARCH_VERSION="${GPU_ARCH_VERSION}.2" | ||||
|         fi | ||||
|         TARGET=rocm_final | ||||
|         MANY_LINUX_VERSION="2_28" | ||||
|         DEVTOOLSET_VERSION="11" | ||||
|  | ||||
| @ -16,7 +16,6 @@ click | ||||
| #test that import: | ||||
|  | ||||
| coremltools==5.0b5 ; python_version < "3.12" | ||||
| coremltools==8.3 ; python_version == "3.12" | ||||
| #Description: Apple framework for ML integration | ||||
| #Pinned versions: 5.0b5 | ||||
| #test that import: | ||||
| @ -50,7 +49,7 @@ flatbuffers==24.12.23 | ||||
| hypothesis==5.35.1 | ||||
| # Pin hypothesis to avoid flakiness: https://github.com/pytorch/pytorch/issues/31136 | ||||
| #Description: advanced library for generating parametrized tests | ||||
| #Pinned versions: 5.35.1 | ||||
| #Pinned versions: 3.44.6, 4.53.2 | ||||
| #test that import: test_xnnpack_integration.py, test_pruning_op.py, test_nn.py | ||||
|  | ||||
| junitparser==2.1.1 | ||||
| @ -64,7 +63,6 @@ lark==0.12.0 | ||||
| #test that import: | ||||
|  | ||||
| librosa>=0.6.2 ; python_version < "3.11" | ||||
| librosa==0.10.2 ; python_version == "3.12" | ||||
| #Description: A python package for music and audio analysis | ||||
| #Pinned versions: >=0.6.2 | ||||
| #test that import: test_spectral_ops.py | ||||
| @ -92,10 +90,10 @@ librosa==0.10.2 ; python_version == "3.12" | ||||
| #Pinned versions: | ||||
| #test that import: | ||||
|  | ||||
| mypy==1.16.0 | ||||
| mypy==1.15.0 | ||||
| # Pin MyPy version because new errors are likely to appear with each release | ||||
| #Description: linter | ||||
| #Pinned versions: 1.16.0 | ||||
| #Pinned versions: 1.14.0 | ||||
| #test that import: test_typing.py, test_type_hints.py | ||||
|  | ||||
| networkx==2.8.8 | ||||
| @ -113,7 +111,6 @@ ninja==1.11.1.3 | ||||
| numba==0.49.0 ; python_version < "3.9" | ||||
| numba==0.55.2 ; python_version == "3.9" | ||||
| numba==0.55.2 ; python_version == "3.10" | ||||
| numba==0.60.0 ; python_version == "3.12" | ||||
| #Description: Just-In-Time Compiler for Numerical Functions | ||||
| #Pinned versions: 0.54.1, 0.49.0, <=0.49.1 | ||||
| #test that import: test_numba_integration.py | ||||
| @ -221,9 +218,9 @@ pygments==2.15.0 | ||||
| #Pinned versions: 2.12.0 | ||||
| #test that import: the doctests | ||||
|  | ||||
| #pyyaml | ||||
| #PyYAML | ||||
| #Description: data serialization format | ||||
| #Pinned versions: 6.0.2 | ||||
| #Pinned versions: | ||||
| #test that import: | ||||
|  | ||||
| #requests | ||||
| @ -233,7 +230,7 @@ pygments==2.15.0 | ||||
|  | ||||
| #rich | ||||
| #Description: rich text and beautiful formatting in the terminal | ||||
| #Pinned versions: 14.1.0 | ||||
| #Pinned versions: 10.9.0 | ||||
| #test that import: | ||||
|  | ||||
| scikit-image==0.19.3 ; python_version < "3.10" | ||||
| @ -307,7 +304,7 @@ pytest-cpp==2.3.0 | ||||
| #Pinned versions: 2.3.0 | ||||
| #test that import: | ||||
|  | ||||
| z3-solver==4.15.1.0 | ||||
| z3-solver==4.12.6.0 | ||||
| #Description: The Z3 Theorem Prover Project | ||||
| #Pinned versions: | ||||
| #test that import: | ||||
| @ -342,7 +339,7 @@ onnx==1.18.0 | ||||
| #Pinned versions: | ||||
| #test that import: | ||||
|  | ||||
| onnxscript==0.3.1 | ||||
| onnxscript==0.2.6 | ||||
| #Description: Required by mypy and test_public_bindings.py when checking torch.onnx._internal | ||||
| #Pinned versions: | ||||
| #test that import: | ||||
| @ -363,10 +360,10 @@ pwlf==2.2.1 | ||||
|  | ||||
|  | ||||
| # To build PyTorch itself | ||||
| pyyaml | ||||
| astunparse | ||||
| PyYAML | ||||
| pyzstd | ||||
| setuptools>=70.1.0 | ||||
| six | ||||
| setuptools | ||||
|  | ||||
| scons==4.5.2 ; platform_machine == "aarch64" | ||||
|  | ||||
| @ -382,16 +379,3 @@ dataclasses_json==0.6.7 | ||||
|  | ||||
| cmake==4.0.0 | ||||
| #Description: required for building | ||||
|  | ||||
| tlparse==0.3.30 | ||||
| #Description: required for log parsing | ||||
|  | ||||
| cuda-bindings>=12.0,<13.0 ; platform_machine != "s390x" | ||||
| #Description: required for testing CUDAGraph::raw_cuda_graph(). See https://nvidia.github.io/cuda-python/cuda-bindings/latest/support.html for how this version was chosen. Note "Any fix in the latest bindings would be backported to the prior major version" means that only the newest version of cuda-bindings will get fixes. Depending on the latest version of 12.x is okay because all 12.y versions will be supported via "CUDA minor version compatibility". Pytorch builds against 13.z versions of cuda toolkit work with 12.x versions of cuda-bindings as well because newer drivers work with old toolkits. | ||||
| #test that import: test_cuda.py | ||||
|  | ||||
| setuptools-git-versioning==2.1.0 | ||||
| scikit-build==0.18.1 | ||||
| pyre-extensions==0.0.32 | ||||
| tabulate==0.9.0 | ||||
| #Description: These package are needed to build FBGEMM and torchrec on PyTorch CI | ||||
|  | ||||
| @ -4,8 +4,8 @@ sphinx==5.3.0 | ||||
| -e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2 | ||||
|  | ||||
| # TODO: sphinxcontrib.katex 0.9.0 adds a local KaTeX server to speed up pre-rendering | ||||
| # but it doesn't seem to work and hangs around idly. The initial thought that it is probably | ||||
| # something related to Docker setup. We can investigate this later. | ||||
| # but it doesn't seem to work and hangs around idly. The initial thought is probably | ||||
| # something related to Docker setup. We can investigate this later | ||||
|  | ||||
| sphinxcontrib.katex==0.8.6 | ||||
| #Description: This is used to generate PyTorch docs | ||||
| @ -19,10 +19,9 @@ sphinx_sitemap==2.6.0 | ||||
| #Description: This is used to generate sitemap for PyTorch docs | ||||
| #Pinned versions: 2.6.0 | ||||
|  | ||||
| matplotlib==3.5.3 ; python_version < "3.13" | ||||
| matplotlib==3.6.3 ; python_version >= "3.13" | ||||
| matplotlib==3.5.3 | ||||
| #Description: This is used to generate PyTorch docs | ||||
| #Pinned versions: 3.6.3 if python > 3.12. Otherwise 3.5.3. | ||||
| #Pinned versions: 3.5.3 | ||||
|  | ||||
| tensorboard==2.13.0 ; python_version < "3.13" | ||||
| tensorboard==2.18.0 ; python_version >= "3.13" | ||||
| @ -50,8 +49,8 @@ IPython==8.12.0 | ||||
| #Pinned versions: 8.12.0 | ||||
|  | ||||
| myst-nb==0.17.2 | ||||
| #Description: This is used to generate PyTorch functorch and torch.compile docs | ||||
| #Pinned versions: 0.17.2 | ||||
| #Description: This is used to generate PyTorch functorch docs | ||||
| #Pinned versions: 0.13.2 | ||||
|  | ||||
| # The following are required to build torch.distributed.elastic.rendezvous.etcd* docs | ||||
| python-etcd==0.4.5 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 3.4.0 | ||||
| 3.3.1 | ||||
|  | ||||
| @ -1 +0,0 @@ | ||||
| 3.4.0 | ||||
| @ -25,7 +25,6 @@ RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh | ||||
|  | ||||
| # Install conda and other packages (e.g., numpy, pytest) | ||||
| ARG ANACONDA_PYTHON_VERSION | ||||
| ARG BUILD_ENVIRONMENT | ||||
| ENV ANACONDA_PYTHON_VERSION=$ANACONDA_PYTHON_VERSION | ||||
| ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH | ||||
| COPY requirements-ci.txt /opt/conda/requirements-ci.txt | ||||
|  | ||||
| @ -72,7 +72,7 @@ ARG TRITON | ||||
| COPY ./common/install_triton.sh install_triton.sh | ||||
| COPY ./common/common_utils.sh common_utils.sh | ||||
| COPY ci_commit_pins/triton-xpu.txt triton-xpu.txt | ||||
| COPY triton_xpu_version.txt triton_version.txt | ||||
| COPY triton_version.txt triton_version.txt | ||||
| RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi | ||||
| RUN rm install_triton.sh common_utils.sh triton-xpu.txt triton_version.txt | ||||
|  | ||||
|  | ||||
| @ -147,12 +147,6 @@ RUN if [ -n "${ACL}" ]; then bash ./install_acl.sh; fi | ||||
| RUN rm install_acl.sh | ||||
| ENV INSTALLED_ACL ${ACL} | ||||
|  | ||||
| ARG OPENBLAS | ||||
| COPY ./common/install_openblas.sh install_openblas.sh | ||||
| RUN if [ -n "${OPENBLAS}" ]; then bash ./install_openblas.sh; fi | ||||
| RUN rm install_openblas.sh | ||||
| ENV INSTALLED_OPENBLAS ${OPENBLAS} | ||||
|  | ||||
| # Install ccache/sccache (do this last, so we get priority in PATH) | ||||
| ARG SKIP_SCCACHE_INSTALL | ||||
| COPY ./common/install_cache.sh install_cache.sh | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| SHELL=/usr/bin/env bash | ||||
|  | ||||
| DOCKER_CMD ?= docker | ||||
| DESIRED_CUDA ?= 12.8 | ||||
| DESIRED_CUDA ?= 11.8 | ||||
| DESIRED_CUDA_SHORT = $(subst .,,$(DESIRED_CUDA)) | ||||
| PACKAGE_NAME = magma-cuda | ||||
| CUDA_ARCH_LIST ?= -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 | ||||
| @ -16,21 +16,15 @@ DOCKER_RUN = set -eou pipefail; ${DOCKER_CMD} run --rm -i \ | ||||
| 	magma/build_magma.sh | ||||
|  | ||||
| .PHONY: all | ||||
| all: magma-cuda129 | ||||
| all: magma-cuda128 | ||||
| all: magma-cuda126 | ||||
| all: magma-cuda118 | ||||
|  | ||||
| .PHONY: | ||||
| clean: | ||||
| 	$(RM) -r magma-* | ||||
| 	$(RM) -r output | ||||
|  | ||||
| .PHONY: magma-cuda129 | ||||
| magma-cuda129: DESIRED_CUDA := 12.9 | ||||
| magma-cuda129: CUDA_ARCH_LIST += -gencode arch=compute_100,code=sm_100 -gencode arch=compute_120,code=sm_120 | ||||
| magma-cuda129: | ||||
| 	$(DOCKER_RUN) | ||||
|  | ||||
| .PHONY: magma-cuda128 | ||||
| magma-cuda128: DESIRED_CUDA := 12.8 | ||||
| magma-cuda128: CUDA_ARCH_LIST += -gencode arch=compute_100,code=sm_100 -gencode arch=compute_120,code=sm_120 | ||||
| @ -41,3 +35,9 @@ magma-cuda128: | ||||
| magma-cuda126: DESIRED_CUDA := 12.6 | ||||
| magma-cuda126: | ||||
| 	$(DOCKER_RUN) | ||||
|  | ||||
| .PHONY: magma-cuda118 | ||||
| magma-cuda118: DESIRED_CUDA := 11.8 | ||||
| magma-cuda118: CUDA_ARCH_LIST += -gencode arch=compute_37,code=sm_37 | ||||
| magma-cuda118: | ||||
| 	$(DOCKER_RUN) | ||||
|  | ||||
| @ -31,6 +31,7 @@ elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then | ||||
|     # Comment out nvidia repositories to prevent them from getting apt-get updated, see https://github.com/pytorch/pytorch/issues/74968 | ||||
|     # shellcheck disable=SC2046 | ||||
|     sed -i 's/.*nvidia.*/# &/' $(find /etc/apt/ -type f -name "*.list") | ||||
|  | ||||
|     retry apt-get update | ||||
|     retry apt-get -y install zip openssl | ||||
| else | ||||
| @ -97,7 +98,6 @@ if [[ -z "$PYTORCH_ROOT" ]]; then | ||||
|     exit 1 | ||||
| fi | ||||
| pushd "$PYTORCH_ROOT" | ||||
| retry pip install -qUr requirements-build.txt | ||||
| python setup.py clean | ||||
| retry pip install -qr requirements.txt | ||||
| case ${DESIRED_PYTHON} in | ||||
| @ -151,7 +151,7 @@ if [[ "$USE_SPLIT_BUILD" == "true" ]]; then | ||||
|     BUILD_LIBTORCH_WHL=0 BUILD_PYTHON_ONLY=1 \ | ||||
|     BUILD_LIBTORCH_CPU_WITH_DEBUG=$BUILD_DEBUG_INFO \ | ||||
|     USE_NCCL=${USE_NCCL} USE_RCCL=${USE_RCCL} USE_KINETO=${USE_KINETO} \ | ||||
|     CMAKE_FRESH=1 python setup.py bdist_wheel -d /tmp/$WHEELHOUSE_DIR | ||||
|     python setup.py bdist_wheel -d /tmp/$WHEELHOUSE_DIR --cmake | ||||
|     echo "Finished setup.py bdist_wheel for split build (BUILD_PYTHON_ONLY)" | ||||
| else | ||||
|     time CMAKE_ARGS=${CMAKE_ARGS[@]} \ | ||||
|  | ||||
| @ -51,23 +51,20 @@ else | ||||
| fi | ||||
|  | ||||
| cuda_version_nodot=$(echo $CUDA_VERSION | tr -d '.') | ||||
| EXTRA_CAFFE2_CMAKE_FLAGS+=("-DATEN_NO_TEST=ON") | ||||
|  | ||||
| TORCH_CUDA_ARCH_LIST="5.0;6.0;7.0;7.5;8.0;8.6" | ||||
| case ${CUDA_VERSION} in | ||||
|     #removing sm_50-sm_60 as these architectures are deprecated in CUDA 12.8/9 and will be removed in future releases | ||||
|     #however we would like to keep sm_70 architecture see: https://github.com/pytorch/pytorch/issues/157517 | ||||
|     12.8) | ||||
|         TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;9.0;10.0;12.0" | ||||
|         ;; | ||||
|     12.9) | ||||
|         TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX" | ||||
|         # WAR to resolve the ld error in libtorch build with CUDA 12.9 | ||||
|         if [[ "$PACKAGE_TYPE" == "libtorch" ]]; then | ||||
|             TORCH_CUDA_ARCH_LIST="7.5;8.0;9.0;10.0;12.0+PTX" | ||||
|         fi | ||||
|         TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;9.0;10.0;12.0+PTX" #removing sm_50-sm_70 as these architectures are deprecated in CUDA 12.8 and will be removed in future releases | ||||
|         EXTRA_CAFFE2_CMAKE_FLAGS+=("-DATEN_NO_TEST=ON") | ||||
|         ;; | ||||
|     12.6) | ||||
|         TORCH_CUDA_ARCH_LIST="5.0;6.0;7.0;7.5;8.0;8.6;9.0" | ||||
|         TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST};9.0" | ||||
|         EXTRA_CAFFE2_CMAKE_FLAGS+=("-DATEN_NO_TEST=ON") | ||||
|         ;; | ||||
|     11.8) | ||||
|         TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST};3.7;9.0" | ||||
|         EXTRA_CAFFE2_CMAKE_FLAGS+=("-DATEN_NO_TEST=ON") | ||||
|         ;; | ||||
|     *) | ||||
|         echo "unknown cuda version $CUDA_VERSION" | ||||
| @ -110,11 +107,12 @@ DEPS_SONAME=( | ||||
| ) | ||||
|  | ||||
|  | ||||
| # CUDA_VERSION 12.6, 12.8, 12.9 | ||||
| # CUDA_VERSION 12.6, 12.8 | ||||
| if [[ $CUDA_VERSION == 12* ]]; then | ||||
|     export USE_STATIC_CUDNN=0 | ||||
|     # Try parallelizing nvcc as well | ||||
|     export TORCH_NVCC_FLAGS="-Xfatbin -compress-all --threads 2" | ||||
|  | ||||
|     if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then | ||||
|         echo "Bundling with cudnn and cublas." | ||||
|         DEPS_LIST+=( | ||||
| @ -130,12 +128,11 @@ if [[ $CUDA_VERSION == 12* ]]; then | ||||
|             "/usr/local/cuda/lib64/libcublasLt.so.12" | ||||
|             "/usr/local/cuda/lib64/libcusparseLt.so.0" | ||||
|             "/usr/local/cuda/lib64/libcudart.so.12" | ||||
|             "/usr/local/cuda/lib64/libnvToolsExt.so.1" | ||||
|             "/usr/local/cuda/lib64/libnvrtc.so.12" | ||||
|             "/usr/local/cuda/lib64/libnvrtc-builtins.so" | ||||
|             "/usr/local/cuda/lib64/libcufile.so.0" | ||||
|             "/usr/local/cuda/lib64/libcufile_rdma.so.1" | ||||
|             "/usr/local/cuda/extras/CUPTI/lib64/libcupti.so.12" | ||||
|             "/usr/local/cuda/extras/CUPTI/lib64/libnvperf_host.so" | ||||
|         ) | ||||
|         DEPS_SONAME+=( | ||||
|             "libcudnn_adv.so.9" | ||||
| @ -150,18 +147,12 @@ if [[ $CUDA_VERSION == 12* ]]; then | ||||
|             "libcublasLt.so.12" | ||||
|             "libcusparseLt.so.0" | ||||
|             "libcudart.so.12" | ||||
|             "libnvToolsExt.so.1" | ||||
|             "libnvrtc.so.12" | ||||
|             "libnvrtc-builtins.so" | ||||
|             "libcufile.so.0" | ||||
|             "libcufile_rdma.so.1" | ||||
|             "libcupti.so.12" | ||||
|             "libnvperf_host.so" | ||||
|         ) | ||||
|         # Add libnvToolsExt only if CUDA version is not 12.9 | ||||
|         if [[ $CUDA_VERSION != 12.9* ]]; then | ||||
|             DEPS_LIST+=("/usr/local/cuda/lib64/libnvToolsExt.so.1") | ||||
|             DEPS_SONAME+=("libnvToolsExt.so.1") | ||||
|         fi | ||||
|     else | ||||
|         echo "Using nvidia libs from pypi." | ||||
|         CUDA_RPATHS=( | ||||
| @ -174,7 +165,6 @@ if [[ $CUDA_VERSION == 12* ]]; then | ||||
|             '$ORIGIN/../../nvidia/curand/lib' | ||||
|             '$ORIGIN/../../nvidia/cusolver/lib' | ||||
|             '$ORIGIN/../../nvidia/cusparse/lib' | ||||
|             '$ORIGIN/../../nvidia/cusparselt/lib' | ||||
|             '$ORIGIN/../../cusparselt/lib' | ||||
|             '$ORIGIN/../../nvidia/nccl/lib' | ||||
|             '$ORIGIN/../../nvidia/nvshmem/lib' | ||||
| @ -190,6 +180,85 @@ if [[ $CUDA_VERSION == 12* ]]; then | ||||
|         export USE_CUDA_STATIC_LINK=0 | ||||
|         export USE_CUPTI_SO=1 | ||||
|     fi | ||||
| elif [[ $CUDA_VERSION == "11.8" ]]; then | ||||
|     export USE_STATIC_CUDNN=0 | ||||
|     # Turn USE_CUFILE off for CUDA 11.8 since nvidia-cufile-cu11 and 1.9.0.20 are | ||||
|     # not available in PYPI | ||||
|     export USE_CUFILE=0 | ||||
|     # Try parallelizing nvcc as well | ||||
|     export TORCH_NVCC_FLAGS="-Xfatbin -compress-all --threads 2" | ||||
|     # Bundle ptxas into the wheel, see https://github.com/pytorch/pytorch/pull/119750 | ||||
|     export BUILD_BUNDLE_PTXAS=1 | ||||
|  | ||||
|     # CUDA 11.8 have to ship the libcusparseLt.so.0 with the binary | ||||
|     # since nvidia-cusparselt-cu11 is not available in PYPI | ||||
|     if [[ $USE_CUSPARSELT == "1" ]]; then | ||||
|         DEPS_SONAME+=( | ||||
|             "libcusparseLt.so.0" | ||||
|         ) | ||||
|         DEPS_LIST+=( | ||||
|             "/usr/local/cuda/lib64/libcusparseLt.so.0" | ||||
|         ) | ||||
|     fi | ||||
|  | ||||
|     if [[ -z "$PYTORCH_EXTRA_INSTALL_REQUIREMENTS" ]]; then | ||||
|         echo "Bundling with cudnn and cublas." | ||||
|         DEPS_LIST+=( | ||||
|             "/usr/local/cuda/lib64/libcudnn_adv.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_cnn.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_graph.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_ops.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_engines_runtime_compiled.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_engines_precompiled.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn_heuristic.so.9" | ||||
|             "/usr/local/cuda/lib64/libcudnn.so.9" | ||||
|             "/usr/local/cuda/lib64/libcublas.so.11" | ||||
|             "/usr/local/cuda/lib64/libcublasLt.so.11" | ||||
|             "/usr/local/cuda/lib64/libcudart.so.11.0" | ||||
|             "/usr/local/cuda/lib64/libnvToolsExt.so.1" | ||||
|             "/usr/local/cuda/lib64/libnvrtc.so.11.2"    # this is not a mistake, it links to more specific cuda version | ||||
|             "/usr/local/cuda/lib64/libnvrtc-builtins.so.11.8" | ||||
|         ) | ||||
|         DEPS_SONAME+=( | ||||
|             "libcudnn_adv.so.9" | ||||
|             "libcudnn_cnn.so.9" | ||||
|             "libcudnn_graph.so.9" | ||||
|             "libcudnn_ops.so.9" | ||||
|             "libcudnn_engines_runtime_compiled.so.9" | ||||
|             "libcudnn_engines_precompiled.so.9" | ||||
|             "libcudnn_heuristic.so.9" | ||||
|             "libcudnn.so.9" | ||||
|             "libcublas.so.11" | ||||
|             "libcublasLt.so.11" | ||||
|             "libcudart.so.11.0" | ||||
|             "libnvToolsExt.so.1" | ||||
|             "libnvrtc.so.11.2" | ||||
|             "libnvrtc-builtins.so.11.8" | ||||
|         ) | ||||
|     else | ||||
|         echo "Using nvidia libs from pypi." | ||||
|         CUDA_RPATHS=( | ||||
|             '$ORIGIN/../../nvidia/cublas/lib' | ||||
|             '$ORIGIN/../../nvidia/cuda_cupti/lib' | ||||
|             '$ORIGIN/../../nvidia/cuda_nvrtc/lib' | ||||
|             '$ORIGIN/../../nvidia/cuda_runtime/lib' | ||||
|             '$ORIGIN/../../nvidia/cudnn/lib' | ||||
|             '$ORIGIN/../../nvidia/cufft/lib' | ||||
|             '$ORIGIN/../../nvidia/curand/lib' | ||||
|             '$ORIGIN/../../nvidia/cusolver/lib' | ||||
|             '$ORIGIN/../../nvidia/cusparse/lib' | ||||
|             '$ORIGIN/../../nvidia/nccl/lib' | ||||
|             '$ORIGIN/../../nvidia/nvtx/lib' | ||||
|         ) | ||||
|         CUDA_RPATHS=$(IFS=: ; echo "${CUDA_RPATHS[*]}") | ||||
|         export C_SO_RPATH=$CUDA_RPATHS':$ORIGIN:$ORIGIN/lib' | ||||
|         export LIB_SO_RPATH=$CUDA_RPATHS':$ORIGIN' | ||||
|         export FORCE_RPATH="--force-rpath" | ||||
|         export USE_STATIC_NCCL=0 | ||||
|         export ATEN_STATIC_CUDA=0 | ||||
|         export USE_CUDA_STATIC_LINK=0 | ||||
|         export USE_CUPTI_SO=1 | ||||
|     fi | ||||
| else | ||||
|     echo "Unknown cuda version $CUDA_VERSION" | ||||
|     exit 1 | ||||
|  | ||||
| @ -92,7 +92,6 @@ if [[ -z "$PYTORCH_ROOT" ]]; then | ||||
|     exit 1 | ||||
| fi | ||||
| pushd "$PYTORCH_ROOT" | ||||
| retry pip install -qUr requirements-build.txt | ||||
| python setup.py clean | ||||
| retry pip install -qr requirements.txt | ||||
| retry pip install -q numpy==2.0.1 | ||||
| @ -104,7 +103,7 @@ if [[ "$DESIRED_CUDA" == *"rocm"* ]]; then | ||||
|     export ROCclr_DIR=/opt/rocm/rocclr/lib/cmake/rocclr | ||||
| fi | ||||
|  | ||||
| echo "Calling 'python -m pip install .' at $(date)" | ||||
| echo "Calling setup.py install at $(date)" | ||||
|  | ||||
| if [[ $LIBTORCH_VARIANT = *"static"* ]]; then | ||||
|     STATIC_CMAKE_FLAG="-DTORCH_STATIC=1" | ||||
| @ -120,7 +119,7 @@ fi | ||||
|         # TODO: Remove this flag once https://github.com/pytorch/pytorch/issues/55952 is closed | ||||
|         CFLAGS='-Wno-deprecated-declarations' \ | ||||
|         BUILD_LIBTORCH_CPU_WITH_DEBUG=1 \ | ||||
|         python -m pip install --no-build-isolation -v . | ||||
|         python setup.py install | ||||
|  | ||||
|     mkdir -p libtorch/{lib,bin,include,share} | ||||
|  | ||||
|  | ||||
| @ -187,7 +187,7 @@ do | ||||
|     OS_SO_FILES[${#OS_SO_FILES[@]}]=$file_name # Append lib to array | ||||
| done | ||||
|  | ||||
| ARCH=$(echo $PYTORCH_ROCM_ARCH | sed 's/;/|/g') # Replace ; separated arch list to bar for grep | ||||
| ARCH=$(echo $PYTORCH_ROCM_ARCH | sed 's/;/|/g') # Replace ; seperated arch list to bar for grep | ||||
|  | ||||
| # rocBLAS library files | ||||
| ROCBLAS_LIB_SRC=$ROCM_HOME/lib/rocblas/library | ||||
|  | ||||
| @ -19,7 +19,7 @@ git config --global --add safe.directory /var/lib/jenkins/workspace | ||||
|  | ||||
| if [[ "$BUILD_ENVIRONMENT" == *onnx* ]]; then | ||||
|   # TODO: This can be removed later once vision is also part of the Docker image | ||||
|   pip install -q --no-use-pep517 "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)" | ||||
|   pip install -q --user --no-use-pep517 "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)" | ||||
|   # JIT C++ extensions require ninja, so put it into PATH. | ||||
|   export PATH="/var/lib/jenkins/.local/bin:$PATH" | ||||
|   # NB: ONNX test is fast (~15m) so it's ok to retry it few more times to avoid any flaky issue, we | ||||
|  | ||||
							
								
								
									
										34
									
								
								.ci/pytorch/build-mobile.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										34
									
								
								.ci/pytorch/build-mobile.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,34 @@ | ||||
| #!/usr/bin/env bash | ||||
| # DO NOT ADD 'set -x' not to reveal CircleCI secret context environment variables | ||||
| set -eu -o pipefail | ||||
|  | ||||
| # This script uses linux host toolchain + mobile build options in order to | ||||
| # build & test mobile libtorch without having to setup Android/iOS | ||||
| # toolchain/simulator. | ||||
|  | ||||
| # shellcheck source=./common.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/common.sh" | ||||
| # shellcheck source=./common-build.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/common-build.sh" | ||||
|  | ||||
| # Install torch & torchvision - used to download & trace test model. | ||||
| # Ideally we should use the libtorch built on the PR so that backward | ||||
| # incompatible changes won't break this script - but it will significantly slow | ||||
| # down mobile CI jobs. | ||||
| # Here we install nightly instead of stable so that we have an option to | ||||
| # temporarily skip mobile CI jobs on BC-breaking PRs until they are in nightly. | ||||
| retry pip install --pre torch torchvision \ | ||||
|   -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html \ | ||||
|   --progress-bar off | ||||
|  | ||||
| # Run end-to-end process of building mobile library, linking into the predictor | ||||
| # binary, and running forward pass with a real model. | ||||
| if [[ "$BUILD_ENVIRONMENT" == *-mobile-custom-build-static* ]]; then | ||||
|   TEST_CUSTOM_BUILD_STATIC=1 test/mobile/custom_build/build.sh | ||||
| elif [[ "$BUILD_ENVIRONMENT" == *-mobile-lightweight-dispatch* ]]; then | ||||
|   test/mobile/lightweight_dispatch/build.sh | ||||
| else | ||||
|   TEST_DEFAULT_BUILD=1 test/mobile/custom_build/build.sh | ||||
| fi | ||||
|  | ||||
| print_sccache_stats | ||||
| @ -11,6 +11,10 @@ source "$(dirname "${BASH_SOURCE[0]}")/common.sh" | ||||
| # shellcheck source=./common-build.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/common-build.sh" | ||||
|  | ||||
| if [[ "$BUILD_ENVIRONMENT" == *-mobile-*build* ]]; then | ||||
|   exec "$(dirname "${BASH_SOURCE[0]}")/build-mobile.sh" "$@" | ||||
| fi | ||||
|  | ||||
| echo "Python version:" | ||||
| python --version | ||||
|  | ||||
| @ -23,12 +27,6 @@ cmake --version | ||||
| echo "Environment variables:" | ||||
| env | ||||
|  | ||||
| # The sccache wrapped version of nvcc gets put in /opt/cache/lib in docker since | ||||
| # there are some issues if it is always wrapped, so we need to add it to PATH | ||||
| # during CI builds. | ||||
| # https://github.com/pytorch/pytorch/blob/0b6c0898e6c352c8ea93daec854e704b41485375/.ci/docker/common/install_cache.sh#L97 | ||||
| export PATH="/opt/cache/lib:$PATH" | ||||
|  | ||||
| if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then | ||||
|   # Use jemalloc during compilation to mitigate https://github.com/pytorch/pytorch/issues/116289 | ||||
|   export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 | ||||
| @ -120,8 +118,26 @@ if [[ "$BUILD_ENVIRONMENT" == *libtorch* ]]; then | ||||
| fi | ||||
|  | ||||
| # Use special scripts for Android builds | ||||
| if [[ "${BUILD_ENVIRONMENT}" == *-android* ]]; then | ||||
|   export ANDROID_NDK=/opt/ndk | ||||
|   build_args=() | ||||
|   if [[ "${BUILD_ENVIRONMENT}" == *-arm-v7a* ]]; then | ||||
|     build_args+=("-DANDROID_ABI=armeabi-v7a") | ||||
|   elif [[ "${BUILD_ENVIRONMENT}" == *-arm-v8a* ]]; then | ||||
|     build_args+=("-DANDROID_ABI=arm64-v8a") | ||||
|   elif [[ "${BUILD_ENVIRONMENT}" == *-x86_32* ]]; then | ||||
|     build_args+=("-DANDROID_ABI=x86") | ||||
|   elif [[ "${BUILD_ENVIRONMENT}" == *-x86_64* ]]; then | ||||
|     build_args+=("-DANDROID_ABI=x86_64") | ||||
|   fi | ||||
|   if [[ "${BUILD_ENVIRONMENT}" == *vulkan* ]]; then | ||||
|     build_args+=("-DUSE_VULKAN=ON") | ||||
|   fi | ||||
|   build_args+=("-DUSE_LITE_INTERPRETER_PROFILER=OFF") | ||||
|   exec ./scripts/build_android.sh "${build_args[@]}" "$@" | ||||
| fi | ||||
|  | ||||
| if [[ "$BUILD_ENVIRONMENT" == *vulkan* ]]; then | ||||
| if [[ "$BUILD_ENVIRONMENT" != *android* && "$BUILD_ENVIRONMENT" == *vulkan* ]]; then | ||||
|   export USE_VULKAN=1 | ||||
|   # shellcheck disable=SC1091 | ||||
|   source /var/lib/jenkins/vulkansdk/setup-env.sh | ||||
| @ -176,8 +192,10 @@ fi | ||||
|  | ||||
| # We only build FlashAttention files for CUDA 8.0+, and they require large amounts of | ||||
| # memory to build and will OOM | ||||
| if [[ "$BUILD_ENVIRONMENT" == *cuda* ]] && [[ 1 -eq $(echo "${TORCH_CUDA_ARCH_LIST} >= 8.0" | bc) ]]; then | ||||
|   export BUILD_CUSTOM_STEP="ninja -C build flash_attention -j 2" | ||||
| if [[ "$BUILD_ENVIRONMENT" == *cuda* ]] && [[ 1 -eq $(echo "${TORCH_CUDA_ARCH_LIST} >= 8.0" | bc) ]] && [ -z "$MAX_JOBS_OVERRIDE" ]; then | ||||
|   echo "WARNING: FlashAttention files require large amounts of memory to build and will OOM" | ||||
|   echo "Setting MAX_JOBS=(nproc-2)/3 to reduce memory usage" | ||||
|   export MAX_JOBS="$(( $(nproc --ignore=2) / 3 ))" | ||||
| fi | ||||
|  | ||||
| if [[ "${BUILD_ENVIRONMENT}" == *clang* ]]; then | ||||
| @ -203,7 +221,7 @@ if [[ "${BUILD_ENVIRONMENT}" == *-pch* ]]; then | ||||
|     export USE_PRECOMPILED_HEADERS=1 | ||||
| fi | ||||
|  | ||||
| if [[ "${BUILD_ENVIRONMENT}" != *cuda* ]]; then | ||||
| if [[ "${BUILD_ENVIRONMENT}" != *android* && "${BUILD_ENVIRONMENT}" != *cuda* ]]; then | ||||
|   export BUILD_STATIC_RUNTIME_BENCHMARK=ON | ||||
| fi | ||||
|  | ||||
| @ -233,7 +251,6 @@ if [[ "$BUILD_ENVIRONMENT" == *-bazel-* ]]; then | ||||
|   set -e -o pipefail | ||||
|  | ||||
|   get_bazel | ||||
|   python3 tools/optional_submodules.py checkout_eigen | ||||
|  | ||||
|   # Leave 1 CPU free and use only up to 80% of memory to reduce the change of crashing | ||||
|   # the runner | ||||
| @ -284,22 +301,6 @@ else | ||||
|     fi | ||||
|     pip_install_whl "$(echo dist/*.whl)" | ||||
|  | ||||
|     if [[ "${BUILD_ADDITIONAL_PACKAGES:-}" == *vision* ]]; then | ||||
|       install_torchvision | ||||
|     fi | ||||
|  | ||||
|     if [[ "${BUILD_ADDITIONAL_PACKAGES:-}" == *audio* ]]; then | ||||
|       install_torchaudio | ||||
|     fi | ||||
|  | ||||
|     if [[ "${BUILD_ADDITIONAL_PACKAGES:-}" == *torchrec* || "${BUILD_ADDITIONAL_PACKAGES:-}" == *fbgemm* ]]; then | ||||
|       install_torchrec_and_fbgemm | ||||
|     fi | ||||
|  | ||||
|     if [[ "${BUILD_ADDITIONAL_PACKAGES:-}" == *torchao* ]]; then | ||||
|       install_torchao | ||||
|     fi | ||||
|  | ||||
|     if [[ "$BUILD_ENVIRONMENT" == *xpu* ]]; then | ||||
|       echo "Checking that xpu is compiled" | ||||
|       pushd dist/ | ||||
| @ -387,8 +388,10 @@ else | ||||
|     # This is an attempt to mitigate flaky libtorch build OOM error. By default, the build parallelization | ||||
|     # is set to be the number of CPU minus 2. So, let's try a more conservative value here. A 4xlarge has | ||||
|     # 16 CPUs | ||||
|     MAX_JOBS=$(nproc --ignore=4) | ||||
|     export MAX_JOBS | ||||
|     if [ -z "$MAX_JOBS_OVERRIDE" ]; then | ||||
|       MAX_JOBS=$(nproc --ignore=4) | ||||
|       export MAX_JOBS | ||||
|     fi | ||||
|  | ||||
|     # NB: Install outside of source directory (at the same level as the root | ||||
|     # pytorch folder) so that it doesn't get cleaned away prior to docker push. | ||||
|  | ||||
| @ -313,7 +313,7 @@ if [[ "$(uname)" == 'Linux' &&  "$PACKAGE_TYPE" == 'manywheel' ]]; then | ||||
|   # Please see issue for reference: https://github.com/pytorch/pytorch/issues/152426 | ||||
|   if [[ "$(uname -m)" == "s390x" ]]; then | ||||
|     cxx_abi="19" | ||||
|   elif [[ "$DESIRED_CUDA" != 'xpu' && "$DESIRED_CUDA" != 'rocm'* ]]; then | ||||
|   elif [[ "$DESIRED_CUDA" != 'cu118' && "$DESIRED_CUDA" != 'xpu' && "$DESIRED_CUDA" != 'rocm'* ]]; then | ||||
|     cxx_abi="18" | ||||
|   else | ||||
|     cxx_abi="16" | ||||
|  | ||||
| @ -13,13 +13,6 @@ if [[ "$BUILD_ENVIRONMENT" != *win-* ]]; then | ||||
|     fi | ||||
|  | ||||
|     if which sccache > /dev/null; then | ||||
|         # Clear SCCACHE_BUCKET and SCCACHE_REGION if they are empty, otherwise | ||||
|         # sccache will complain about invalid bucket configuration | ||||
|         if [[ -z "${SCCACHE_BUCKET:-}" ]]; then | ||||
|           unset SCCACHE_BUCKET | ||||
|           unset SCCACHE_REGION | ||||
|         fi | ||||
|  | ||||
|         # Save sccache logs to file | ||||
|         sccache --stop-server > /dev/null  2>&1 || true | ||||
|         rm -f ~/sccache_error.log || true | ||||
|  | ||||
| @ -15,6 +15,6 @@ if [[ "${BUILD_ENVIRONMENT}" == *rocm* ]]; then | ||||
|   export PYTORCH_TEST_WITH_ROCM=1 | ||||
| fi | ||||
|  | ||||
| # TODO: Reenable libtorch testing for MacOS, see https://github.com/pytorch/pytorch/issues/62598 | ||||
| # TODO: Renable libtorch testing for MacOS, see https://github.com/pytorch/pytorch/issues/62598 | ||||
| # shellcheck disable=SC2034 | ||||
| BUILD_TEST_LIBTORCH=0 | ||||
|  | ||||
| @ -78,34 +78,6 @@ function pip_install_whl() { | ||||
|   fi | ||||
| } | ||||
|  | ||||
| function pip_build_and_install() { | ||||
|   local build_target=$1 | ||||
|   local wheel_dir=$2 | ||||
|  | ||||
|   local found_whl=0 | ||||
|   for file in "${wheel_dir}"/*.whl | ||||
|   do | ||||
|     if [[ -f "${file}" ]]; then | ||||
|       found_whl=1 | ||||
|       break | ||||
|     fi | ||||
|   done | ||||
|  | ||||
|   # Build the wheel if it doesn't exist | ||||
|   if [ "${found_whl}" == "0" ]; then | ||||
|     python3 -m pip wheel \ | ||||
|       --no-build-isolation \ | ||||
|       --no-deps \ | ||||
|       --no-use-pep517 \ | ||||
|       -w "${wheel_dir}" \ | ||||
|       "${build_target}" | ||||
|   fi | ||||
|  | ||||
|   for file in "${wheel_dir}"/*.whl | ||||
|   do | ||||
|     pip_install_whl "${file}" | ||||
|   done | ||||
| } | ||||
|  | ||||
| function pip_install() { | ||||
|   # retry 3 times | ||||
| @ -152,7 +124,14 @@ function get_pinned_commit() { | ||||
| function install_torchaudio() { | ||||
|   local commit | ||||
|   commit=$(get_pinned_commit audio) | ||||
|   pip_build_and_install "git+https://github.com/pytorch/audio.git@${commit}" dist/audio | ||||
|   if [[ "$1" == "cuda" ]]; then | ||||
|     # TODO: This is better to be passed as a parameter from _linux-test workflow | ||||
|     # so that it can be consistent with what is set in build | ||||
|     TORCH_CUDA_ARCH_LIST="8.0;8.6" pip_install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${commit}" | ||||
|   else | ||||
|     pip_install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${commit}" | ||||
|   fi | ||||
|  | ||||
| } | ||||
|  | ||||
| function install_torchtext() { | ||||
| @ -160,8 +139,8 @@ function install_torchtext() { | ||||
|   local text_commit | ||||
|   data_commit=$(get_pinned_commit data) | ||||
|   text_commit=$(get_pinned_commit text) | ||||
|   pip_build_and_install "git+https://github.com/pytorch/data.git@${data_commit}" dist/data | ||||
|   pip_build_and_install "git+https://github.com/pytorch/text.git@${text_commit}" dist/text | ||||
|   pip_install --no-use-pep517 --user "git+https://github.com/pytorch/data.git@${data_commit}" | ||||
|   pip_install --no-use-pep517 --user "git+https://github.com/pytorch/text.git@${text_commit}" | ||||
| } | ||||
|  | ||||
| function install_torchvision() { | ||||
| @ -174,19 +153,17 @@ function install_torchvision() { | ||||
|     echo 'char* dlerror(void) { return "";}'|gcc -fpic -shared -o "${HOME}/dlerror.so" -x c - | ||||
|     LD_PRELOAD=${orig_preload}:${HOME}/dlerror.so | ||||
|   fi | ||||
|  | ||||
|   if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then | ||||
|     # Not sure if both are needed, but why not | ||||
|     export FORCE_CUDA=1 | ||||
|     export WITH_CUDA=1 | ||||
|   fi | ||||
|   pip_build_and_install "git+https://github.com/pytorch/vision.git@${commit}" dist/vision | ||||
|  | ||||
|   pip_install --no-use-pep517 --user "git+https://github.com/pytorch/vision.git@${commit}" | ||||
|   if [ -n "${LD_PRELOAD}" ]; then | ||||
|     LD_PRELOAD=${orig_preload} | ||||
|   fi | ||||
| } | ||||
|  | ||||
| function install_tlparse() { | ||||
|   pip_install --user "tlparse==0.3.30" | ||||
|   PATH="$(python -m site --user-base)/bin:$PATH" | ||||
| } | ||||
|  | ||||
| function install_torchrec_and_fbgemm() { | ||||
|   local torchrec_commit | ||||
|   torchrec_commit=$(get_pinned_commit torchrec) | ||||
| @ -201,73 +178,25 @@ function install_torchrec_and_fbgemm() { | ||||
|  | ||||
|   if [[ "$BUILD_ENVIRONMENT" == *rocm* ]] ; then | ||||
|     # install torchrec first because it installs fbgemm nightly on top of rocm fbgemm | ||||
|     pip_build_and_install "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}" dist/torchrec | ||||
|     pip_install --no-use-pep517 --user "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}" | ||||
|     pip_uninstall fbgemm-gpu-nightly | ||||
|  | ||||
|     # Set ROCM_HOME isn't available, use ROCM_PATH if set or /opt/rocm | ||||
|     ROCM_HOME="${ROCM_HOME:-${ROCM_PATH:-/opt/rocm}}" | ||||
|  | ||||
|     # Find rocm_version.h header file for ROCm version extract | ||||
|     rocm_version_h="${ROCM_HOME}/include/rocm-core/rocm_version.h" | ||||
|     if [ ! -f "$rocm_version_h" ]; then | ||||
|         rocm_version_h="${ROCM_HOME}/include/rocm_version.h" | ||||
|     fi | ||||
|  | ||||
|     # Error out if rocm_version.h not found | ||||
|     if [ ! -f "$rocm_version_h" ]; then | ||||
|         echo "Error: rocm_version.h not found in expected locations." >&2 | ||||
|         exit 1 | ||||
|     fi | ||||
|  | ||||
|     # Extract major, minor and patch ROCm version numbers | ||||
|     MAJOR_VERSION=$(grep 'ROCM_VERSION_MAJOR' "$rocm_version_h" | awk '{print $3}') | ||||
|     MINOR_VERSION=$(grep 'ROCM_VERSION_MINOR' "$rocm_version_h" | awk '{print $3}') | ||||
|     PATCH_VERSION=$(grep 'ROCM_VERSION_PATCH' "$rocm_version_h" | awk '{print $3}') | ||||
|     ROCM_INT=$((MAJOR_VERSION * 10000 + MINOR_VERSION * 100 + PATCH_VERSION)) | ||||
|     echo "ROCm version: $ROCM_INT" | ||||
|     export BUILD_ROCM_VERSION="$MAJOR_VERSION.$MINOR_VERSION" | ||||
|  | ||||
|     pip_install tabulate  # needed for newer fbgemm | ||||
|     pip_install patchelf  # needed for rocm fbgemm | ||||
|     pushd /tmp | ||||
|  | ||||
|     local wheel_dir=dist/fbgemm_gpu | ||||
|     local found_whl=0 | ||||
|     for file in "${wheel_dir}"/*.whl | ||||
|     do | ||||
|       if [[ -f "${file}" ]]; then | ||||
|         found_whl=1 | ||||
|         break | ||||
|       fi | ||||
|     done | ||||
|  | ||||
|     # Build the wheel if it doesn't exist | ||||
|     if [ "${found_whl}" == "0" ]; then | ||||
|       git clone --recursive https://github.com/pytorch/fbgemm | ||||
|       pushd fbgemm/fbgemm_gpu | ||||
|       git checkout "${fbgemm_commit}" | ||||
|       python setup.py bdist_wheel \ | ||||
|         --build-variant=rocm \ | ||||
|         -DHIP_ROOT_DIR="${ROCM_PATH}" \ | ||||
|         -DCMAKE_C_FLAGS="-DTORCH_USE_HIP_DSA" \ | ||||
|         -DCMAKE_CXX_FLAGS="-DTORCH_USE_HIP_DSA" | ||||
|       popd | ||||
|  | ||||
|       # Save the wheel before cleaning up | ||||
|       mkdir -p dist/fbgemm_gpu | ||||
|       cp fbgemm/fbgemm_gpu/dist/*.whl dist/fbgemm_gpu | ||||
|     fi | ||||
|  | ||||
|     for file in "${wheel_dir}"/*.whl | ||||
|     do | ||||
|       pip_install_whl "${file}" | ||||
|     done | ||||
|  | ||||
|     rm -rf fbgemm | ||||
|     git clone --recursive https://github.com/pytorch/fbgemm | ||||
|     pushd fbgemm/fbgemm_gpu | ||||
|     git checkout "${fbgemm_commit}" | ||||
|     python setup.py install \ | ||||
|       --package_variant=rocm \ | ||||
|       -DHIP_ROOT_DIR="${ROCM_PATH}" \ | ||||
|       -DCMAKE_C_FLAGS="-DTORCH_USE_HIP_DSA" \ | ||||
|       -DCMAKE_CXX_FLAGS="-DTORCH_USE_HIP_DSA" | ||||
|     popd | ||||
|     rm -rf fbgemm | ||||
|   else | ||||
|     pip_build_and_install "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}" dist/torchrec | ||||
|     pip_build_and_install "git+https://github.com/pytorch/FBGEMM.git@${fbgemm_commit}#subdirectory=fbgemm_gpu" dist/fbgemm_gpu | ||||
|     # See https://github.com/pytorch/pytorch/issues/106971 | ||||
|     CUDA_PATH=/usr/local/cuda-12.1 pip_install --no-use-pep517 --user "git+https://github.com/pytorch/FBGEMM.git@${fbgemm_commit}#egg=fbgemm-gpu&subdirectory=fbgemm_gpu" | ||||
|     pip_install --no-use-pep517 --user "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}" | ||||
|   fi | ||||
| } | ||||
|  | ||||
| @ -310,7 +239,7 @@ function checkout_install_torchbench() { | ||||
| function install_torchao() { | ||||
|   local commit | ||||
|   commit=$(get_pinned_commit torchao) | ||||
|   pip_build_and_install "git+https://github.com/pytorch/ao.git@${commit}" dist/ao | ||||
|   pip_install --no-use-pep517 --user "git+https://github.com/pytorch/ao.git@${commit}" | ||||
| } | ||||
|  | ||||
| function print_sccache_stats() { | ||||
|  | ||||
							
								
								
									
										123
									
								
								.ci/pytorch/create_test_cert.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								.ci/pytorch/create_test_cert.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,123 @@ | ||||
| from datetime import datetime, timedelta, timezone | ||||
| from tempfile import mkdtemp | ||||
|  | ||||
| from cryptography import x509 | ||||
| from cryptography.hazmat.primitives import hashes, serialization | ||||
| from cryptography.hazmat.primitives.asymmetric import rsa | ||||
| from cryptography.x509.oid import NameOID | ||||
|  | ||||
|  | ||||
| temp_dir = mkdtemp() | ||||
| print(temp_dir) | ||||
|  | ||||
|  | ||||
| def genrsa(path): | ||||
|     key = rsa.generate_private_key( | ||||
|         public_exponent=65537, | ||||
|         key_size=2048, | ||||
|     ) | ||||
|     with open(path, "wb") as f: | ||||
|         f.write( | ||||
|             key.private_bytes( | ||||
|                 encoding=serialization.Encoding.PEM, | ||||
|                 format=serialization.PrivateFormat.TraditionalOpenSSL, | ||||
|                 encryption_algorithm=serialization.NoEncryption(), | ||||
|             ) | ||||
|         ) | ||||
|     return key | ||||
|  | ||||
|  | ||||
| def create_cert(path, C, ST, L, O, key): | ||||
|     subject = issuer = x509.Name( | ||||
|         [ | ||||
|             x509.NameAttribute(NameOID.COUNTRY_NAME, C), | ||||
|             x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, ST), | ||||
|             x509.NameAttribute(NameOID.LOCALITY_NAME, L), | ||||
|             x509.NameAttribute(NameOID.ORGANIZATION_NAME, O), | ||||
|         ] | ||||
|     ) | ||||
|     cert = ( | ||||
|         x509.CertificateBuilder() | ||||
|         .subject_name(subject) | ||||
|         .issuer_name(issuer) | ||||
|         .public_key(key.public_key()) | ||||
|         .serial_number(x509.random_serial_number()) | ||||
|         .not_valid_before(datetime.now(timezone.utc)) | ||||
|         .not_valid_after( | ||||
|             # Our certificate will be valid for 10 days | ||||
|             datetime.now(timezone.utc) + timedelta(days=10) | ||||
|         ) | ||||
|         .add_extension( | ||||
|             x509.BasicConstraints(ca=True, path_length=None), | ||||
|             critical=True, | ||||
|         ) | ||||
|         .sign(key, hashes.SHA256()) | ||||
|     ) | ||||
|     # Write our certificate out to disk. | ||||
|     with open(path, "wb") as f: | ||||
|         f.write(cert.public_bytes(serialization.Encoding.PEM)) | ||||
|     return cert | ||||
|  | ||||
|  | ||||
| def create_req(path, C, ST, L, O, key): | ||||
|     csr = ( | ||||
|         x509.CertificateSigningRequestBuilder() | ||||
|         .subject_name( | ||||
|             x509.Name( | ||||
|                 [ | ||||
|                     # Provide various details about who we are. | ||||
|                     x509.NameAttribute(NameOID.COUNTRY_NAME, C), | ||||
|                     x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, ST), | ||||
|                     x509.NameAttribute(NameOID.LOCALITY_NAME, L), | ||||
|                     x509.NameAttribute(NameOID.ORGANIZATION_NAME, O), | ||||
|                 ] | ||||
|             ) | ||||
|         ) | ||||
|         .sign(key, hashes.SHA256()) | ||||
|     ) | ||||
|     with open(path, "wb") as f: | ||||
|         f.write(csr.public_bytes(serialization.Encoding.PEM)) | ||||
|     return csr | ||||
|  | ||||
|  | ||||
| def sign_certificate_request(path, csr_cert, ca_cert, private_ca_key): | ||||
|     cert = ( | ||||
|         x509.CertificateBuilder() | ||||
|         .subject_name(csr_cert.subject) | ||||
|         .issuer_name(ca_cert.subject) | ||||
|         .public_key(csr_cert.public_key()) | ||||
|         .serial_number(x509.random_serial_number()) | ||||
|         .not_valid_before(datetime.now(timezone.utc)) | ||||
|         .not_valid_after( | ||||
|             # Our certificate will be valid for 10 days | ||||
|             datetime.now(timezone.utc) + timedelta(days=10) | ||||
|             # Sign our certificate with our private key | ||||
|         ) | ||||
|         .sign(private_ca_key, hashes.SHA256()) | ||||
|     ) | ||||
|     with open(path, "wb") as f: | ||||
|         f.write(cert.public_bytes(serialization.Encoding.PEM)) | ||||
|     return cert | ||||
|  | ||||
|  | ||||
| ca_key = genrsa(temp_dir + "/ca.key") | ||||
| ca_cert = create_cert( | ||||
|     temp_dir + "/ca.pem", | ||||
|     "US", | ||||
|     "New York", | ||||
|     "New York", | ||||
|     "Gloo Certificate Authority", | ||||
|     ca_key, | ||||
| ) | ||||
|  | ||||
| pkey = genrsa(temp_dir + "/pkey.key") | ||||
| csr = create_req( | ||||
|     temp_dir + "/csr.csr", | ||||
|     "US", | ||||
|     "California", | ||||
|     "San Francisco", | ||||
|     "Gloo Testing Company", | ||||
|     pkey, | ||||
| ) | ||||
|  | ||||
| cert = sign_certificate_request(temp_dir + "/cert.pem", csr, ca_cert, ca_key) | ||||
| @ -5,6 +5,11 @@ set -x | ||||
| # shellcheck source=./macos-common.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/macos-common.sh" | ||||
|  | ||||
| if [[ -n "$CONDA_ENV" ]]; then | ||||
|   # Use binaries under conda environment | ||||
|   export PATH="$CONDA_ENV/bin":$PATH | ||||
| fi | ||||
|  | ||||
| # Test that OpenMP is enabled | ||||
| pushd test | ||||
| if [[ ! $(python -c "import torch; print(int(torch.backends.openmp.is_available()))") == "1" ]]; then | ||||
| @ -185,7 +190,7 @@ torchbench_setup_macos() { | ||||
| } | ||||
|  | ||||
| pip_benchmark_deps() { | ||||
|   python -mpip install --no-input requests cython scikit-learn six | ||||
|   python -mpip install --no-input astunparse requests cython scikit-learn | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -228,52 +233,53 @@ test_torchbench_smoketest() { | ||||
|   mkdir -p "$TEST_REPORTS_DIR" | ||||
|  | ||||
|   local device=mps | ||||
|   local dtypes=(undefined float16 bfloat16 notset) | ||||
|   local dtype=${dtypes[$1]} | ||||
|   local models=(hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152 sam sam_fast pytorch_unet stable_diffusion_text_encoder speech_transformer Super_SloMo doctr_det_predictor doctr_reco_predictor timm_resnet timm_vovnet vgg16) | ||||
|   local models=(hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152 sam pytorch_unet stable_diffusion_text_encoder speech_transformer Super_SloMo doctr_det_predictor doctr_reco_predictor) | ||||
|   local hf_models=(GoogleFnet YituTechConvBert Speech2Text2ForCausalLM) | ||||
|  | ||||
|   for backend in eager inductor; do | ||||
|  | ||||
|     echo "Launching torchbench inference performance run for backend ${backend} and dtype ${dtype}" | ||||
|     local dtype_arg="--${dtype}" | ||||
|     if [ "$dtype" == notset ]; then | ||||
|         dtype_arg="--float32" | ||||
|     fi | ||||
|     touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" | ||||
|     for model in "${models[@]}"; do | ||||
|       PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \ | ||||
|         --performance --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|         --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" || true | ||||
|       if [ "$backend" == "inductor" ]; then | ||||
|         PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \ | ||||
|           --accuracy --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|           --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_accuracy.csv" || true | ||||
|       fi | ||||
|     done | ||||
|     if [ "$backend" == "inductor" ]; then | ||||
|       PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \ | ||||
|         --performance --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|         --output "$TEST_REPORTS_DIR/inductor_${backend}_huggingface_${dtype}_inference_${device}_performance.csv" || true | ||||
|       PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \ | ||||
|         --accuracy --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|         --output "$TEST_REPORTS_DIR/inductor_${backend}_huggingface_${dtype}_inference_${device}_accuracy.csv" || true | ||||
|     fi | ||||
|  | ||||
|     if [ "$dtype" == notset ]; then | ||||
|       for dtype_ in notset amp; do | ||||
|         echo "Launching torchbench training performance run for backend ${backend} and dtype ${dtype_}" | ||||
|         touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype_}_training_${device}_performance.csv" | ||||
|         local dtype_arg="--${dtype_}" | ||||
|         if [ "$dtype_" == notset ]; then | ||||
|     for dtype in notset float16 bfloat16; do | ||||
|       echo "Launching torchbench inference performance run for backend ${backend} and dtype ${dtype}" | ||||
|       local dtype_arg="--${dtype}" | ||||
|       if [ "$dtype" == notset ]; then | ||||
|           dtype_arg="--float32" | ||||
|         fi | ||||
|         for model in "${models[@]}"; do | ||||
|       fi | ||||
|       touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" | ||||
|       for model in "${models[@]}"; do | ||||
|         PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \ | ||||
|           --performance --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|           --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" || true | ||||
|         if [ "$backend" == "inductor" ]; then | ||||
|           PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \ | ||||
|             --performance --only "$model" --backend "$backend" --training --devices "$device" "$dtype_arg" \ | ||||
|             --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype_}_training_${device}_performance.csv" || true | ||||
|         done | ||||
|             --accuracy --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|             --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_accuracy.csv" || true | ||||
|         fi | ||||
|       done | ||||
|     fi | ||||
|       for model in "${hf_models[@]}"; do | ||||
|         if [ "$backend" == "inductor" ]; then | ||||
|           PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \ | ||||
|             --performance --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|             --output "$TEST_REPORTS_DIR/inductor_${backend}_huggingface_${dtype}_inference_${device}_performance.csv" || true | ||||
|           PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \ | ||||
|             --accuracy --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \ | ||||
|             --output "$TEST_REPORTS_DIR/inductor_${backend}_huggingface_${dtype}_inference_${device}_accuracy.csv" || true | ||||
|         fi | ||||
|       done | ||||
|     done | ||||
|  | ||||
|     for dtype in notset amp; do | ||||
|       echo "Launching torchbench training performance run for backend ${backend} and dtype ${dtype}" | ||||
|       touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv" | ||||
|       local dtype_arg="--${dtype}" | ||||
|       if [ "$dtype" == notset ]; then | ||||
|           dtype_arg="--float32" | ||||
|       fi | ||||
|       for model in "${models[@]}"; do | ||||
|         PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \ | ||||
|           --performance --only "$model" --backend "$backend" --training --devices "$device" "$dtype_arg" \ | ||||
|           --output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv" || true | ||||
|       done | ||||
|     done | ||||
|  | ||||
|   done | ||||
|  | ||||
| @ -312,6 +318,8 @@ test_timm_perf() { | ||||
|   echo "timm benchmark on mps device completed" | ||||
| } | ||||
|  | ||||
| install_tlparse | ||||
|  | ||||
| if [[ $TEST_CONFIG == *"perf_all"* ]]; then | ||||
|   test_torchbench_perf | ||||
|   test_hf_perf | ||||
| @ -323,7 +331,7 @@ elif [[ $TEST_CONFIG == *"perf_hf"* ]]; then | ||||
| elif [[ $TEST_CONFIG == *"perf_timm"* ]]; then | ||||
|   test_timm_perf | ||||
| elif [[ $TEST_CONFIG == *"perf_smoketest"* ]]; then | ||||
|   test_torchbench_smoketest "${SHARD_NUMBER}" | ||||
|   test_torchbench_smoketest | ||||
| elif [[ $TEST_CONFIG == *"mps"* ]]; then | ||||
|   test_python_mps | ||||
| elif [[ $NUM_TEST_SHARDS -gt 1 ]]; then | ||||
|  | ||||
							
								
								
									
										18
									
								
								.ci/pytorch/run_glootls_test.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										18
									
								
								.ci/pytorch/run_glootls_test.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,18 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| CREATE_TEST_CERT="$(dirname "${BASH_SOURCE[0]}")/create_test_cert.py" | ||||
| TMP_CERT_DIR=$(python "$CREATE_TEST_CERT") | ||||
|  | ||||
| openssl verify -CAfile "${TMP_CERT_DIR}/ca.pem" "${TMP_CERT_DIR}/cert.pem" | ||||
|  | ||||
| export GLOO_DEVICE_TRANSPORT=TCP_TLS | ||||
| export GLOO_DEVICE_TRANSPORT_TCP_TLS_PKEY=${TMP_CERT_DIR}/pkey.key | ||||
| export GLOO_DEVICE_TRANSPORT_TCP_TLS_CERT=${TMP_CERT_DIR}/cert.pem | ||||
| export GLOO_DEVICE_TRANSPORT_TCP_TLS_CA_FILE=${TMP_CERT_DIR}/ca.pem | ||||
|  | ||||
| time python test/run_test.py --include distributed/test_c10d_gloo --verbose -- ProcessGroupGlooTest | ||||
|  | ||||
| unset GLOO_DEVICE_TRANSPORT | ||||
| unset GLOO_DEVICE_TRANSPORT_TCP_TLS_PKEY | ||||
| unset GLOO_DEVICE_TRANSPORT_TCP_TLS_CERT | ||||
| unset GLOO_DEVICE_TRANSPORT_TCP_TLS_CA_FILE | ||||
| @ -74,13 +74,12 @@ else | ||||
| fi | ||||
|  | ||||
| # Environment initialization | ||||
| retry pip install -qUr requirements-build.txt | ||||
| if [[ "$(uname)" == Darwin ]]; then | ||||
|     # Install the testing dependencies | ||||
|     retry pip install -q future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest | ||||
|     retry pip install -q future hypothesis ${NUMPY_PACKAGE} ${PROTOBUF_PACKAGE} pytest setuptools six typing_extensions pyyaml | ||||
| else | ||||
|     retry pip install -qr requirements.txt || true | ||||
|     retry pip install -q hypothesis protobuf pytest || true | ||||
|     retry pip install -q hypothesis protobuf pytest setuptools || true | ||||
|     numpy_ver=1.15 | ||||
|     case "$(python --version 2>&1)" in | ||||
|       *2* | *3.5* | *3.6*) | ||||
|  | ||||
| @ -93,7 +93,7 @@ def check_lib_symbols_for_abi_correctness(lib: str) -> None: | ||||
|             f"Found pre-cxx11 symbols, but there shouldn't be any, see: {pre_cxx11_symbols[:100]}" | ||||
|         ) | ||||
|     if num_cxx11_symbols < 100: | ||||
|         raise RuntimeError("Didn't find enough cxx11 symbols") | ||||
|         raise RuntimeError("Didn't find enought cxx11 symbols") | ||||
|  | ||||
|  | ||||
| def main() -> None: | ||||
|  | ||||
| @ -276,7 +276,7 @@ def smoke_test_cuda( | ||||
|             torch_nccl_version = ".".join(str(v) for v in torch.cuda.nccl.version()) | ||||
|             print(f"Torch nccl; version: {torch_nccl_version}") | ||||
|  | ||||
|         # Pypi dependencies are installed on linux only and nccl is available only on Linux. | ||||
|         # Pypi dependencies are installed on linux ony and nccl is availbale only on Linux. | ||||
|         if pypi_pkg_check == "enabled" and sys.platform in ["linux", "linux2"]: | ||||
|             compare_pypi_to_torch_versions( | ||||
|                 "cudnn", find_pypi_package_version("nvidia-cudnn"), torch_cudnn_version | ||||
| @ -385,29 +385,6 @@ def smoke_test_compile(device: str = "cpu") -> None: | ||||
|     x_pt2 = torch.compile(model, mode="max-autotune")(x) | ||||
|  | ||||
|  | ||||
| def smoke_test_nvshmem() -> None: | ||||
|     if not torch.cuda.is_available(): | ||||
|         print("CUDA is not available, skipping NVSHMEM test") | ||||
|         return | ||||
|  | ||||
|     # Check if NVSHMEM is compiled in current build | ||||
|     try: | ||||
|         from torch._C._distributed_c10d import _is_nvshmem_available | ||||
|     except ImportError: | ||||
|         # Not built with NVSHMEM support. | ||||
|         # torch is not compiled with NVSHMEM prior to 2.9 | ||||
|         if torch.__version__ < "2.9": | ||||
|             return | ||||
|         else: | ||||
|             # After 2.9: NVSHMEM is expected to be compiled in current build | ||||
|             raise RuntimeError("torch not compiled with NVSHMEM") from None | ||||
|  | ||||
|     print("torch compiled with NVSHMEM") | ||||
|  | ||||
|     # Check if NVSHMEM is available on current system. | ||||
|     print(f"NVSHMEM available at run time: {_is_nvshmem_available()}") | ||||
|  | ||||
|  | ||||
| def smoke_test_modules(): | ||||
|     cwd = os.getcwd() | ||||
|     for module in MODULES: | ||||
| @ -502,8 +479,6 @@ def main() -> None: | ||||
|         options.pypi_pkg_check, | ||||
|     ) | ||||
|  | ||||
|     smoke_test_nvshmem() | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|     main() | ||||
|  | ||||
| @ -11,8 +11,6 @@ export TERM=vt100 | ||||
|  | ||||
| # shellcheck source=./common.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/common.sh" | ||||
| # shellcheck source=./common-build.sh | ||||
| source "$(dirname "${BASH_SOURCE[0]}")/common-build.sh" | ||||
|  | ||||
| # Do not change workspace permissions for ROCm and s390x CI jobs | ||||
| # as it can leave workspace with bad permissions for cancelled jobs | ||||
| @ -165,6 +163,8 @@ elif [[ "$BUILD_ENVIRONMENT" == *xpu* ]]; then | ||||
|   export PYTORCH_TESTING_DEVICE_ONLY_FOR="xpu" | ||||
|   # setting PYTHON_TEST_EXTRA_OPTION | ||||
|   export PYTHON_TEST_EXTRA_OPTION="--xpu" | ||||
|   # Disable sccache for xpu test due to flaky issue https://github.com/pytorch/pytorch/issues/143585 | ||||
|   sudo rm -rf /opt/cache | ||||
| fi | ||||
|  | ||||
| if [[ "$TEST_CONFIG" == *crossref* ]]; then | ||||
| @ -196,12 +196,12 @@ if [[ "$BUILD_ENVIRONMENT" == *xpu* ]]; then | ||||
|   # shellcheck disable=SC1091 | ||||
|   source /opt/intel/oneapi/mpi/latest/env/vars.sh | ||||
|   # Check XPU status before testing | ||||
|   timeout 30 xpu-smi discovery || true | ||||
|   xpu-smi discovery | ||||
| fi | ||||
|  | ||||
| if [[ "$BUILD_ENVIRONMENT" != *-bazel-* ]] ; then | ||||
|   # JIT C++ extensions require ninja. | ||||
|   pip_install "ninja==1.10.2" | ||||
|   pip_install --user "ninja==1.10.2" | ||||
|   # ninja is installed in $HOME/.local/bin, e.g., /var/lib/jenkins/.local/bin for CI user jenkins | ||||
|   # but this script should be runnable by any user, including root | ||||
|   export PATH="$HOME/.local/bin:$PATH" | ||||
| @ -212,6 +212,8 @@ if [[ "$BUILD_ENVIRONMENT" == *aarch64* ]]; then | ||||
|   export VALGRIND=OFF | ||||
| fi | ||||
|  | ||||
| install_tlparse | ||||
|  | ||||
| # DANGER WILL ROBINSON.  The LD_PRELOAD here could cause you problems | ||||
| # if you're not careful.  Check this if you made some changes and the | ||||
| # ASAN test is not working | ||||
| @ -224,7 +226,7 @@ if [[ "$BUILD_ENVIRONMENT" == *asan* ]]; then | ||||
|     export PYTORCH_TEST_WITH_ASAN=1 | ||||
|     export PYTORCH_TEST_WITH_UBSAN=1 | ||||
|     # TODO: Figure out how to avoid hard-coding these paths | ||||
|     export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-18/bin/llvm-symbolizer | ||||
|     export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-15/bin/llvm-symbolizer | ||||
|     export TORCH_USE_RTLD_GLOBAL=1 | ||||
|     # NB: We load libtorch.so with RTLD_GLOBAL for UBSAN, unlike our | ||||
|     # default behavior. | ||||
| @ -289,12 +291,6 @@ elif [[ $TEST_CONFIG == 'nogpu_AVX512' ]]; then | ||||
|   export ATEN_CPU_CAPABILITY=avx2 | ||||
| fi | ||||
|  | ||||
| if [[ "${TEST_CONFIG}" == "legacy_nvidia_driver" ]]; then | ||||
|   # Make sure that CUDA can be initialized | ||||
|   (cd test && python -c "import torch; torch.rand(2, 2, device='cuda')") | ||||
|   export USE_LEGACY_DRIVER=1 | ||||
| fi | ||||
|  | ||||
| test_python_legacy_jit() { | ||||
|   time python test/run_test.py --include test_jit_legacy test_jit_fuser_legacy --verbose | ||||
|   assert_git_not_dirty | ||||
| @ -331,26 +327,9 @@ test_python_smoke() { | ||||
| test_h100_distributed() { | ||||
|   # Distributed tests at H100 | ||||
|   time python test/run_test.py --include distributed/_composable/test_composability/test_pp_composability.py  $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   # This test requires multicast support | ||||
|   time python test/run_test.py --include distributed/_composable/fsdp/test_fully_shard_comm.py -k TestFullyShardAllocFromPG $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   assert_git_not_dirty | ||||
| } | ||||
|  | ||||
| test_h100_symm_mem() { | ||||
|   # symmetric memory test | ||||
|   time python test/run_test.py --include distributed/test_symmetric_memory.py  $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   time python test/run_test.py --include distributed/test_nvshmem.py $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   time python test/run_test.py --include distributed/test_nvshmem_triton.py $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   time python test/run_test.py --include distributed/test_nccl.py $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   assert_git_not_dirty | ||||
| } | ||||
|  | ||||
| test_h100_cutlass_backend() { | ||||
|   # cutlass backend tests for H100 | ||||
|   TORCHINDUCTOR_CUTLASS_DIR=$(realpath "./third_party/cutlass") python test/run_test.py --include inductor/test_cutlass_backend -k "not addmm" $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
|   TORCHINDUCTOR_CUTLASS_DIR=$(realpath "./third_party/cutlass") python test/run_test.py --include inductor/test_cutlass_evt $PYTHON_TEST_EXTRA_OPTION --upload-artifacts-while-running | ||||
| } | ||||
|  | ||||
| test_lazy_tensor_meta_reference_disabled() { | ||||
|   export TORCH_DISABLE_FUNCTIONALIZATION_META_REFERENCE=1 | ||||
|   echo "Testing lazy tensor operations without meta reference" | ||||
| @ -379,24 +358,12 @@ test_dynamo_wrapped_shard() { | ||||
|   assert_git_not_dirty | ||||
| } | ||||
|  | ||||
| test_einops() { | ||||
|   pip install einops==0.6.1 | ||||
|   time python test/run_test.py --einops --verbose --upload-artifacts-while-running | ||||
|   pip install einops==0.7.0 | ||||
|   time python test/run_test.py --einops --verbose --upload-artifacts-while-running | ||||
|   pip install einops==0.8.1 | ||||
|   time python test/run_test.py --einops --verbose --upload-artifacts-while-running | ||||
|   assert_git_not_dirty | ||||
| } | ||||
|  | ||||
|  | ||||
| test_inductor_distributed() { | ||||
|   # Smuggle a few multi-gpu tests here so that we don't have to request another large node | ||||
|   echo "Testing multi_gpu tests in test_torchinductor" | ||||
|   python test/run_test.py -i inductor/test_torchinductor.py -k test_multi_gpu --verbose | ||||
|   python test/run_test.py -i inductor/test_aot_inductor.py -k test_non_default_cuda_device --verbose | ||||
|   python test/run_test.py -i inductor/test_aot_inductor.py -k test_replicate_on_devices --verbose | ||||
|   python test/run_test.py -i inductor/test_aot_inductor.py -k test_on_gpu_device1 --verbose | ||||
|   python test/run_test.py -i inductor/test_aot_inductor.py -k test_non_default_gpu_device --verbose | ||||
|   python test/run_test.py -i inductor/test_aot_inductor.py -k test_load_package_multiple_gpus --verbose | ||||
|   python test/run_test.py -i distributed/test_c10d_functional_native.py --verbose | ||||
|   python test/run_test.py -i distributed/tensor/test_dtensor_compile.py --verbose | ||||
|   python test/run_test.py -i distributed/tensor/parallel/test_micro_pipeline_tp.py --verbose | ||||
| @ -448,21 +415,14 @@ test_inductor_aoti() { | ||||
|     python3 tools/amd_build/build_amd.py | ||||
|   fi | ||||
|   if [[ "$BUILD_ENVIRONMENT" == *sm86* ]]; then | ||||
|     BUILD_COMMAND=(TORCH_CUDA_ARCH_LIST=8.6 USE_FLASH_ATTENTION=OFF python -m pip install --no-build-isolation -v -e .) | ||||
|     BUILD_AOT_INDUCTOR_TEST=1 TORCH_CUDA_ARCH_LIST=8.6 USE_FLASH_ATTENTION=OFF python setup.py develop | ||||
|     # TODO: Replace me completely, as one should not use conda libstdc++, nor need special path to TORCH_LIB | ||||
|     TEST_ENVS=(CPP_TESTS_DIR="${BUILD_BIN_DIR}" LD_LIBRARY_PATH="/opt/conda/envs/py_3.10/lib:${TORCH_LIB_DIR}:${LD_LIBRARY_PATH}") | ||||
|     LD_LIBRARY_PATH=/opt/conda/envs/py_3.10/lib/:${TORCH_LIB_DIR}:$LD_LIBRARY_PATH | ||||
|     CPP_TESTS_DIR="${BUILD_BIN_DIR}" python test/run_test.py --cpp --verbose -i cpp/test_aoti_abi_check cpp/test_aoti_inference -dist=loadfile | ||||
|   else | ||||
|     BUILD_COMMAND=(python -m pip install --no-build-isolation -v -e .) | ||||
|     TEST_ENVS=(CPP_TESTS_DIR="${BUILD_BIN_DIR}" LD_LIBRARY_PATH="${TORCH_LIB_DIR}") | ||||
|     BUILD_AOT_INDUCTOR_TEST=1 python setup.py develop | ||||
|     CPP_TESTS_DIR="${BUILD_BIN_DIR}" LD_LIBRARY_PATH="${TORCH_LIB_DIR}" python test/run_test.py --cpp --verbose -i cpp/test_aoti_abi_check cpp/test_aoti_inference -dist=loadfile | ||||
|   fi | ||||
|  | ||||
|   # aoti cmake custom command requires `torch` to be installed | ||||
|   # initialize the cmake build cache and install torch | ||||
|   /usr/bin/env "${BUILD_COMMAND[@]}" | ||||
|   # rebuild with the build cache with `BUILD_AOT_INDUCTOR_TEST` enabled | ||||
|   /usr/bin/env CMAKE_FRESH=1 BUILD_AOT_INDUCTOR_TEST=1 "${BUILD_COMMAND[@]}" | ||||
|  | ||||
|   /usr/bin/env "${TEST_ENVS[@]}" python test/run_test.py --cpp --verbose -i cpp/test_aoti_abi_check cpp/test_aoti_inference cpp/test_vec_half_AVX2 -dist=loadfile | ||||
| } | ||||
|  | ||||
| test_inductor_cpp_wrapper_shard() { | ||||
| @ -475,26 +435,47 @@ test_inductor_cpp_wrapper_shard() { | ||||
|   TEST_REPORTS_DIR=$(pwd)/test/test-reports | ||||
|   mkdir -p "$TEST_REPORTS_DIR" | ||||
|  | ||||
|   if [[ "$1" -eq "2" ]]; then | ||||
|     # For now, manually put the opinfo tests in shard 2, and all other tests in | ||||
|     # shard 1.  Run all CPU tests, as well as specific GPU tests triggering past | ||||
|     # bugs, for now. | ||||
|     python test/run_test.py \ | ||||
|       --include inductor/test_torchinductor_opinfo \ | ||||
|       -k 'linalg or to_sparse or TestInductorOpInfoCPU' \ | ||||
|       --verbose | ||||
|     exit | ||||
|   fi | ||||
|  | ||||
|   # Run certain inductor unit tests with cpp wrapper. In the end state, we | ||||
|   # should be able to run all the inductor unit tests with cpp_wrapper. | ||||
|   # | ||||
|   # TODO: I'm pretty sure that "TestInductorOpInfoCPU" is not a valid filter, | ||||
|   # but change that in another PR to more accurately monitor the increased CI | ||||
|   # usage. | ||||
|   python test/run_test.py \ | ||||
|     --include inductor/test_torchinductor_opinfo \ | ||||
|     -k 'linalg or to_sparse or TestInductorOpInfoCPU' \ | ||||
|     --shard "$1" "$NUM_TEST_SHARDS" \ | ||||
|     --verbose | ||||
|   python test/run_test.py \ | ||||
|     --include inductor/test_torchinductor inductor/test_max_autotune inductor/test_cpu_repro \ | ||||
|     --shard "$1" "$NUM_TEST_SHARDS" \ | ||||
|     --verbose | ||||
|   python test/run_test.py --inductor \ | ||||
|     --include test_torch \ | ||||
|     -k 'take' \ | ||||
|     --shard "$1" "$NUM_TEST_SHARDS" \ | ||||
|     --verbose | ||||
|   python test/run_test.py --inductor --include test_torch -k 'take' --verbose | ||||
|  | ||||
|   # Run inductor benchmark tests with cpp wrapper. | ||||
|   # Skip benchmark tests if it's in rerun-disabled-mode. | ||||
|   if [[ "${PYTORCH_TEST_RERUN_DISABLED_TESTS}" == "1" ]]; then | ||||
|     echo "skip dynamo benchmark tests for rerun-disabled-test" | ||||
|   else | ||||
|     echo "run dynamo benchmark tests with cpp wrapper" | ||||
|     python benchmarks/dynamo/timm_models.py --device cuda --accuracy --amp \ | ||||
|     --training --inductor --disable-cudagraphs --only vit_base_patch16_224 \ | ||||
|     --output "$TEST_REPORTS_DIR/inductor_cpp_wrapper_training.csv" | ||||
|     python benchmarks/dynamo/check_accuracy.py \ | ||||
|       --actual "$TEST_REPORTS_DIR/inductor_cpp_wrapper_training.csv" \ | ||||
|       --expected "benchmarks/dynamo/ci_expected_accuracy/${MAYBE_ROCM}inductor_timm_training.csv" | ||||
|  | ||||
|     python benchmarks/dynamo/torchbench.py --device cuda --accuracy \ | ||||
|       --bfloat16 --inference --inductor --only hf_T5 --output "$TEST_REPORTS_DIR/inductor_cpp_wrapper_inference.csv" | ||||
|     python benchmarks/dynamo/torchbench.py --device cuda --accuracy \ | ||||
|       --bfloat16 --inference --inductor --only llama --output "$TEST_REPORTS_DIR/inductor_cpp_wrapper_inference.csv" | ||||
|     python benchmarks/dynamo/torchbench.py --device cuda --accuracy \ | ||||
|       --bfloat16 --inference --inductor --only moco --output "$TEST_REPORTS_DIR/inductor_cpp_wrapper_inference.csv" | ||||
|     python benchmarks/dynamo/check_accuracy.py \ | ||||
|       --actual "$TEST_REPORTS_DIR/inductor_cpp_wrapper_inference.csv" \ | ||||
|       --expected "benchmarks/dynamo/ci_expected_accuracy/${MAYBE_ROCM}inductor_torchbench_inference.csv" | ||||
|   fi | ||||
| } | ||||
|  | ||||
| # "Global" flags for inductor benchmarking controlled by TEST_CONFIG | ||||
| @ -507,7 +488,7 @@ DYNAMO_BENCHMARK_FLAGS=() | ||||
|  | ||||
| pr_time_benchmarks() { | ||||
|  | ||||
|   pip_install "fbscribelogger" | ||||
|   pip_install --user "fbscribelogger" | ||||
|  | ||||
|   TEST_REPORTS_DIR=$(pwd)/test/test-reports | ||||
|   mkdir -p "$TEST_REPORTS_DIR" | ||||
| @ -615,9 +596,7 @@ test_perf_for_dashboard() { | ||||
|  | ||||
|   local device=cuda | ||||
|   if [[ "${TEST_CONFIG}" == *cpu* ]]; then | ||||
|     if [[ "${TEST_CONFIG}" == *cpu_x86_zen* ]]; then | ||||
|       device=cpu_x86_zen | ||||
|     elif [[ "${TEST_CONFIG}" == *cpu_x86* ]]; then | ||||
|     if [[ "${TEST_CONFIG}" == *cpu_x86* ]]; then | ||||
|       device=cpu_x86 | ||||
|     elif [[ "${TEST_CONFIG}" == *cpu_aarch64* ]]; then | ||||
|       device=cpu_aarch64 | ||||
| @ -633,11 +612,7 @@ test_perf_for_dashboard() { | ||||
|  | ||||
|   for mode in "${modes[@]}"; do | ||||
|     if [[ "$mode" == "inference" ]]; then | ||||
|       if [[ "$device" == "cpu_x86" ]]; then | ||||
|         dtype=amp | ||||
|       else | ||||
|         dtype=bfloat16 | ||||
|       fi | ||||
|       dtype=bfloat16 | ||||
|     elif [[ "$mode" == "training" ]]; then | ||||
|       dtype=amp | ||||
|     fi | ||||
| @ -649,10 +624,6 @@ test_perf_for_dashboard() { | ||||
|         target_flag+=( --no-translation-validation) | ||||
|       fi | ||||
|  | ||||
|       if [[ "$DASHBOARD_TAG" == *freezing-true* ]]; then | ||||
|         target_flag+=( --freezing) | ||||
|       fi | ||||
|  | ||||
|       if [[ "$DASHBOARD_TAG" == *default-true* ]]; then | ||||
|         $TASKSET python "benchmarks/dynamo/$suite.py" \ | ||||
|             "${target_flag[@]}" --"$mode" --"$dtype" --backend "$backend" --disable-cudagraphs "$@" \ | ||||
| @ -928,6 +899,12 @@ test_torchbench_gcp_smoketest(){ | ||||
|   popd | ||||
| } | ||||
|  | ||||
| test_python_gloo_with_tls() { | ||||
|   source "$(dirname "${BASH_SOURCE[0]}")/run_glootls_test.sh" | ||||
|   assert_git_not_dirty | ||||
| } | ||||
|  | ||||
|  | ||||
| test_aten() { | ||||
|   # Test ATen | ||||
|   # The following test(s) of ATen have already been skipped by caffe2 in rocm environment: | ||||
| @ -974,8 +951,6 @@ test_without_numpy() { | ||||
|   if [[ "${TEST_CONFIG}" == *dynamo_wrapped* ]]; then | ||||
|     python -c "import sys;sys.path.insert(0, 'fake_numpy');import torch;torch.compile(lambda x:print(x))('Hello World')" | ||||
|   fi | ||||
|   # Regression test for https://github.com/pytorch/pytorch/pull/157734 (torch.onnx should be importable without numpy) | ||||
|   python -c "import sys;sys.path.insert(0, 'fake_numpy');import torch; import torch.onnx" | ||||
|   popd | ||||
| } | ||||
|  | ||||
| @ -1162,12 +1137,6 @@ test_custom_backend() { | ||||
|  | ||||
| test_custom_script_ops() { | ||||
|   echo "Testing custom script operators" | ||||
|  | ||||
|   if [[ "$BUILD_ENVIRONMENT" == *s390x* ]]; then | ||||
|     echo "Skipping custom script operators until it's fixed" | ||||
|     return 0 | ||||
|   fi | ||||
|  | ||||
|   CUSTOM_OP_BUILD="${CUSTOM_TEST_ARTIFACT_BUILD_DIR}/custom-op-build" | ||||
|   pushd test/custom_operator | ||||
|   cp -a "$CUSTOM_OP_BUILD" build | ||||
| @ -1320,13 +1289,10 @@ EOF | ||||
|  | ||||
|   # Step 2. Make sure that the public API test "test_correct_module_names" fails when an existing | ||||
|   # file is modified to introduce an invalid public API function. | ||||
|   # The filepath here must not have __all__ defined in it, otherwise the test will pass. | ||||
|   # If your PR introduces __all__ to torch/cuda/streams.py please point this to another file | ||||
|   # that does not have __all__ defined. | ||||
|   EXISTING_FILEPATH="${TORCH_INSTALL_DIR}/cuda/streams.py" | ||||
|   EXISTING_FILEPATH="${TORCH_INSTALL_DIR}/nn/parameter.py" | ||||
|   cp -v "${EXISTING_FILEPATH}" "${EXISTING_FILEPATH}.orig" | ||||
|   echo "${BAD_PUBLIC_FUNC}" >> "${EXISTING_FILEPATH}" | ||||
|   invalid_api="torch.cuda.streams.new_public_func" | ||||
|   invalid_api="torch.nn.parameter.new_public_func" | ||||
|   echo "Appended an invalid public API function to existing file ${EXISTING_FILEPATH}..." | ||||
|  | ||||
|   check_public_api_test_fails \ | ||||
| @ -1481,8 +1447,8 @@ test_bazel() { | ||||
|  | ||||
| test_benchmarks() { | ||||
|   if [[ "$BUILD_ENVIRONMENT" == *cuda* && $TEST_CONFIG != *nogpu* ]]; then | ||||
|     pip_install "pytest-benchmark==3.2.3" | ||||
|     pip_install "requests" | ||||
|     pip_install --user "pytest-benchmark==3.2.3" | ||||
|     pip_install --user "requests" | ||||
|     BENCHMARK_DATA="benchmarks/.data" | ||||
|     mkdir -p ${BENCHMARK_DATA} | ||||
|     pytest benchmarks/fastrnns/test_bench.py --benchmark-sort=Name --benchmark-json=${BENCHMARK_DATA}/fastrnns_default.json --fuser=default --executor=default | ||||
| @ -1560,7 +1526,7 @@ test_executorch() { | ||||
| test_linux_aarch64() { | ||||
|   python test/run_test.py --include test_modules test_mkldnn test_mkldnn_fusion test_openmp test_torch test_dynamic_shapes \ | ||||
|         test_transformers test_multiprocessing test_numpy_interop test_autograd test_binary_ufuncs test_complex test_spectral_ops \ | ||||
|         test_foreach test_reductions test_unary_ufuncs test_tensor_creation_ops test_ops \ | ||||
|         test_foreach test_reductions test_unary_ufuncs test_tensor_creation_ops test_ops test_cpp_extensions_open_device_registration \ | ||||
|         --shard "$SHARD_NUMBER" "$NUM_TEST_SHARDS" --verbose | ||||
|  | ||||
|   # Dynamo tests | ||||
| @ -1590,7 +1556,7 @@ test_operator_benchmark() { | ||||
|   test_inductor_set_cpu_affinity | ||||
|  | ||||
|   cd benchmarks/operator_benchmark/pt_extension | ||||
|   python -m pip install . | ||||
|   python setup.py install | ||||
|  | ||||
|   cd "${TEST_DIR}"/benchmarks/operator_benchmark | ||||
|   $TASKSET python -m benchmark_all_test --device "$1" --tag-filter "$2" \ | ||||
| @ -1610,13 +1576,7 @@ if ! [[ "${BUILD_ENVIRONMENT}" == *libtorch* || "${BUILD_ENVIRONMENT}" == *-baze | ||||
| fi | ||||
| if [[ "${TEST_CONFIG}" == *numpy_2* ]]; then | ||||
|   # Install numpy-2.0.2 and compatible scipy & numba versions | ||||
|   # Force re-install of pandas to avoid error where pandas checks numpy version from initial install and fails upon import | ||||
|   TMP_PANDAS_VERSION=$(python -c "import pandas; print(pandas.__version__)" 2>/dev/null) | ||||
|   if [ -n "$TMP_PANDAS_VERSION" ]; then | ||||
|     python -m pip install --pre numpy==2.0.2 scipy==1.13.1 numba==0.60.0 pandas=="$TMP_PANDAS_VERSION" --force-reinstall | ||||
|   else | ||||
|     python -m pip install --pre numpy==2.0.2 scipy==1.13.1 numba==0.60.0 | ||||
|   fi | ||||
|   python -mpip install --pre numpy==2.0.2 scipy==1.13.1 numba==0.60.0 | ||||
|   python test/run_test.py --include dynamo/test_functions.py dynamo/test_unspec.py test_binary_ufuncs.py test_fake_tensor.py test_linalg.py test_numpy_interop.py test_tensor_creation_ops.py test_torch.py torch_np/test_basic.py | ||||
| elif [[ "${BUILD_ENVIRONMENT}" == *aarch64* && "${TEST_CONFIG}" != *perf_cpu_aarch64* ]]; then | ||||
|   test_linux_aarch64 | ||||
| @ -1670,19 +1630,23 @@ elif [[ "${TEST_CONFIG}" == *timm* ]]; then | ||||
|   id=$((SHARD_NUMBER-1)) | ||||
|   test_dynamo_benchmark timm_models "$id" | ||||
| elif [[ "${TEST_CONFIG}" == cachebench ]]; then | ||||
|   install_torchaudio | ||||
|   install_torchaudio cuda | ||||
|   install_torchvision | ||||
|   checkout_install_torchbench nanogpt BERT_pytorch resnet50 hf_T5 llama moco | ||||
|   PYTHONPATH=$(pwd)/torchbench test_cachebench | ||||
| elif [[ "${TEST_CONFIG}" == verify_cachebench ]]; then | ||||
|   install_torchaudio | ||||
|   install_torchaudio cpu | ||||
|   install_torchvision | ||||
|   checkout_install_torchbench nanogpt | ||||
|   PYTHONPATH=$(pwd)/torchbench test_verify_cachebench | ||||
| elif [[ "${TEST_CONFIG}" == *torchbench* ]]; then | ||||
|   install_torchaudio | ||||
|   if [[ "${TEST_CONFIG}" == *cpu* ]]; then | ||||
|     install_torchaudio cpu | ||||
|   else | ||||
|     install_torchaudio cuda | ||||
|   fi | ||||
|   install_torchvision | ||||
|   install_torchao | ||||
|   TORCH_CUDA_ARCH_LIST="8.0;8.6" install_torchao | ||||
|   id=$((SHARD_NUMBER-1)) | ||||
|   # https://github.com/opencv/opencv-python/issues/885 | ||||
|   pip_install opencv-python==4.8.0.74 | ||||
| @ -1707,11 +1671,11 @@ elif [[ "${TEST_CONFIG}" == *torchbench* ]]; then | ||||
|     PYTHONPATH=$(pwd)/torchbench test_dynamo_benchmark torchbench "$id" | ||||
|   fi | ||||
| elif [[ "${TEST_CONFIG}" == *inductor_cpp_wrapper* ]]; then | ||||
|   install_torchaudio cuda | ||||
|   install_torchvision | ||||
|   checkout_install_torchbench hf_T5 llama moco | ||||
|   PYTHONPATH=$(pwd)/torchbench test_inductor_cpp_wrapper_shard "$SHARD_NUMBER" | ||||
|   if [[ "$SHARD_NUMBER" -eq "1" ]]; then | ||||
|     test_inductor_aoti | ||||
|   fi | ||||
|   test_inductor_aoti | ||||
| elif [[ "${TEST_CONFIG}" == *inductor* ]]; then | ||||
|   install_torchvision | ||||
|   test_inductor_shard "${SHARD_NUMBER}" | ||||
| @ -1720,8 +1684,6 @@ elif [[ "${TEST_CONFIG}" == *inductor* ]]; then | ||||
|       test_inductor_distributed | ||||
|     fi | ||||
|   fi | ||||
| elif [[ "${TEST_CONFIG}" == *einops* ]]; then | ||||
|   test_einops | ||||
| elif [[ "${TEST_CONFIG}" == *dynamo_wrapped* ]]; then | ||||
|   install_torchvision | ||||
|   test_dynamo_wrapped_shard "${SHARD_NUMBER}" | ||||
| @ -1771,10 +1733,6 @@ elif [[ "${TEST_CONFIG}" == smoke ]]; then | ||||
|   test_python_smoke | ||||
| elif [[ "${TEST_CONFIG}" == h100_distributed ]]; then | ||||
|   test_h100_distributed | ||||
| elif [[ "${TEST_CONFIG}" == "h100-symm-mem" ]]; then | ||||
|   test_h100_symm_mem | ||||
| elif [[ "${TEST_CONFIG}" == h100_cutlass_backend ]]; then | ||||
|   test_h100_cutlass_backend | ||||
| else | ||||
|   install_torchvision | ||||
|   install_monkeytype | ||||
|  | ||||
| @ -1,34 +0,0 @@ | ||||
| # If you want to rebuild, run this with $env:REBUILD=1 | ||||
| # If you want to build with CUDA, run this with $env:USE_CUDA=1 | ||||
| # If you want to build without CUDA, run this with $env:USE_CUDA=0 | ||||
|  | ||||
| # Check for setup.py in the current directory | ||||
| if (-not (Test-Path "setup.py")) { | ||||
|     Write-Host "ERROR: Please run this build script from PyTorch root directory." | ||||
|     exit 1 | ||||
| } | ||||
|  | ||||
| # Get the script's parent directory | ||||
| $ScriptParentDir = Split-Path -Parent $MyInvocation.MyCommand.Definition | ||||
|  | ||||
| # Set TMP_DIR and convert to Windows path | ||||
| $env:TMP_DIR = Join-Path (Get-Location) "build\win_tmp" | ||||
| $env:TMP_DIR_WIN = $env:TMP_DIR  # Already in Windows format, no cygpath needed | ||||
|  | ||||
| # Set final package directory with default fallback | ||||
| if (-not $env:PYTORCH_FINAL_PACKAGE_DIR) { | ||||
|     $env:PYTORCH_FINAL_PACKAGE_DIR = "C:\w\build-results" | ||||
| } | ||||
|  | ||||
| # Create the final package directory if it doesn't exist | ||||
| if (-not (Test-Path $env:PYTORCH_FINAL_PACKAGE_DIR)) { | ||||
|     New-Item -Path $env:PYTORCH_FINAL_PACKAGE_DIR -ItemType Directory -Force | Out-Null | ||||
| } | ||||
|  | ||||
| # Set script helpers directory | ||||
| $env:SCRIPT_HELPERS_DIR = Join-Path $ScriptParentDir "win-test-helpers\arm64" | ||||
|  | ||||
| # Run the main build script | ||||
| & "$env:SCRIPT_HELPERS_DIR\build_pytorch.ps1" | ||||
|  | ||||
| Write-Host "BUILD PASSED" | ||||
| @ -1,24 +0,0 @@ | ||||
| #!/bin/bash | ||||
| set -ex -o pipefail | ||||
|  | ||||
| SCRIPT_PARENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||||
| # shellcheck source=./common.sh | ||||
| source "$SCRIPT_PARENT_DIR/common.sh" | ||||
|  | ||||
| run_tests() { | ||||
|     echo Running smoke_test.py... | ||||
|     python ./.ci/pytorch/smoke_test/smoke_test.py --package torchonly | ||||
|  | ||||
|     echo Running test_autograd.oy, test_nn.py, test_torch.py... | ||||
|     cd test | ||||
|  | ||||
|     CORE_TEST_LIST=("test_autograd.py" "test_nn.py" "test_modules.py") | ||||
|  | ||||
|     for t in "${CORE_TEST_LIST[@]}"; do | ||||
|         echo "Running test: $t" | ||||
|         python "$t" --verbose --save-xml --use-pytest -vvvv -rfEsxXP -p no:xdist | ||||
|     done | ||||
| } | ||||
|  | ||||
| run_tests | ||||
| echo "TEST PASSED" | ||||
| @ -31,7 +31,7 @@ PYLONG_API_CHECK=$? | ||||
| if [[ $PYLONG_API_CHECK == 0 ]]; then | ||||
|   echo "Usage of PyLong_{From,As}{Unsigned}Long API may lead to overflow errors on Windows" | ||||
|   echo "because \`sizeof(long) == 4\` and \`sizeof(unsigned long) == 4\`." | ||||
|   echo "Please include \"torch/csrc/utils/python_numbers.h\" and use the corresponding APIs instead." | ||||
|   echo "Please include \"torch/csrc/utils/python_numbers.h\" and use the correspoding APIs instead." | ||||
|   echo "PyLong_FromLong -> THPUtils_packInt32 / THPUtils_packInt64" | ||||
|   echo "PyLong_AsLong -> THPUtils_unpackInt (32-bit) / THPUtils_unpackLong (64-bit)" | ||||
|   echo "PyLong_FromUnsignedLong -> THPUtils_packUInt32 / THPUtils_packUInt64" | ||||
|  | ||||
| @ -1,98 +0,0 @@ | ||||
| # TODO: we may can use existing build_pytorch.bat for arm64 | ||||
|  | ||||
| if ($env:DEBUG -eq "1") { | ||||
|     $env:BUILD_TYPE = "debug" | ||||
| } else { | ||||
|     $env:BUILD_TYPE = "release" | ||||
| } | ||||
|  | ||||
| # This inflates our log size slightly, but it is REALLY useful to be | ||||
| # able to see what our cl.exe commands are. (since you can actually | ||||
| # just copy-paste them into a local Windows setup to just rebuild a | ||||
| # single file.) | ||||
| # log sizes are too long, but leaving this here in case someone wants to use it locally | ||||
| # $env:CMAKE_VERBOSE_MAKEFILE = "1" | ||||
|  | ||||
| $env:INSTALLER_DIR = Join-Path $env:SCRIPT_HELPERS_DIR "installation-helpers" | ||||
|  | ||||
| cd .. | ||||
|  | ||||
| # Environment variables | ||||
| $env:SCCACHE_IDLE_TIMEOUT = "0" | ||||
| $env:SCCACHE_IGNORE_SERVER_IO_ERROR = "1" | ||||
| $env:CMAKE_BUILD_TYPE = $env:BUILD_TYPE | ||||
| $env:CMAKE_C_COMPILER_LAUNCHER = "sccache" | ||||
| $env:CMAKE_CXX_COMPILER_LAUNCHER = "sccache" | ||||
| $env:libuv_ROOT = Join-Path $env:DEPENDENCIES_DIR "libuv\install" | ||||
| $env:MSSdk = "1" | ||||
|  | ||||
| if ($env:PYTORCH_BUILD_VERSION) { | ||||
|     $env:PYTORCH_BUILD_VERSION = $env:PYTORCH_BUILD_VERSION | ||||
|     $env:PYTORCH_BUILD_NUMBER = "1" | ||||
| } | ||||
|  | ||||
| $env:CMAKE_POLICY_VERSION_MINIMUM = "3.5" | ||||
|  | ||||
| # Set BLAS type | ||||
| if ($env:ENABLE_APL -eq "1") { | ||||
|     $env:BLAS = "APL" | ||||
|     $env:USE_LAPACK = "1" | ||||
| } elseif ($env:ENABLE_OPENBLAS -eq "1") { | ||||
|     $env:BLAS = "OpenBLAS" | ||||
|     $env:OpenBLAS_HOME = Join-Path $env:DEPENDENCIES_DIR "OpenBLAS\install" | ||||
| } | ||||
|  | ||||
| # Change to source directory | ||||
| Set-Location $env:PYTORCH_ROOT | ||||
|  | ||||
| # Copy libuv.dll | ||||
| Copy-Item -Path (Join-Path $env:libuv_ROOT "lib\Release\uv.dll") -Destination "torch\lib\uv.dll" -Force | ||||
|  | ||||
| # Create virtual environment | ||||
| python -m venv .venv | ||||
| .\.venv\Scripts\Activate.ps1 | ||||
| where.exe python | ||||
|  | ||||
| # Python install dependencies | ||||
| python -m pip install --upgrade pip | ||||
| pip install setuptools pyyaml | ||||
| pip install -r requirements.txt | ||||
|  | ||||
| # Set after installing psutil | ||||
| $env:DISTUTILS_USE_SDK = "1" | ||||
|  | ||||
| # Print all environment variables | ||||
| Get-ChildItem Env: | ||||
|  | ||||
| # Start and inspect sccache | ||||
| sccache --start-server | ||||
| sccache --zero-stats | ||||
| sccache --show-stats | ||||
|  | ||||
| # Build the wheel | ||||
| python setup.py bdist_wheel | ||||
| if ($LASTEXITCODE -ne 0) { exit 1 } | ||||
|  | ||||
| # Install the wheel locally | ||||
| $whl = Get-ChildItem -Path "dist\*.whl" | Select-Object -First 1 | ||||
| if ($whl) { | ||||
|     python -mpip install --no-index --no-deps $whl.FullName | ||||
| } | ||||
|  | ||||
| # Copy final wheel | ||||
| robocopy "dist" "$env:PYTORCH_FINAL_PACKAGE_DIR" *.whl | ||||
|  | ||||
| # Export test times | ||||
| python tools/stats/export_test_times.py | ||||
|  | ||||
| # Copy additional CI files | ||||
| robocopy ".additional_ci_files" "$env:PYTORCH_FINAL_PACKAGE_DIR\.additional_ci_files" /E | ||||
|  | ||||
| # Save ninja log | ||||
| Copy-Item -Path "build\.ninja_log" -Destination $env:PYTORCH_FINAL_PACKAGE_DIR -Force | ||||
|  | ||||
| # Final sccache stats and stop | ||||
| sccache --show-stats | ||||
| sccache --stop-server | ||||
|  | ||||
| exit 0 | ||||
| @ -10,7 +10,7 @@ set PATH=C:\Program Files\CMake\bin;C:\Program Files\7-Zip;C:\ProgramData\chocol | ||||
| :: able to see what our cl.exe commands are (since you can actually | ||||
| :: just copy-paste them into a local Windows setup to just rebuild a | ||||
| :: single file.) | ||||
| :: log sizes are too long, but leaving this here in case someone wants to use it locally | ||||
| :: log sizes are too long, but leaving this here incase someone wants to use it locally | ||||
| :: set CMAKE_VERBOSE_MAKEFILE=1 | ||||
|  | ||||
|  | ||||
| @ -42,7 +42,7 @@ call choco upgrade -y cmake --no-progress --installargs 'ADD_CMAKE_TO_PATH=Syste | ||||
| if errorlevel 1 goto fail | ||||
| if not errorlevel 0 goto fail | ||||
|  | ||||
| call pip install mkl==2024.2.0 mkl-static==2024.2.0 mkl-include==2024.2.0 | ||||
| call pip install mkl-include==2021.4.0 mkl-devel==2021.4.0 | ||||
| if errorlevel 1 goto fail | ||||
| if not errorlevel 0 goto fail | ||||
|  | ||||
|  | ||||
| @ -52,7 +52,7 @@ if __name__ == "__main__": | ||||
|             if os.path.exists(debugger): | ||||
|                 command_args = [debugger, "-o", "-c", "~*g; q"] + command_args | ||||
|                 command_string = " ".join(command_args) | ||||
|                 print("Rerunning with traceback enabled") | ||||
|                 print("Reruning with traceback enabled") | ||||
|                 print("Command:", command_string) | ||||
|                 subprocess.run(command_args, check=False) | ||||
|             sys.exit(e.returncode) | ||||
|  | ||||
| @ -41,7 +41,7 @@ fi | ||||
| python -m pip install pytest-rerunfailures==10.3 pytest-cpp==2.3.0 tensorboard==2.13.0 protobuf==5.29.4 pytest-subtests==0.13.1 | ||||
|  | ||||
| # Install Z3 optional dependency for Windows builds. | ||||
| python -m pip install z3-solver==4.15.1.0 | ||||
| python -m pip install z3-solver==4.12.2.0 | ||||
|  | ||||
| # Install tlparse for test\dynamo\test_structured_trace.py UTs. | ||||
| python -m pip install tlparse==0.3.30 | ||||
| @ -52,9 +52,6 @@ python -m pip install parameterized==0.8.1 | ||||
| # Install pulp for testing ilps under torch\distributed\_tools | ||||
| python -m pip install pulp==2.9.0 | ||||
|  | ||||
| # Install expecttest to merge https://github.com/pytorch/pytorch/pull/155308 | ||||
| python -m pip install expecttest==0.3.0 | ||||
|  | ||||
| run_tests() { | ||||
|     # Run nvidia-smi if available | ||||
|     for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do | ||||
|  | ||||
| @ -27,24 +27,24 @@ IF "%NVTOOLSEXT_PATH%"=="" ( | ||||
|     ) | ||||
| ) | ||||
| 
 | ||||
| IF "%CUDA_PATH_V129%"=="" ( | ||||
|     IF EXIST "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\bin\nvcc.exe" ( | ||||
|         set "CUDA_PATH_V129=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9" | ||||
| IF "%CUDA_PATH_V118%"=="" ( | ||||
|     IF EXIST "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" ( | ||||
|         set "CUDA_PATH_V118=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8" | ||||
|     ) ELSE ( | ||||
|         echo CUDA 12.9 not found, failing | ||||
|         echo CUDA 11.8 not found, failing | ||||
|         exit /b 1 | ||||
|     ) | ||||
| ) | ||||
| 
 | ||||
| IF "%BUILD_VISION%" == "" ( | ||||
|     set TORCH_CUDA_ARCH_LIST=7.0;7.5;8.0;8.6;9.0;10.0;12.0 | ||||
|     set TORCH_CUDA_ARCH_LIST=3.7+PTX;5.0;6.0;6.1;7.0;7.5;8.0;8.6;9.0 | ||||
|     set TORCH_NVCC_FLAGS=-Xfatbin -compress-all | ||||
| ) ELSE ( | ||||
|     set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_90,code=compute_90 -gencode=arch=compute_100,code=compute_100 -gencode=arch=compute_120,code=compute_120 | ||||
|     set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_90,code=compute_90 | ||||
| ) | ||||
| 
 | ||||
| set "CUDA_PATH=%CUDA_PATH_V129%" | ||||
| set "PATH=%CUDA_PATH_V129%\bin;%PATH%" | ||||
| set "CUDA_PATH=%CUDA_PATH_V118%" | ||||
| set "PATH=%CUDA_PATH_V118%\bin;%PATH%" | ||||
| 
 | ||||
| :optcheck | ||||
| 
 | ||||
| @ -65,7 +65,7 @@ for /F "usebackq delims=" %%i in (`python -c "import sys; print('{0[0]}{0[1]}'.f | ||||
| if  %PYVER% LSS 35 ( | ||||
|     echo Warning: PyTorch for Python 2 under Windows is experimental. | ||||
|     echo Python x64 3.5 or up is recommended to compile PyTorch on Windows | ||||
|     echo Maybe you can create a virtual environment if you have conda installed: | ||||
|     echo Maybe you can create a virual environment if you have conda installed: | ||||
|     echo ^> conda create -n test python=3.6 pyyaml numpy | ||||
|     echo ^> activate test | ||||
| ) | ||||
|  | ||||
| @ -8,7 +8,6 @@ copy "%CUDA_PATH%\bin\cusolver*64_*.dll*" pytorch\torch\lib | ||||
| copy "%CUDA_PATH%\bin\cudnn*64_*.dll*" pytorch\torch\lib | ||||
| copy "%CUDA_PATH%\bin\nvrtc*64_*.dll*" pytorch\torch\lib | ||||
| copy "%CUDA_PATH%\extras\CUPTI\lib64\cupti64_*.dll*" pytorch\torch\lib | ||||
| copy "%CUDA_PATH%\extras\CUPTI\lib64\nvperf_host*.dll*" pytorch\torch\lib | ||||
|  | ||||
| copy "C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64\nvToolsExt64_1.dll*" pytorch\torch\lib | ||||
| copy "%PYTHON_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib | ||||
|  | ||||
| @ -23,13 +23,39 @@ set CUDNN_LIB_FOLDER="lib\x64" | ||||
| :: Skip all of this if we already have cuda installed | ||||
| if exist "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\bin\nvcc.exe" goto set_cuda_env_vars | ||||
|  | ||||
| if %CUDA_VER% EQU 118 goto cuda118 | ||||
| if %CUDA_VER% EQU 124 goto cuda124 | ||||
| if %CUDA_VER% EQU 126 goto cuda126 | ||||
| if %CUDA_VER% EQU 128 goto cuda128 | ||||
| if %CUDA_VER% EQU 129 goto cuda129 | ||||
|  | ||||
| echo CUDA %CUDA_VERSION_STR% is not supported | ||||
| exit /b 1 | ||||
|  | ||||
| :cuda118 | ||||
|  | ||||
| set CUDA_INSTALL_EXE=cuda_11.8.0_522.06_windows.exe | ||||
| if not exist "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" ( | ||||
|     curl -k -L "https://ossci-windows.s3.amazonaws.com/%CUDA_INSTALL_EXE%" --output "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" & REM @lint-ignore | ||||
|     if errorlevel 1 exit /b 1 | ||||
|     set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" | ||||
|     set "ARGS=cuda_profiler_api_11.8 thrust_11.8 nvcc_11.8 cuobjdump_11.8 nvprune_11.8 nvprof_11.8 cupti_11.8 cublas_11.8 cublas_dev_11.8 cudart_11.8 cufft_11.8 cufft_dev_11.8 curand_11.8 curand_dev_11.8 cusolver_11.8 cusolver_dev_11.8 cusparse_11.8 cusparse_dev_11.8 npp_11.8 npp_dev_11.8 nvrtc_11.8 nvrtc_dev_11.8 nvml_dev_11.8 nvtx_11.8" | ||||
| ) | ||||
|  | ||||
| set CUDNN_FOLDER=cudnn-windows-x86_64-9.5.0.50_cuda11-archive | ||||
| set CUDNN_LIB_FOLDER="lib" | ||||
| set "CUDNN_INSTALL_ZIP=%CUDNN_FOLDER%.zip" | ||||
| if not exist "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" ( | ||||
|     curl -k -L "http://s3.amazonaws.com/ossci-windows/%CUDNN_INSTALL_ZIP%" --output "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" & REM @lint-ignore | ||||
|     if errorlevel 1 exit /b 1 | ||||
|     set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" | ||||
| ) | ||||
|  | ||||
| @REM cuDNN 8.3+ required zlib to be installed on the path | ||||
| echo Installing ZLIB dlls | ||||
| curl -k -L "http://s3.amazonaws.com/ossci-windows/zlib123dllx64.zip" --output "%SRC_DIR%\temp_build\zlib123dllx64.zip" | ||||
| 7z x "%SRC_DIR%\temp_build\zlib123dllx64.zip" -o"%SRC_DIR%\temp_build\zlib" | ||||
| xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32" | ||||
|  | ||||
| goto cuda_common | ||||
|  | ||||
| :cuda126 | ||||
| @ -86,33 +112,6 @@ xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32" | ||||
|  | ||||
| goto cuda_common | ||||
|  | ||||
| :cuda129 | ||||
|  | ||||
| set CUDA_INSTALL_EXE=cuda_12.9.1_576.57_windows.exe | ||||
| if not exist "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" ( | ||||
|     curl -k -L "https://ossci-windows.s3.amazonaws.com/%CUDA_INSTALL_EXE%" --output "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" & REM @lint-ignore | ||||
|     if errorlevel 1 exit /b 1 | ||||
|     set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" | ||||
|     set "ARGS=cuda_profiler_api_12.9 thrust_12.9 nvcc_12.9 cuobjdump_12.9 nvprune_12.9 nvprof_12.9 cupti_12.9 cublas_12.9 cublas_dev_12.9 cudart_12.9 cufft_12.9 cufft_dev_12.9 curand_12.9 curand_dev_12.9 cusolver_12.9 cusolver_dev_12.9 cusparse_12.9 cusparse_dev_12.9 npp_12.9 npp_dev_12.9 nvrtc_12.9 nvrtc_dev_12.9 nvml_dev_12.9 nvjitlink_12.9 nvtx_12.9" | ||||
| ) | ||||
|  | ||||
| set CUDNN_FOLDER=cudnn-windows-x86_64-9.10.2.21_cuda12-archive | ||||
| set CUDNN_LIB_FOLDER="lib" | ||||
| set "CUDNN_INSTALL_ZIP=%CUDNN_FOLDER%.zip" | ||||
| if not exist "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" ( | ||||
|     curl -k -L "http://s3.amazonaws.com/ossci-windows/%CUDNN_INSTALL_ZIP%" --output "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" & REM @lint-ignore | ||||
|     if errorlevel 1 exit /b 1 | ||||
|     set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" | ||||
| ) | ||||
|  | ||||
| @REM cuDNN 8.3+ required zlib to be installed on the path | ||||
| echo Installing ZLIB dlls | ||||
| curl -k -L "http://s3.amazonaws.com/ossci-windows/zlib123dllx64.zip" --output "%SRC_DIR%\temp_build\zlib123dllx64.zip" | ||||
| 7z x "%SRC_DIR%\temp_build\zlib123dllx64.zip" -o"%SRC_DIR%\temp_build\zlib" | ||||
| xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32" | ||||
|  | ||||
| goto cuda_common | ||||
|  | ||||
| :cuda_common | ||||
| :: NOTE: We only install CUDA if we don't have it installed already. | ||||
| :: With GHA runners these should be pre-installed as part of our AMI process | ||||
|  | ||||
| @ -18,5 +18,3 @@ start /wait "" python-amd64.exe /quiet InstallAllUsers=1 PrependPath=0 Include_t | ||||
| if errorlevel 1 exit /b 1 | ||||
|  | ||||
| set "PATH=%CD%\Python\Scripts;%CD%\Python;%PATH%" | ||||
| %PYTHON_EXEC% -m pip install --upgrade pip setuptools packaging wheel | ||||
| if errorlevel 1 exit /b 1 | ||||
|  | ||||
| @ -99,6 +99,7 @@ goto end | ||||
| :libtorch | ||||
| echo "install and test libtorch" | ||||
|  | ||||
| if "%VC_YEAR%" == "2019" powershell internal\vs2019_install.ps1 | ||||
| if "%VC_YEAR%" == "2022" powershell internal\vs2022_install.ps1 | ||||
|  | ||||
| if ERRORLEVEL 1 exit /b 1 | ||||
| @ -110,6 +111,10 @@ pushd tmp\libtorch | ||||
|  | ||||
| set VC_VERSION_LOWER=17 | ||||
| set VC_VERSION_UPPER=18 | ||||
| IF "%VC_YEAR%" == "2019" ( | ||||
|     set VC_VERSION_LOWER=16 | ||||
|     set VC_VERSION_UPPER=17 | ||||
| ) | ||||
|  | ||||
| for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( | ||||
|     if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( | ||||
| @ -148,7 +153,14 @@ if "%NVIDIA_GPU_EXISTS%" == "0" ( | ||||
|     goto end | ||||
| ) | ||||
|  | ||||
| cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ | ||||
| set BUILD_SPLIT_CUDA= | ||||
| if exist "%install_root%\lib\torch_cuda_cu.lib" if exist "%install_root%\lib\torch_cuda_cpp.lib" set BUILD_SPLIT_CUDA=ON | ||||
|  | ||||
| if "%BUILD_SPLIT_CUDA%" == "ON" ( | ||||
|     cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda_cu.lib torch_cuda_cpp.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ /INCLUDE:?_torch_cuda_cu_linker_symbol_op_cuda@native@at@@YA?AVTensor@2@AEBV32@@Z | ||||
| ) else ( | ||||
|     cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ | ||||
| ) | ||||
| .\check-torch-cuda.exe | ||||
| if ERRORLEVEL 1 exit /b 1 | ||||
|  | ||||
|  | ||||
| @ -1,7 +1,14 @@ | ||||
| if "%VC_YEAR%" == "2019" powershell windows/internal/vs2019_install.ps1 | ||||
| if "%VC_YEAR%" == "2022" powershell windows/internal/vs2022_install.ps1 | ||||
|  | ||||
| set VC_VERSION_LOWER=17 | ||||
| set VC_VERSION_UPPER=18 | ||||
| :: Please don't delete VS2019 as an alternative, in case some Windows compiler issue. | ||||
| :: Reference: https://github.com/pytorch/pytorch/issues/145702#issuecomment-2858693930 | ||||
| if "%VC_YEAR%" == "2019" ( | ||||
|     set VC_VERSION_LOWER=16 | ||||
|     set VC_VERSION_UPPER=17 | ||||
| ) | ||||
|  | ||||
| for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"  -products Microsoft.VisualStudio.Product.BuildTools -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( | ||||
|     if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( | ||||
|  | ||||
							
								
								
									
										48
									
								
								.ci/pytorch/windows/internal/vs2019_install.ps1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								.ci/pytorch/windows/internal/vs2019_install.ps1
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,48 @@ | ||||
| # https://developercommunity.visualstudio.com/t/install-specific-version-of-vs-component/1142479 | ||||
| # https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#release-dates-and-build-numbers | ||||
|  | ||||
| # 16.8.6 BuildTools | ||||
| $VS_DOWNLOAD_LINK = "https://ossci-windows.s3.us-east-1.amazonaws.com/vs16.8.6_BuildTools.exe" | ||||
| $COLLECT_DOWNLOAD_LINK = "https://aka.ms/vscollect.exe" | ||||
| $VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools", | ||||
|                                                      "--add Microsoft.Component.MSBuild", | ||||
|                                                      "--add Microsoft.VisualStudio.Component.Roslyn.Compiler", | ||||
|                                                      "--add Microsoft.VisualStudio.Component.TextTemplating", | ||||
|                                                      "--add Microsoft.VisualStudio.Component.VC.CoreIde", | ||||
|                                                      "--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest", | ||||
|                                                      "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", | ||||
|                                                      "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64", | ||||
|                                                      "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81") | ||||
|  | ||||
| curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe | ||||
| if ($LASTEXITCODE -ne 0) { | ||||
|     echo "Download of the VS 2019 Version 16.8.5 installer failed" | ||||
|     exit 1 | ||||
| } | ||||
|  | ||||
| if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe") { | ||||
|     $existingPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -products "Microsoft.VisualStudio.Product.BuildTools" -version "[16, 17)" -property installationPath | ||||
|     if ($existingPath -ne $null) { | ||||
|         if (!${env:CIRCLECI}) { | ||||
|             echo "Found correctly versioned existing BuildTools installation in $existingPath" | ||||
|             exit 0 | ||||
|         } | ||||
|         echo "Found existing BuildTools installation in $existingPath, keeping it" | ||||
|     } | ||||
| } | ||||
|  | ||||
| $process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru | ||||
| Remove-Item -Path vs_installer.exe -Force | ||||
| $exitCode = $process.ExitCode | ||||
| if (($exitCode -ne 0) -and ($exitCode -ne 3010)) { | ||||
|     echo "VS 2019 installer exited with code $exitCode, which should be one of [0, 3010]." | ||||
|     curl.exe --retry 3 -kL $COLLECT_DOWNLOAD_LINK --output Collect.exe | ||||
|     if ($LASTEXITCODE -ne 0) { | ||||
|         echo "Download of the VS Collect tool failed." | ||||
|         exit 1 | ||||
|     } | ||||
|     Start-Process "${PWD}\Collect.exe" -NoNewWindow -Wait -PassThru | ||||
|     New-Item -Path "C:\w\build-results" -ItemType "directory" -Force | ||||
|     Copy-Item -Path "C:\Users\${env:USERNAME}\AppData\Local\Temp\vslogs.zip" -Destination "C:\w\build-results\" | ||||
|     exit 1 | ||||
| } | ||||
| @ -25,8 +25,8 @@ set XPU_EXTRA_INSTALLED=0 | ||||
| set XPU_EXTRA_UNINSTALL=0 | ||||
|  | ||||
| if not [%XPU_VERSION%]==[] if [%XPU_VERSION%]==[2025.1] ( | ||||
|     set XPU_BUNDLE_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/75d4eb97-914a-4a95-852c-7b9733d80f74/intel-deep-learning-essentials-2025.1.3.8_offline.exe | ||||
|     set XPU_BUNDLE_VERSION=2025.1.3+5 | ||||
|     set XPU_BUNDLE_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1a9fff3d-04c2-4d77-8861-3d86c774b66f/intel-deep-learning-essentials-2025.1.1.26_offline.exe | ||||
|     set XPU_BUNDLE_VERSION=2025.1.1+23 | ||||
| ) | ||||
|  | ||||
| :: Check if XPU bundle is target version or already installed | ||||
|  | ||||
| @ -127,7 +127,7 @@ export INSTALL_TEST=0 # dont install test binaries into site-packages | ||||
| export MACOSX_DEPLOYMENT_TARGET=10.15 | ||||
| export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} | ||||
|  | ||||
| SETUPTOOLS_PINNED_VERSION="==70.1.0" | ||||
| SETUPTOOLS_PINNED_VERSION="=46.0.0" | ||||
| PYYAML_PINNED_VERSION="=5.3" | ||||
| EXTRA_CONDA_INSTALL_FLAGS="" | ||||
| CONDA_ENV_CREATE_FLAGS="" | ||||
| @ -135,7 +135,7 @@ RENAME_WHEEL=true | ||||
| case $desired_python in | ||||
|     3.13t) | ||||
|         echo "Using 3.13 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=68.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=6.0.1" | ||||
|         NUMPY_PINNED_VERSION="=2.1.0" | ||||
|         CONDA_ENV_CREATE_FLAGS="python-freethreading" | ||||
| @ -145,31 +145,31 @@ case $desired_python in | ||||
|         ;; | ||||
|     3.13) | ||||
|         echo "Using 3.13 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=68.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=6.0.1" | ||||
|         NUMPY_PINNED_VERSION="=2.1.0" | ||||
|         ;; | ||||
|     3.12) | ||||
|         echo "Using 3.12 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=68.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=6.0.1" | ||||
|         NUMPY_PINNED_VERSION="=2.0.2" | ||||
|         ;; | ||||
|     3.11) | ||||
|         echo "Using 3.11 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=46.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=5.3" | ||||
|         NUMPY_PINNED_VERSION="=2.0.2" | ||||
|         ;; | ||||
|     3.10) | ||||
|         echo "Using 3.10 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=46.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=5.3" | ||||
|         NUMPY_PINNED_VERSION="=2.0.2" | ||||
|         ;; | ||||
|     3.9) | ||||
|         echo "Using 3.9 deps" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=70.1.0" | ||||
|         SETUPTOOLS_PINNED_VERSION=">=46.0.0" | ||||
|         PYYAML_PINNED_VERSION=">=5.3" | ||||
|         NUMPY_PINNED_VERSION="=2.0.2" | ||||
|         ;; | ||||
| @ -184,8 +184,7 @@ tmp_env_name="wheel_py$python_nodot" | ||||
| conda create ${EXTRA_CONDA_INSTALL_FLAGS} -yn "$tmp_env_name" python="$desired_python" ${CONDA_ENV_CREATE_FLAGS} | ||||
| source activate "$tmp_env_name" | ||||
|  | ||||
| retry pip install -r "${pytorch_rootdir}/requirements-build.txt" | ||||
| pip install "numpy=${NUMPY_PINNED_VERSION}"  "pyyaml${PYYAML_PINNED_VERSION}" requests ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" typing-extensions | ||||
| pip install "numpy=${NUMPY_PINNED_VERSION}"  "pyyaml${PYYAML_PINNED_VERSION}" requests ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" typing_extensions | ||||
| retry pip install -r "${pytorch_rootdir}/requirements.txt" || true | ||||
| retry brew install libomp | ||||
|  | ||||
| @ -207,7 +206,7 @@ if [[ "$USE_SPLIT_BUILD" == "true" ]]; then | ||||
|     BUILD_LIBTORCH_WHL=1 BUILD_PYTHON_ONLY=0 python setup.py bdist_wheel -d "$whl_tmp_dir" | ||||
|     echo "Finished setup.py bdist_wheel for split build (BUILD_LIBTORCH_WHL)" | ||||
|     echo "Calling setup.py bdist_wheel for split build (BUILD_PYTHON_ONLY)" | ||||
|     BUILD_LIBTORCH_WHL=0 BUILD_PYTHON_ONLY=1 CMAKE_FRESH=1 python setup.py bdist_wheel -d "$whl_tmp_dir" | ||||
|     BUILD_PYTHON_ONLY=1 BUILD_LIBTORCH_WHL=0 python setup.py bdist_wheel -d "$whl_tmp_dir" --cmake | ||||
|     echo "Finished setup.py bdist_wheel for split build (BUILD_PYTHON_ONLY)" | ||||
| else | ||||
|     python setup.py bdist_wheel -d "$whl_tmp_dir" | ||||
|  | ||||
| @ -75,8 +75,8 @@ TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt) | ||||
| # Here PYTORCH_EXTRA_INSTALL_REQUIREMENTS is already set for the all the wheel builds hence append TRITON_CONSTRAINT | ||||
| TRITON_CONSTRAINT="platform_system == 'Linux' and platform_machine == 'x86_64'" | ||||
|  | ||||
| # CUDA 12.9 builds have triton for Linux and Linux aarch64 binaries. | ||||
| if [[ "$DESIRED_CUDA" == "cu129" ]]; then | ||||
| # CUDA 12.8 builds have triton for Linux and Linux aarch64 binaries. | ||||
| if [[ "$DESIRED_CUDA" == cu128 ]]; then | ||||
|   TRITON_CONSTRAINT="platform_system == 'Linux'" | ||||
| fi | ||||
|  | ||||
| @ -105,7 +105,6 @@ fi | ||||
|  | ||||
| # Set triton via PYTORCH_EXTRA_INSTALL_REQUIREMENTS for triton xpu package | ||||
| if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*xpu.* ]]; then | ||||
|     TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_xpu_version.txt) | ||||
|     TRITON_REQUIREMENT="pytorch-triton-xpu==${TRITON_VERSION}" | ||||
|     if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then | ||||
|         TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-xpu.txt) | ||||
|  | ||||
							
								
								
									
										157
									
								
								.circleci/scripts/trigger_azure_pipeline.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								.circleci/scripts/trigger_azure_pipeline.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,157 @@ | ||||
| # Documentation: https://docs.microsoft.com/en-us/rest/api/azure/devops/build/?view=azure-devops-rest-6.0 | ||||
|  | ||||
| import json | ||||
| import os | ||||
| import re | ||||
| import sys | ||||
| import time | ||||
|  | ||||
| import requests | ||||
|  | ||||
|  | ||||
| AZURE_PIPELINE_BASE_URL = "https://aiinfra.visualstudio.com/PyTorch/" | ||||
| AZURE_DEVOPS_PAT_BASE64 = os.environ.get("AZURE_DEVOPS_PAT_BASE64_SECRET", "") | ||||
| PIPELINE_ID = "911" | ||||
| PROJECT_ID = "0628bce4-2d33-499e-bac5-530e12db160f" | ||||
| TARGET_BRANCH = os.environ.get("CIRCLE_BRANCH", "main") | ||||
| TARGET_COMMIT = os.environ.get("CIRCLE_SHA1", "") | ||||
|  | ||||
| build_base_url = AZURE_PIPELINE_BASE_URL + "_apis/build/builds?api-version=6.0" | ||||
|  | ||||
| s = requests.Session() | ||||
| s.headers.update({"Authorization": "Basic " + AZURE_DEVOPS_PAT_BASE64}) | ||||
|  | ||||
|  | ||||
| def submit_build(pipeline_id, project_id, source_branch, source_version): | ||||
|     print("Submitting build for branch: " + source_branch) | ||||
|     print("Commit SHA1: ", source_version) | ||||
|  | ||||
|     run_build_raw = s.post( | ||||
|         build_base_url, | ||||
|         json={ | ||||
|             "definition": {"id": pipeline_id}, | ||||
|             "project": {"id": project_id}, | ||||
|             "sourceBranch": source_branch, | ||||
|             "sourceVersion": source_version, | ||||
|         }, | ||||
|     ) | ||||
|  | ||||
|     try: | ||||
|         run_build_json = run_build_raw.json() | ||||
|     except json.decoder.JSONDecodeError as e: | ||||
|         print(e) | ||||
|         print( | ||||
|             "Failed to parse the response. Check if the Azure DevOps PAT is incorrect or expired." | ||||
|         ) | ||||
|         sys.exit(-1) | ||||
|  | ||||
|     build_id = run_build_json["id"] | ||||
|  | ||||
|     print("Submitted bulid: " + str(build_id)) | ||||
|     print("Bulid URL: " + run_build_json["url"]) | ||||
|     return build_id | ||||
|  | ||||
|  | ||||
| def get_build(_id): | ||||
|     get_build_url = ( | ||||
|         AZURE_PIPELINE_BASE_URL + f"/_apis/build/builds/{_id}?api-version=6.0" | ||||
|     ) | ||||
|     get_build_raw = s.get(get_build_url) | ||||
|     return get_build_raw.json() | ||||
|  | ||||
|  | ||||
| def get_build_logs(_id): | ||||
|     get_build_logs_url = ( | ||||
|         AZURE_PIPELINE_BASE_URL + f"/_apis/build/builds/{_id}/logs?api-version=6.0" | ||||
|     ) | ||||
|     get_build_logs_raw = s.get(get_build_logs_url) | ||||
|     return get_build_logs_raw.json() | ||||
|  | ||||
|  | ||||
| def get_log_content(url): | ||||
|     resp = s.get(url) | ||||
|     return resp.text | ||||
|  | ||||
|  | ||||
| def wait_for_build(_id): | ||||
|     build_detail = get_build(_id) | ||||
|     build_status = build_detail["status"] | ||||
|  | ||||
|     while build_status == "notStarted": | ||||
|         print("Waiting for run to start: " + str(_id)) | ||||
|         sys.stdout.flush() | ||||
|         try: | ||||
|             build_detail = get_build(_id) | ||||
|             build_status = build_detail["status"] | ||||
|         except Exception as e: | ||||
|             print("Error getting build") | ||||
|             print(e) | ||||
|  | ||||
|         time.sleep(30) | ||||
|  | ||||
|     print("Bulid started: ", str(_id)) | ||||
|  | ||||
|     handled_logs = set() | ||||
|     while build_status == "inProgress": | ||||
|         try: | ||||
|             print("Waiting for log: " + str(_id)) | ||||
|             logs = get_build_logs(_id) | ||||
|         except Exception as e: | ||||
|             print("Error fetching logs") | ||||
|             print(e) | ||||
|             time.sleep(30) | ||||
|             continue | ||||
|  | ||||
|         for log in logs["value"]: | ||||
|             log_id = log["id"] | ||||
|             if log_id in handled_logs: | ||||
|                 continue | ||||
|             handled_logs.add(log_id) | ||||
|             print("Fetching log: \n" + log["url"]) | ||||
|             try: | ||||
|                 log_content = get_log_content(log["url"]) | ||||
|                 print(log_content) | ||||
|             except Exception as e: | ||||
|                 print("Error getting log content") | ||||
|                 print(e) | ||||
|             sys.stdout.flush() | ||||
|         build_detail = get_build(_id) | ||||
|         build_status = build_detail["status"] | ||||
|         time.sleep(30) | ||||
|  | ||||
|     build_result = build_detail["result"] | ||||
|  | ||||
|     print("Bulid status: " + build_status) | ||||
|     print("Bulid result: " + build_result) | ||||
|  | ||||
|     return build_status, build_result | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|     # Convert the branch name for Azure DevOps | ||||
|     match = re.search(r"pull/(\d+)", TARGET_BRANCH) | ||||
|     if match is not None: | ||||
|         pr_num = match.group(1) | ||||
|         SOURCE_BRANCH = f"refs/pull/{pr_num}/head" | ||||
|     else: | ||||
|         SOURCE_BRANCH = f"refs/heads/{TARGET_BRANCH}" | ||||
|  | ||||
|     MAX_RETRY = 2 | ||||
|     retry = MAX_RETRY | ||||
|  | ||||
|     while retry > 0: | ||||
|         build_id = submit_build(PIPELINE_ID, PROJECT_ID, SOURCE_BRANCH, TARGET_COMMIT) | ||||
|         build_status, build_result = wait_for_build(build_id) | ||||
|  | ||||
|         if build_result != "succeeded": | ||||
|             retry = retry - 1 | ||||
|             if retry > 0: | ||||
|                 print("Retrying... remaining attempt: " + str(retry)) | ||||
|                 # Wait a bit before retrying | ||||
|                 time.sleep((MAX_RETRY - retry) * 120) | ||||
|                 continue | ||||
|             else: | ||||
|                 print("No more chance to retry. Giving up.") | ||||
|                 sys.exit(-1) | ||||
|         else: | ||||
|             break | ||||
| @ -120,7 +120,6 @@ UseTab:          Never | ||||
| Language: ObjC | ||||
| ColumnLimit: 120 | ||||
| AlignAfterOpenBracket: Align | ||||
| IndentWidth: 2 | ||||
| ObjCBlockIndentWidth: 2 | ||||
| ObjCSpaceAfterProperty: false | ||||
| ObjCSpaceBeforeProtocolList: false | ||||
|  | ||||
| @ -61,8 +61,8 @@ You are now all set to start developing with PyTorch in a DevContainer environme | ||||
| ## Step 8: Build PyTorch | ||||
|  | ||||
| To build pytorch from source, simply run: | ||||
|    ```bash | ||||
|    python -m pip install --no-build-isolation -v -e . | ||||
|    ``` | ||||
|    python setup.py develop | ||||
|    ``` | ||||
|  | ||||
| The process involves compiling thousands of files, and would take a long time. Fortunately, the compiled objects can be useful for your next build. When you modify some files, you only need to compile the changed files the next time. | ||||
|  | ||||
| @ -1,36 +1,14 @@ | ||||
| root = true | ||||
|  | ||||
| [*] | ||||
| charset = utf-8 | ||||
| end_of_line = lf | ||||
| insert_final_newline = true | ||||
|  | ||||
| # Python | ||||
| [*.{py,pyi,py.in,pyi.in}] | ||||
| [*.py] | ||||
| indent_style = space | ||||
| indent_size = 4 | ||||
|  | ||||
| # C/C++/CUDA | ||||
| [*.{cpp,hpp,cxx,cc,c,h,cu,cuh}] | ||||
| indent_style = space | ||||
| indent_size = 2 | ||||
|  | ||||
| # Objective-C | ||||
| [*.{mm,m,M}] | ||||
| indent_style = space | ||||
| indent_size = 2 | ||||
|  | ||||
| # Clang tools | ||||
| [.clang-{format,tidy}] | ||||
| indent_style = space | ||||
| indent_size = 2 | ||||
|  | ||||
| # Make | ||||
| [Makefile] | ||||
| indent_style = tab | ||||
|  | ||||
| # Batch file | ||||
| [*.bat] | ||||
| indent_style = space | ||||
| indent_size = 2 | ||||
| end_of_line = crlf | ||||
|  | ||||
							
								
								
									
										4
									
								
								.flake8
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								.flake8
									
									
									
									
									
								
							| @ -7,12 +7,12 @@ max-line-length = 120 | ||||
| # C408 ignored because we like the dict keyword argument syntax | ||||
| # E501 is not flexible enough, we're using B950 instead | ||||
| ignore = | ||||
|     E203,E305,E402,E501,E704,E721,E741,F405,F841,F999,W503,W504,C408,E302,W291,E303,F824, | ||||
|     E203,E305,E402,E501,E704,E721,E741,F405,F841,F999,W503,W504,C408,E302,W291,E303, | ||||
|     # shebang has extra meaning in fbcode lints, so I think it's not worth trying | ||||
|     # to line this up with executable bit | ||||
|     EXE001, | ||||
|     # these ignores are from flake8-bugbear; please fix! | ||||
|     B007,B008,B017,B019,B023,B028,B903,B904,B905,B906,B907,B908,B910 | ||||
|     B007,B008,B017,B019,B023,B028,B903,B904,B905,B906,B907 | ||||
|     # these ignores are from flake8-comprehensions; please fix! | ||||
|     C407, | ||||
|     # these ignores are from flake8-logging-format; please fix! | ||||
|  | ||||
							
								
								
									
										12
									
								
								.github/actionlint.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/actionlint.yaml
									
									
									
									
										vendored
									
									
								
							| @ -14,7 +14,6 @@ self-hosted-runner: | ||||
|     - linux.12xlarge | ||||
|     - linux.24xlarge | ||||
|     - linux.24xlarge.ephemeral | ||||
|     - linux.24xlarge.amd | ||||
|     - linux.arm64.2xlarge | ||||
|     - linux.arm64.2xlarge.ephemeral | ||||
|     - linux.arm64.m7g.4xlarge | ||||
| @ -50,15 +49,18 @@ self-hosted-runner: | ||||
|     # Organization-wide AMD-hosted runners | ||||
|     # MI2xx runners | ||||
|     - linux.rocm.gpu | ||||
|     - linux.rocm.gpu.mi250 | ||||
|     - linux.rocm.gpu.2 | ||||
|     - linux.rocm.gpu.4 | ||||
|     # gfx942 runners | ||||
|     - linux.rocm.gpu.gfx942.2 | ||||
|     - linux.rocm.gpu.gfx942.4 | ||||
|     # MI300 runners | ||||
|     - linux.rocm.gpu.mi300.2 | ||||
|     - linux.rocm.gpu.mi300.4 | ||||
|     - rocm-docker | ||||
|     # Repo-specific Apple hosted  runners | ||||
|     - macos-m1-ultra | ||||
|     - macos-m2-14 | ||||
|     # Org wise AWS `mac2.metal` runners (2020 Mac mini hardware powered by Apple silicon M1 processors) | ||||
|     - macos-m1-stable | ||||
|     - macos-m1-13 | ||||
|     - macos-m1-14 | ||||
|     # GitHub-hosted MacOS runners | ||||
|     - macos-latest-xlarge | ||||
|  | ||||
							
								
								
									
										78
									
								
								.github/actions/build-android/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								.github/actions/build-android/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,78 @@ | ||||
| name: build android | ||||
|  | ||||
| description: build android for a specific arch | ||||
|  | ||||
| inputs: | ||||
|   arch: | ||||
|     description: arch to build | ||||
|     required: true | ||||
|   arch-for-build-env: | ||||
|     description: | | ||||
|       arch to pass to build environment. | ||||
|       This is currently different than the arch name we use elswhere, which | ||||
|       should be fixed. | ||||
|     required: true | ||||
|   github-secret: | ||||
|     description: github token | ||||
|     required: true | ||||
|   build-environment: | ||||
|     required: true | ||||
|     description: Top-level label for what's being built/tested. | ||||
|   docker-image: | ||||
|     required: true | ||||
|     description: Name of the base docker image to build with. | ||||
|   branch: | ||||
|     required: true | ||||
|     description: What branch we are building on. | ||||
| outputs: | ||||
|   container_id: | ||||
|     description: Docker container identifier used to build the artifacts | ||||
|     value: ${{ steps.build.outputs.container_id }} | ||||
|  | ||||
| runs: | ||||
|   using: composite | ||||
|   steps: | ||||
|     - name: Build-${{ inputs.arch }} | ||||
|       id: build | ||||
|       shell: bash | ||||
|       env: | ||||
|         BRANCH: ${{ inputs.branch }} | ||||
|         BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-${{ inputs.arch-for-build-env }}-build" | ||||
|         AWS_DEFAULT_REGION: us-east-1 | ||||
|         PR_NUMBER: ${{ github.event.pull_request.number }} | ||||
|         SHA1: ${{ github.event.pull_request.head.sha || github.sha }} | ||||
|         SCCACHE_BUCKET: ossci-compiler-cache-circleci-v2 | ||||
|         SCCACHE_REGION: us-east-1 | ||||
|         DOCKER_IMAGE: ${{ inputs.docker-image  }} | ||||
|         MATRIX_ARCH: ${{ inputs.arch }} | ||||
|       run: | | ||||
|         # detached container should get cleaned up by teardown_ec2_linux | ||||
|         set -exo pipefail | ||||
|         export container_name | ||||
|         container_name=$(docker run \ | ||||
|           -e BUILD_ENVIRONMENT \ | ||||
|           -e MAX_JOBS="$(nproc --ignore=2)" \ | ||||
|           -e AWS_DEFAULT_REGION \ | ||||
|           -e PR_NUMBER \ | ||||
|           -e SHA1 \ | ||||
|           -e BRANCH \ | ||||
|           -e SCCACHE_BUCKET \ | ||||
|           -e SCCACHE_REGION \ | ||||
|           -e SKIP_SCCACHE_INITIALIZATION=1 \ | ||||
|           --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ | ||||
|           --security-opt seccomp=unconfined \ | ||||
|           --cap-add=SYS_PTRACE \ | ||||
|           --tty \ | ||||
|           --detach \ | ||||
|           --user jenkins \ | ||||
|           -w /var/lib/jenkins/workspace \ | ||||
|           "${DOCKER_IMAGE}" | ||||
|         ) | ||||
|         git submodule sync && git submodule update -q --init --recursive --depth 1 | ||||
|         docker cp "${GITHUB_WORKSPACE}/." "${container_name}:/var/lib/jenkins/workspace" | ||||
|         (echo "sudo chown -R jenkins . && .ci/pytorch/build.sh && find ${BUILD_ROOT} -type f -name "*.a" -or -name "*.o" -delete" | docker exec -u jenkins -i "${container_name}" bash) 2>&1 | ||||
|  | ||||
|         # Copy install binaries back | ||||
|         mkdir -p "${GITHUB_WORKSPACE}/build_android_install_${MATRIX_ARCH}" | ||||
|         docker cp "${container_name}:/var/lib/jenkins/workspace/build_android/install" "${GITHUB_WORKSPACE}/build_android_install_${MATRIX_ARCH}" | ||||
|         echo "container_id=${container_name}" >> "${GITHUB_OUTPUT}" | ||||
| @ -70,7 +70,7 @@ runs: | ||||
|           set -eux | ||||
|           # PyYAML 6.0 doesn't work with MacOS x86 anymore | ||||
|           # This must run on Python-3.7 (AmazonLinux2) so can't use request=3.32.2 | ||||
|           python3 -m pip install requests==2.27.1 pyyaml==6.0.2 | ||||
|           python3 -m pip install requests==2.27.1 pyyaml==6.0.1 | ||||
|  | ||||
|     - name: Parse ref | ||||
|       id: parse-ref | ||||
| @ -125,7 +125,7 @@ runs: | ||||
|         TAG: ${{ steps.parse-ref.outputs.tag }} | ||||
|         EVENT_NAME: ${{ github.event_name }} | ||||
|         SCHEDULE: ${{ github.event.schedule }} | ||||
|         HEAD_BRANCH: ${{ steps.parse-ref.outputs.branch }} | ||||
|         HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||||
|       id: filter | ||||
|       run: | | ||||
|         echo "Workflow: ${GITHUB_WORKFLOW}" | ||||
| @ -157,4 +157,4 @@ runs: | ||||
|         echo "Is keep-going label set? ${{ steps.filter.outputs.keep-going }}" | ||||
|  | ||||
|         echo | ||||
|         echo "Reenabled issues? ${{ steps.filter.outputs.reenabled-issues }}" | ||||
|         echo "Renabled issues? ${{ steps.filter.outputs.reenabled-issues }}" | ||||
|  | ||||
							
								
								
									
										4
									
								
								.github/actions/linux-test/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/actions/linux-test/action.yml
									
									
									
									
										vendored
									
									
								
							| @ -126,7 +126,7 @@ runs: | ||||
|       shell: bash | ||||
|       continue-on-error: true | ||||
|       run: | | ||||
|         python3 -m pip install psutil==5.9.8 nvidia-ml-py==11.525.84 | ||||
|         python3 -m pip install psutil==5.9.1 nvidia-ml-py==11.525.84 | ||||
|         python3 -m tools.stats.monitor > usage_log.txt 2>&1 & | ||||
|         echo "monitor-script-pid=${!}" >> "${GITHUB_OUTPUT}" | ||||
|  | ||||
| @ -153,7 +153,7 @@ runs: | ||||
|         github-token: ${{ inputs.GITHUB_TOKEN }} | ||||
|  | ||||
|     - name: Check for keep-going label and re-enabled test issues | ||||
|       # This uses the filter-test-configs action because it conveniently | ||||
|       # This uses the filter-test-configs action because it conviniently | ||||
|       # checks for labels and re-enabled test issues.  It does not actually do | ||||
|       # any filtering.  All filtering is done in the build step. | ||||
|       id: keep-going | ||||
|  | ||||
							
								
								
									
										9
									
								
								.github/actions/reuse-old-whl/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/actions/reuse-old-whl/action.yml
									
									
									
									
										vendored
									
									
								
							| @ -13,12 +13,6 @@ inputs: | ||||
|   github-token: | ||||
|     description: GitHub token | ||||
|     required: true | ||||
|   job-id: | ||||
|     description: Job ID | ||||
|     required: true | ||||
|   job-name: | ||||
|     description: Job name | ||||
|     required: true | ||||
|  | ||||
| outputs: | ||||
|   reuse: | ||||
| @ -36,11 +30,8 @@ runs: | ||||
|       continue-on-error: true | ||||
|       env: | ||||
|         GITHUB_TOKEN: ${{ inputs.github-token }} | ||||
|         JOB_ID: ${{ inputs.job-id }} | ||||
|         JOB_NAME: ${{ inputs.job-name }} | ||||
|       run: | | ||||
|         set -x | ||||
|         python3 -m pip install boto3==1.35.42 | ||||
|         python3 ${GITHUB_ACTION_PATH}/reuse_old_whl.py \ | ||||
|           --build-environment "${{ inputs.build-environment }}" \ | ||||
|           --run-id "${{ inputs.run-id }}" \ | ||||
|  | ||||
							
								
								
									
										85
									
								
								.github/actions/reuse-old-whl/reuse_old_whl.py
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										85
									
								
								.github/actions/reuse-old-whl/reuse_old_whl.py
									
									
									
									
										vendored
									
									
								
							| @ -1,7 +1,6 @@ | ||||
| import argparse | ||||
| import os | ||||
| import subprocess | ||||
| import sys | ||||
| from functools import lru_cache | ||||
| from pathlib import Path | ||||
| from typing import Any, cast, Optional, Union | ||||
| @ -9,14 +8,6 @@ from typing import Any, cast, Optional, Union | ||||
| import requests | ||||
|  | ||||
|  | ||||
| REPO_ROOT = Path(__file__).resolve().parent.parent.parent.parent | ||||
| sys.path.insert(0, str(REPO_ROOT)) | ||||
| from tools.stats.upload_metrics import emit_metric | ||||
|  | ||||
|  | ||||
| sys.path.remove(str(REPO_ROOT))  # Clean up sys.path after import | ||||
|  | ||||
|  | ||||
| FORCE_REBUILD_LABEL = "ci-force-rebuild" | ||||
|  | ||||
|  | ||||
| @ -123,8 +114,6 @@ def ok_changed_file(file: str) -> bool: | ||||
|         return True | ||||
|     if file.startswith("test/") and file.endswith(".py"): | ||||
|         return True | ||||
|     if file.startswith("docs/") and file.endswith((".md", ".rst")): | ||||
|         return True | ||||
|     return False | ||||
|  | ||||
|  | ||||
| @ -132,26 +121,17 @@ def check_changed_files(sha: str) -> bool: | ||||
|     # Return true if all the changed files are in the list of allowed files to | ||||
|     # be changed to reuse the old whl | ||||
|  | ||||
|     # Removing files in the torch folder is not allowed since rsync will not | ||||
|     # remove files | ||||
|     # Removing any files is not allowed since rysnc will not remove files | ||||
|     removed_files = ( | ||||
|         subprocess.check_output( | ||||
|             [ | ||||
|                 "git", | ||||
|                 "diff", | ||||
|                 "--name-only", | ||||
|                 sha, | ||||
|                 "HEAD", | ||||
|                 "--diff-filter=D", | ||||
|                 "--no-renames", | ||||
|             ], | ||||
|             ["git", "diff", "--name-only", sha, "HEAD", "--diff-filter=D"], | ||||
|             text=True, | ||||
|             stderr=subprocess.DEVNULL, | ||||
|         ) | ||||
|         .strip() | ||||
|         .split() | ||||
|     ) | ||||
|     if any(file.startswith("torch/") for file in removed_files): | ||||
|     if removed_files: | ||||
|         print( | ||||
|             f"Removed files between {sha} and HEAD: {removed_files}, cannot reuse old whl" | ||||
|         ) | ||||
| @ -159,7 +139,7 @@ def check_changed_files(sha: str) -> bool: | ||||
|  | ||||
|     changed_files = ( | ||||
|         subprocess.check_output( | ||||
|             ["git", "diff", "--name-only", sha, "HEAD", "--no-renames"], | ||||
|             ["git", "diff", "--name-only", sha, "HEAD"], | ||||
|             text=True, | ||||
|             stderr=subprocess.DEVNULL, | ||||
|         ) | ||||
| @ -304,7 +284,8 @@ def unzip_artifact_and_replace_files() -> None: | ||||
|  | ||||
|  | ||||
| def set_output() -> None: | ||||
|     print("Setting output reuse=true") | ||||
|     # Disable for now so we can monitor first | ||||
|     # pass | ||||
|     if os.getenv("GITHUB_OUTPUT"): | ||||
|         with open(str(os.getenv("GITHUB_OUTPUT")), "a") as env: | ||||
|             print("reuse=true", file=env) | ||||
| @ -325,60 +306,46 @@ def parse_args() -> argparse.Namespace: | ||||
|     return parser.parse_args() | ||||
|  | ||||
|  | ||||
| def can_reuse_whl(args: argparse.Namespace) -> tuple[bool, str]: | ||||
|     if args.github_ref and any( | ||||
|         args.github_ref.startswith(x) | ||||
|         for x in [ | ||||
|             "refs/heads/release", | ||||
|             "refs/tags/v", | ||||
|             "refs/heads/nightly", | ||||
|         ] | ||||
|     ): | ||||
|         print("Release branch, rebuild whl") | ||||
|         return (False, "Release branch") | ||||
|  | ||||
|     if not check_changed_files(get_merge_base()): | ||||
|         print("Cannot use old whl due to the changed files, rebuild whl") | ||||
|         return (False, "Changed files not allowed") | ||||
| def can_reuse_whl(args: argparse.Namespace) -> bool: | ||||
|     # if is_main_branch() or ( | ||||
|     #     args.github_ref | ||||
|     #     and any( | ||||
|     #         args.github_ref.startswith(x) | ||||
|     #         for x in ["refs/heads/release", "refs/tags/v", "refs/heads/main"] | ||||
|     #     ) | ||||
|     # ): | ||||
|     #     print("On main branch or release branch, rebuild whl") | ||||
|     #     return False | ||||
|  | ||||
|     if check_labels_for_pr(): | ||||
|         print(f"Found {FORCE_REBUILD_LABEL} label on PR, rebuild whl") | ||||
|         return (False, "Found FORCE_REBUILD_LABEL on PR") | ||||
|         return False | ||||
|  | ||||
|     if check_issue_open(): | ||||
|         print("Issue #153759 is open, rebuild whl") | ||||
|         return (False, "Issue #153759 is open") | ||||
|         return False | ||||
|  | ||||
|     if not check_changed_files(get_merge_base()): | ||||
|         print("Cannot use old whl due to the changed files, rebuild whl") | ||||
|         return False | ||||
|  | ||||
|     workflow_id = get_workflow_id(args.run_id) | ||||
|     if workflow_id is None: | ||||
|         print("No workflow ID found, rebuild whl") | ||||
|         return (False, "No workflow ID found") | ||||
|         return False | ||||
|  | ||||
|     if not find_old_whl(workflow_id, args.build_environment, get_merge_base()): | ||||
|         print("No old whl found, rebuild whl") | ||||
|         return (False, "No old whl found") | ||||
|         # TODO: go backwards from merge base to find more runs | ||||
|         return False | ||||
|  | ||||
|     return (True, "Found old whl") | ||||
|     return True | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|     args = parse_args() | ||||
|  | ||||
|     reuse_whl, reason = can_reuse_whl(args) | ||||
|  | ||||
|     if reuse_whl: | ||||
|     if can_reuse_whl(args): | ||||
|         print("Reusing old whl") | ||||
|         unzip_artifact_and_replace_files() | ||||
|         set_output() | ||||
|  | ||||
|     emit_metric( | ||||
|         "reuse_old_whl", | ||||
|         { | ||||
|             "reuse_whl": reuse_whl, | ||||
|             "reason": reason, | ||||
|             "build_environment": args.build_environment, | ||||
|             "merge_base": get_merge_base(), | ||||
|             "head_sha": get_head_sha(), | ||||
|         }, | ||||
|     ) | ||||
|  | ||||
							
								
								
									
										4
									
								
								.github/actions/setup-linux/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/actions/setup-linux/action.yml
									
									
									
									
										vendored
									
									
								
							| @ -33,14 +33,14 @@ runs: | ||||
|       id: check_container_runner | ||||
|       run: echo "IN_CONTAINER_RUNNER=$(if [ -f /.inarc ] || [ -f /.incontainer ]; then echo true ; else echo false; fi)" >> "$GITHUB_OUTPUT" | ||||
|  | ||||
|     - name: Start docker if docker daemon is not running | ||||
|     - name: Start docker if docker deamon is not running | ||||
|       shell: bash | ||||
|       if: ${{ steps.check_container_runner.outputs.IN_CONTAINER_RUNNER == 'false' }} | ||||
|       run: | | ||||
|         if systemctl is-active --quiet docker; then | ||||
|             echo "Docker daemon is running..."; | ||||
|         else | ||||
|             echo "Starting docker daemon..." && sudo systemctl start docker; | ||||
|             echo "Starting docker deamon..." && sudo systemctl start docker; | ||||
|         fi | ||||
|  | ||||
|     - name: Log in to ECR | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/actions/setup-xpu/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/actions/setup-xpu/action.yml
									
									
									
									
										vendored
									
									
								
							| @ -35,7 +35,7 @@ runs: | ||||
|       if: always() | ||||
|       shell: bash | ||||
|       run: | | ||||
|         ngpu=$(timeout 30 xpu-smi discovery | grep -c -E 'Device Name' || true) | ||||
|         ngpu=$(timeout 30 xpu-smi discovery | grep -c -E 'Device Name') | ||||
|         msg="Please file an issue on pytorch/pytorch reporting the faulty runner. Include a link to the runner logs so the runner can be identified" | ||||
|         if [[ $ngpu -eq 0 ]]; then | ||||
|           echo "Error: Failed to detect any GPUs on the runner" | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/ci_commit_pins/audio.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ci_commit_pins/audio.txt
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| bf305f538005f2e900f8850ed57146024a8bc559 | ||||
| 4cb7f57d31b0b288696f09b89e890e5fac092eed | ||||
|  | ||||
							
								
								
									
										2
									
								
								.github/ci_commit_pins/fbgemm_rocm.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ci_commit_pins/fbgemm_rocm.txt
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| 7f1de94a4c2d14f59ad4ca84538c36084ea6b2c8 | ||||
| 5fb5024118e9bb9decf96c2b0b1a8f0010bf56be | ||||
|  | ||||
							
								
								
									
										1
									
								
								.github/ci_commit_pins/vllm.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/ci_commit_pins/vllm.txt
									
									
									
									
										vendored
									
									
								
							| @ -1 +0,0 @@ | ||||
| ca9e2be3ed6320b51f52f536595cd24e254f8bb2 | ||||
							
								
								
									
										2
									
								
								.github/ci_commit_pins/xla.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ci_commit_pins/xla.txt
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| 29ae4c76c026185f417a25e841d2cd5e65f087a3 | ||||
| edc1a882d872dd7f1362e4312fd045a1d81b3355 | ||||
|  | ||||
							
								
								
									
										9
									
								
								.github/label_to_label.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/label_to_label.yml
									
									
									
									
										vendored
									
									
								
							| @ -48,12 +48,3 @@ | ||||
|   - "module: dynamic shapes" | ||||
|   then: | ||||
|   - "oncall: pt2" | ||||
| - any: | ||||
|   - "release notes: distributed (c10d)" | ||||
|   - "release notes: distributed (symm_mem)" | ||||
|   - "release notes: distributed (pipeline)" | ||||
|   - "release notes: distributed (fsdp)" | ||||
|   - "release notes: distributed (dtensor)" | ||||
|   - "oncall: distributed" | ||||
|   then: | ||||
|   - "ciflow/h100-distributed" | ||||
|  | ||||
							
								
								
									
										1
									
								
								.github/labeler.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/labeler.yml
									
									
									
									
										vendored
									
									
								
							| @ -116,6 +116,7 @@ | ||||
| "release notes: inductor (aoti)": | ||||
| - torch/_C/_aoti.pyi | ||||
| - torch/_dynamo/repro/aoti.py | ||||
| - torch/_export/serde/aoti_schema.py | ||||
| - torch/_higher_order_ops/aoti_call_delegate.py | ||||
| - torch/_inductor/codegen/aoti_runtime/** | ||||
| - torch/_inductor/codegen/aoti_hipify_utils.py | ||||
|  | ||||
							
								
								
									
										31
									
								
								.github/merge_rules.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								.github/merge_rules.yaml
									
									
									
									
										vendored
									
									
								
							| @ -76,7 +76,6 @@ | ||||
|   - .github/ci_commit_pins/audio.txt | ||||
|   - .github/ci_commit_pins/vision.txt | ||||
|   - .github/ci_commit_pins/torchdynamo.txt | ||||
|   - .github/ci_commit_pins/vllm.txt | ||||
|   - .ci/docker/ci_commit_pins/triton.txt | ||||
|   approved_by: | ||||
|   - pytorchbot | ||||
| @ -131,6 +130,21 @@ | ||||
|   - Lint | ||||
|   - pull | ||||
|  | ||||
| - name: Mobile | ||||
|   patterns: | ||||
|   - ios/** | ||||
|   - android/** | ||||
|   - test/mobile/** | ||||
|   approved_by: | ||||
|   - linbinyu | ||||
|   - IvanKobzarev | ||||
|   - dreiss | ||||
|   - raziel | ||||
|   mandatory_checks_name: | ||||
|   - EasyCLA | ||||
|   - Lint | ||||
|   - pull | ||||
|  | ||||
| - name: PrimTorch | ||||
|   patterns: | ||||
|   - torch/_meta_registrations.py | ||||
| @ -370,7 +384,6 @@ | ||||
|   - leslie-fang-intel | ||||
|   - jgong5 | ||||
|   - EikanWang | ||||
|   - CaoE | ||||
|   mandatory_checks_name: | ||||
|   - EasyCLA | ||||
|   - Lint | ||||
| @ -422,7 +435,6 @@ | ||||
|   approved_by: | ||||
|   - leslie-fang-intel | ||||
|   - jgong5 | ||||
|   - CaoE | ||||
|   mandatory_checks_name: | ||||
|   - EasyCLA | ||||
|   - Lint | ||||
| @ -477,19 +489,6 @@ | ||||
|   - srossross | ||||
|   - chillee | ||||
|   - zou3519 | ||||
|   - guilhermeleobas | ||||
|   mandatory_checks_name: | ||||
|   - EasyCLA | ||||
|   - Lint | ||||
|   - pull | ||||
|  | ||||
| - name: Dynamo | ||||
|   patterns: | ||||
|   - torch/_dynamo/** | ||||
|   - torch/csrc/dynamo/** | ||||
|   - test/dynamo/** | ||||
|   approved_by: | ||||
|   - guilhermeleobas | ||||
|   mandatory_checks_name: | ||||
|   - EasyCLA | ||||
|   - Lint | ||||
|  | ||||
							
								
								
									
										5
									
								
								.github/pytorch-probot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/pytorch-probot.yml
									
									
									
									
										vendored
									
									
								
							| @ -4,7 +4,6 @@ ciflow_push_tags: | ||||
| - ciflow/binaries | ||||
| - ciflow/binaries_libtorch | ||||
| - ciflow/binaries_wheel | ||||
| - ciflow/triton_binaries | ||||
| - ciflow/inductor | ||||
| - ciflow/inductor-periodic | ||||
| - ciflow/inductor-rocm | ||||
| @ -12,7 +11,6 @@ ciflow_push_tags: | ||||
| - ciflow/inductor-perf-compare | ||||
| - ciflow/inductor-micro-benchmark | ||||
| - ciflow/inductor-micro-benchmark-cpu-x86 | ||||
| - ciflow/inductor-perf-test-nightly-x86-zen | ||||
| - ciflow/inductor-cu126 | ||||
| - ciflow/linux-aarch64 | ||||
| - ciflow/mps | ||||
| @ -31,9 +29,6 @@ ciflow_push_tags: | ||||
| - ciflow/pull | ||||
| - ciflow/h100 | ||||
| - ciflow/h100-distributed | ||||
| - ciflow/win-arm64 | ||||
| - ciflow/h100-symm-mem | ||||
| - ciflow/h100-cutlass-backend | ||||
| retryable_workflows: | ||||
| - pull | ||||
| - trunk | ||||
|  | ||||
							
								
								
									
										11
									
								
								.github/requirements-gha-cache.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								.github/requirements-gha-cache.txt
									
									
									
									
										vendored
									
									
								
							| @ -1,15 +1,14 @@ | ||||
| # This file is to cache other dependencies not specified elsewhere in: | ||||
| #   requirements.txt | ||||
| #   requirements-build.txt | ||||
| #   requirement.txt | ||||
| #   docs/requirements.txt | ||||
| #   docs/cpp/requirements.txt | ||||
| #   functorch/docs/requirements.txt | ||||
| #   .ci/docker/requirements-ci.txt | ||||
| boto3==1.35.42 | ||||
| jinja2==3.1.6 | ||||
| lintrunner==0.12.7 | ||||
| lintrunner==0.10.7 | ||||
| ninja==1.10.0.post1 | ||||
| nvidia-ml-py==11.525.84 | ||||
| pyyaml==6.0.2 | ||||
| requests==2.32.4 | ||||
| rich==14.1.0 | ||||
| pyyaml==6.0 | ||||
| requests==2.32.2 | ||||
| rich==10.9.0 | ||||
|  | ||||
							
								
								
									
										1
									
								
								.github/requirements/conda-env-macOS-ARM64
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/requirements/conda-env-macOS-ARM64
									
									
									
									
										vendored
									
									
								
							| @ -2,4 +2,5 @@ | ||||
| certifi | ||||
| pip=23.2.1 | ||||
| pkg-config=0.29.2 | ||||
| setuptools=72.1.0 | ||||
| wheel=0.37.1 | ||||
|  | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	