From 00e7fa164bfdfd302f0b471c18ce2fd6bd1a50bc Mon Sep 17 00:00:00 2001 From: venkatram-dev <45727389+venkatram-dev@users.noreply.github.com> Date: Mon, 9 Sep 2024 04:41:56 -0700 Subject: [PATCH 1/6] Fix f-string in color error message (#8639) --- torchvision/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchvision/utils.py b/torchvision/utils.py index 33ac826e5ce..b69edcb572e 100644 --- a/torchvision/utils.py +++ b/torchvision/utils.py @@ -604,9 +604,9 @@ def _parse_colors( f"Number of colors must be equal or larger than the number of objects, but got {len(colors)} < {num_objects}." ) elif not isinstance(colors, (tuple, str)): - raise ValueError("`colors` must be a tuple or a string, or a list thereof, but got {colors}.") + raise ValueError(f"`colors` must be a tuple or a string, or a list thereof, but got {colors}.") elif isinstance(colors, tuple) and len(colors) != 3: - raise ValueError("If passed as tuple, colors should be an RGB triplet, but got {colors}.") + raise ValueError(f"If passed as tuple, colors should be an RGB triplet, but got {colors}.") else: # colors specifies a single color for all objects colors = [colors] * num_objects From db5f8a00f74a39233ee00d7549e837c6b205b9de Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 11 Sep 2024 12:27:26 -0400 Subject: [PATCH 2/6] Fix compile with nvjpeg on Windows CUDA 12 (#8641) --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dbe8ce58aa2..4b0525d8e41 100644 --- a/setup.py +++ b/setup.py @@ -366,7 +366,7 @@ def make_image_extension(): else: warnings.warn("Building torchvision without AVIF support") - if USE_NVJPEG and torch.cuda.is_available(): + if USE_NVJPEG and (torch.cuda.is_available() or FORCE_CUDA): nvjpeg_found = CUDA_HOME is not None and (Path(CUDA_HOME) / "include/nvjpeg.h").exists() if nvjpeg_found: @@ -376,6 +376,8 @@ def make_image_extension(): Extension = CUDAExtension else: warnings.warn("Building torchvision without NVJPEG support") + elif USE_NVJPEG: + warnings.warn("Building torchvision without NVJPEG support") return Extension( name="torchvision.image", From dfdcd9439625ce048fd73140fd18f97c513f67b3 Mon Sep 17 00:00:00 2001 From: Sergii Dymchenko Date: Wed, 11 Sep 2024 13:06:24 -0700 Subject: [PATCH 3/6] Use @release/2.5 instead of @main for CI jobs (#8643) --- .github/workflows/build-cmake.yml | 12 +++++------ .github/workflows/build-conda-linux.yml | 8 ++++---- .github/workflows/build-conda-m1.yml | 8 ++++---- .github/workflows/build-conda-windows.yml | 8 ++++---- .../workflows/build-wheels-aarch64-linux.yml | 8 ++++---- .github/workflows/build-wheels-linux.yml | 8 ++++---- .github/workflows/build-wheels-m1.yml | 8 ++++---- .github/workflows/build-wheels-windows.yml | 8 ++++---- .github/workflows/docs.yml | 8 ++++---- .github/workflows/lint.yml | 14 ++++++------- .../workflows/prototype-tests-linux-gpu.yml | 2 +- .github/workflows/tests.yml | 20 +++++++++---------- .github/workflows/update-viablestrict.yml | 4 ++-- 13 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 561b419297f..5046458b322 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -20,13 +20,13 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -42,11 +42,11 @@ jobs: include: - runner: macos-m1-stable fail-fast: false - uses: pytorch/test-infra/.github/workflows/macos_job.yml@main + uses: pytorch/test-infra/.github/workflows/macos_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -66,13 +66,13 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@main + uses: pytorch/test-infra/.github/workflows/windows_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail diff --git a/.github/workflows/build-conda-linux.yml b/.github/workflows/build-conda-linux.yml index a445ef9af25..83343b3440a 100644 --- a/.github/workflows/build-conda-linux.yml +++ b/.github/workflows/build-conda-linux.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: conda os: linux test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build: needs: generate-matrix strategy: @@ -34,13 +34,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_linux.yml@main + uses: pytorch/test-infra/.github/workflows/build_conda_linux.yml@release/2.5 with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-conda-m1.yml b/.github/workflows/build-conda-m1.yml index e8f6546a678..677e4ae2820 100644 --- a/.github/workflows/build-conda-m1.yml +++ b/.github/workflows/build-conda-m1.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: conda os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build: needs: generate-matrix strategy: @@ -34,13 +34,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@main + uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@release/2.5 with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} env-var-script: ./.github/scripts/export_IS_M1_CONDA_BUILD_JOB.sh pre-script: ${{ matrix.pre-script }} diff --git a/.github/workflows/build-conda-windows.yml b/.github/workflows/build-conda-windows.yml index f404c06b888..0aa726d7c90 100644 --- a/.github/workflows/build-conda-windows.yml +++ b/.github/workflows/build-conda-windows.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: conda os: windows test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build: needs: generate-matrix strategy: @@ -35,13 +35,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_windows.yml@main + uses: pytorch/test-infra/.github/workflows/build_conda_windows.yml@release/2.5 with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-aarch64-linux.yml b/.github/workflows/build-wheels-aarch64-linux.yml index 05c83991d5b..390108135d4 100644 --- a/.github/workflows/build-wheels-aarch64-linux.yml +++ b/.github/workflows/build-wheels-aarch64-linux.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: wheel os: linux-aarch64 test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 with-cuda: disable build: needs: generate-matrix @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@release/2.5 with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-linux.yml b/.github/workflows/build-wheels-linux.yml index 818f32c102b..340ecc56a0f 100644 --- a/.github/workflows/build-wheels-linux.yml +++ b/.github/workflows/build-wheels-linux.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: wheel os: linux test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 with-xpu: enable build: needs: generate-matrix @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@release/2.5 with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index 76709b755e8..ec74ec90b9c 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: wheel os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build: needs: generate-matrix strategy: @@ -37,12 +37,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main + uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@release/2.5 with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 818d9f78b08..b1f732372f5 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 with: package-type: wheel os: windows test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build: needs: generate-matrix strategy: @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main + uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@release/2.5 with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: release/2.5 build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} env-script: ${{ matrix.env-script }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4899b81c956..5381816e26f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,11 +14,11 @@ on: jobs: build: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision upload-artifact: docs - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -81,12 +81,12 @@ jobs: ((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag') permissions: contents: write - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision download-artifact: docs ref: gh-pages - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eac1c009eec..630db023538 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,10 @@ on: jobs: python-source-and-configs: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -38,10 +38,10 @@ jobs: fi c-source: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -65,10 +65,10 @@ jobs: python-types: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -95,7 +95,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run BC Lint Action - uses: pytorch/test-infra/.github/actions/bc-lint@main + uses: pytorch/test-infra/.github/actions/bc-lint@release/2.5 with: repo: ${{ github.event.pull_request.head.repo.full_name }} base_sha: ${{ github.event.pull_request.base.sha }} diff --git a/.github/workflows/prototype-tests-linux-gpu.yml b/.github/workflows/prototype-tests-linux-gpu.yml index 7fbe77ca146..f5171bf633b 100644 --- a/.github/workflows/prototype-tests-linux-gpu.yml +++ b/.github/workflows/prototype-tests-linux-gpu.yml @@ -23,7 +23,7 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f03b0a59eb..a17c006e7d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,14 +26,14 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -53,12 +53,12 @@ jobs: - "3.12" runner: ["macos-m1-stable"] fail-fast: false - uses: pytorch/test-infra/.github/workflows/macos_job.yml@main + uses: pytorch/test-infra/.github/workflows/macos_job.yml@release/2.5 with: repository: pytorch/vision timeout: 240 runner: ${{ matrix.runner }} - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -84,14 +84,14 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@main + uses: pytorch/test-infra/.github/workflows/windows_job.yml@release/2.5 with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euxo pipefail @@ -104,10 +104,10 @@ jobs: ./.github/scripts/unittest.sh onnx: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 with: repository: pytorch/vision - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail @@ -135,11 +135,11 @@ jobs: echo '::endgroup::' unittests-extended: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 if: contains(github.event.pull_request.labels.*.name, 'run-extended') with: repository: pytorch/vision - test-infra-ref: main + test-infra-ref: release/2.5 script: | set -euo pipefail diff --git a/.github/workflows/update-viablestrict.yml b/.github/workflows/update-viablestrict.yml index 8e4889b9ba7..a636612f4ad 100644 --- a/.github/workflows/update-viablestrict.yml +++ b/.github/workflows/update-viablestrict.yml @@ -14,11 +14,11 @@ concurrency: jobs: do_update_viablestrict: - uses: pytorch/test-infra/.github/workflows/update-viablestrict.yml@main + uses: pytorch/test-infra/.github/workflows/update-viablestrict.yml@release/2.5 with: repository: pytorch/vision required_checks: "Build Linux,Build M1,Build Macos,Build Windows,Tests,CMake,Lint,Docs" - test-infra-ref: main + test-infra-ref: release/2.5 secrets: ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} GITHUB_DEPLOY_KEY : ${{ secrets.VISION_GITHUB_DEPLOY_KEY }} From 8a4d82d2704194f8afff1578b2b559c0ae4e8bd0 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 11 Sep 2024 21:23:02 -0400 Subject: [PATCH 4/6] Revert "Use @release/2.5 instead of @main for CI jobs" (#8645) --- .github/workflows/build-cmake.yml | 12 +++++------ .github/workflows/build-conda-linux.yml | 8 ++++---- .github/workflows/build-conda-m1.yml | 8 ++++---- .github/workflows/build-conda-windows.yml | 8 ++++---- .../workflows/build-wheels-aarch64-linux.yml | 8 ++++---- .github/workflows/build-wheels-linux.yml | 8 ++++---- .github/workflows/build-wheels-m1.yml | 8 ++++---- .github/workflows/build-wheels-windows.yml | 8 ++++---- .github/workflows/docs.yml | 8 ++++---- .github/workflows/lint.yml | 14 ++++++------- .../workflows/prototype-tests-linux-gpu.yml | 2 +- .github/workflows/tests.yml | 20 +++++++++---------- .github/workflows/update-viablestrict.yml | 4 ++-- 13 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 5046458b322..561b419297f 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -20,13 +20,13 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -42,11 +42,11 @@ jobs: include: - runner: macos-m1-stable fail-fast: false - uses: pytorch/test-infra/.github/workflows/macos_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -66,13 +66,13 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/windows_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail diff --git a/.github/workflows/build-conda-linux.yml b/.github/workflows/build-conda-linux.yml index 83343b3440a..a445ef9af25 100644 --- a/.github/workflows/build-conda-linux.yml +++ b/.github/workflows/build-conda-linux.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: conda os: linux test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build: needs: generate-matrix strategy: @@ -34,13 +34,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_linux.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_conda_linux.yml@main with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-conda-m1.yml b/.github/workflows/build-conda-m1.yml index 677e4ae2820..e8f6546a678 100644 --- a/.github/workflows/build-conda-m1.yml +++ b/.github/workflows/build-conda-m1.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: conda os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build: needs: generate-matrix strategy: @@ -34,13 +34,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@main with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} env-var-script: ./.github/scripts/export_IS_M1_CONDA_BUILD_JOB.sh pre-script: ${{ matrix.pre-script }} diff --git a/.github/workflows/build-conda-windows.yml b/.github/workflows/build-conda-windows.yml index 0aa726d7c90..f404c06b888 100644 --- a/.github/workflows/build-conda-windows.yml +++ b/.github/workflows/build-conda-windows.yml @@ -15,12 +15,12 @@ on: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: conda os: windows test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build: needs: generate-matrix strategy: @@ -35,13 +35,13 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_conda_windows.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_conda_windows.yml@main with: conda-package-directory: ${{ matrix.conda-package-directory }} repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-aarch64-linux.yml b/.github/workflows/build-wheels-aarch64-linux.yml index 390108135d4..05c83991d5b 100644 --- a/.github/workflows/build-wheels-aarch64-linux.yml +++ b/.github/workflows/build-wheels-aarch64-linux.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: wheel os: linux-aarch64 test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main with-cuda: disable build: needs: generate-matrix @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-linux.yml b/.github/workflows/build-wheels-linux.yml index 340ecc56a0f..818f32c102b 100644 --- a/.github/workflows/build-wheels-linux.yml +++ b/.github/workflows/build-wheels-linux.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: wheel os: linux test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main with-xpu: enable build: needs: generate-matrix @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index ec74ec90b9c..76709b755e8 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: wheel os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build: needs: generate-matrix strategy: @@ -37,12 +37,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} post-script: ${{ matrix.post-script }} diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index b1f732372f5..818d9f78b08 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main with: package-type: wheel os: windows test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build: needs: generate-matrix strategy: @@ -38,12 +38,12 @@ jobs: smoke-test-script: test/smoke_test.py package-name: torchvision name: ${{ matrix.repository }} - uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main with: repository: ${{ matrix.repository }} ref: "" test-infra-repository: pytorch/test-infra - test-infra-ref: release/2.5 + test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: ${{ matrix.pre-script }} env-script: ${{ matrix.env-script }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5381816e26f..4899b81c956 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,11 +14,11 @@ on: jobs: build: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision upload-artifact: docs - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -81,12 +81,12 @@ jobs: ((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag') permissions: contents: write - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision download-artifact: docs ref: gh-pages - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 630db023538..eac1c009eec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,10 @@ on: jobs: python-source-and-configs: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -38,10 +38,10 @@ jobs: fi c-source: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -65,10 +65,10 @@ jobs: python-types: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -95,7 +95,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run BC Lint Action - uses: pytorch/test-infra/.github/actions/bc-lint@release/2.5 + uses: pytorch/test-infra/.github/actions/bc-lint@main with: repo: ${{ github.event.pull_request.head.repo.full_name }} base_sha: ${{ github.event.pull_request.base.sha }} diff --git a/.github/workflows/prototype-tests-linux-gpu.yml b/.github/workflows/prototype-tests-linux-gpu.yml index f5171bf633b..7fbe77ca146 100644 --- a/.github/workflows/prototype-tests-linux-gpu.yml +++ b/.github/workflows/prototype-tests-linux-gpu.yml @@ -23,7 +23,7 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a17c006e7d4..6f03b0a59eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,14 +26,14 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -53,12 +53,12 @@ jobs: - "3.12" runner: ["macos-m1-stable"] fail-fast: false - uses: pytorch/test-infra/.github/workflows/macos_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/macos_job.yml@main with: repository: pytorch/vision timeout: 240 runner: ${{ matrix.runner }} - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -84,14 +84,14 @@ jobs: gpu-arch-type: cuda gpu-arch-version: "11.8" fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/windows_job.yml@main with: repository: pytorch/vision runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euxo pipefail @@ -104,10 +104,10 @@ jobs: ./.github/scripts/unittest.sh onnx: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail @@ -135,11 +135,11 @@ jobs: echo '::endgroup::' unittests-extended: - uses: pytorch/test-infra/.github/workflows/linux_job.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main if: contains(github.event.pull_request.labels.*.name, 'run-extended') with: repository: pytorch/vision - test-infra-ref: release/2.5 + test-infra-ref: main script: | set -euo pipefail diff --git a/.github/workflows/update-viablestrict.yml b/.github/workflows/update-viablestrict.yml index a636612f4ad..8e4889b9ba7 100644 --- a/.github/workflows/update-viablestrict.yml +++ b/.github/workflows/update-viablestrict.yml @@ -14,11 +14,11 @@ concurrency: jobs: do_update_viablestrict: - uses: pytorch/test-infra/.github/workflows/update-viablestrict.yml@release/2.5 + uses: pytorch/test-infra/.github/workflows/update-viablestrict.yml@main with: repository: pytorch/vision required_checks: "Build Linux,Build M1,Build Macos,Build Windows,Tests,CMake,Lint,Docs" - test-infra-ref: release/2.5 + test-infra-ref: main secrets: ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} GITHUB_DEPLOY_KEY : ${{ secrets.VISION_GITHUB_DEPLOY_KEY }} From 7eb09df3901091b08882c1b6df82fcbd0b710cd3 Mon Sep 17 00:00:00 2001 From: Sergii Dymchenko Date: Thu, 12 Sep 2024 02:43:39 -0700 Subject: [PATCH 5/6] [Release 2.5] Update compatibility matrix (#8644) Co-authored-by: Nicolas Hug --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60583c45256..1076a7a186d 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ versions. | `torch` | `torchvision` | Python | | ------------------ | ------------------ | ------------------- | | `main` / `nightly` | `main` / `nightly` | `>=3.9`, `<=3.12` | +| `2.5` | `0.20` | `>=3.9`, `<=3.12` | | `2.4` | `0.19` | `>=3.8`, `<=3.12` | | `2.3` | `0.18` | `>=3.8`, `<=3.12` | | `2.2` | `0.17` | `>=3.8`, `<=3.11` | From 6d7851bd5e2bedc294e40e90532f0e375fcfee04 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 12 Sep 2024 16:48:47 +0100 Subject: [PATCH 6/6] Expose libavif and heic internally (#8647) --- test/test_image.py | 10 ++++++++++ torchvision/_internally_replaced_utils.py | 1 + torchvision/io/__init__.py | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/test/test_image.py b/test/test_image.py index 624dc57fada..f3c2984b348 100644 --- a/test/test_image.py +++ b/test/test_image.py @@ -4,6 +4,7 @@ import os import re import sys +from contextlib import nullcontext from pathlib import Path import numpy as np @@ -13,6 +14,7 @@ import torchvision.transforms.v2.functional as F from common_utils import assert_equal, cpu_and_cuda, IN_OSS_CI, needs_cuda from PIL import __version__ as PILLOW_VERSION, Image, ImageOps, ImageSequence +from torchvision._internally_replaced_utils import IN_FBCODE from torchvision.io.image import ( _decode_avif, _decode_heic, @@ -1076,5 +1078,13 @@ def test_mode_str(): assert decode_image(path, mode="RGBA").shape[0] == 4 +def test_avif_heic_fbcode(): + cm = nullcontext() if IN_FBCODE else pytest.raises(ImportError, match="cannot import") + with cm: + from torchvision.io import decode_heic # noqa + with cm: + from torchvision.io import decode_avif # noqa + + if __name__ == "__main__": pytest.main([__file__]) diff --git a/torchvision/_internally_replaced_utils.py b/torchvision/_internally_replaced_utils.py index d9a6e261ea2..e0fa72489f1 100644 --- a/torchvision/_internally_replaced_utils.py +++ b/torchvision/_internally_replaced_utils.py @@ -6,6 +6,7 @@ _HOME = os.path.join(_get_torch_home(), "datasets", "vision") _USE_SHARDED_DATASETS = False +IN_FBCODE = False def _download_file_from_remote_location(fpath: str, url: str) -> None: diff --git a/torchvision/io/__init__.py b/torchvision/io/__init__.py index a604ea1fdb6..0dcbd7e9cea 100644 --- a/torchvision/io/__init__.py +++ b/torchvision/io/__init__.py @@ -74,3 +74,10 @@ "Video", "VideoReader", ] + +from .._internally_replaced_utils import IN_FBCODE + +if IN_FBCODE: + from .image import _decode_avif as decode_avif, _decode_heic as decode_heic + + __all__ += ["decode_avif", "decode_heic"]