Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/_win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ on:
description: |
If this is set, our linter will use this to make sure that every other
job with the same `sync-tag` is identical.
test-matrix:
required: false
type: string
description: |
An option JSON description of what test configs to run later on. This
is moved here from the Linux test workflow so that we can apply filter
logic using test-config labels earlier and skip unnecessary builds

outputs:
test-matrix:
value: ${{ inputs.test-matrix }}
description: An optional JSON description of what test configs to run later on.

env:
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
Expand Down Expand Up @@ -61,7 +73,17 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Apply the filter logic to the build step too if the test-config label is already there
- name: Select all requested test configurations (if the test matrix is available)
id: filter
uses: ./.github/actions/filter-test-configs
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-matrix: ${{ inputs.test-matrix }}

- name: Build
if: steps.filter.outputs.is-test-matrix-empty == 'False' || inputs.test-matrix == ''
id: build
shell: bash
env:
PYTORCH_FINAL_PACKAGE_DIR: /c/${{ github.run_id }}/build-results/
Expand Down Expand Up @@ -89,6 +111,7 @@ jobs:

# Upload to github so that people can click and download artifacts
- name: Upload artifacts to s3
if: steps.build.outcome != 'skipped'
uses: seemethere/upload-artifact-s3@v5
with:
retention-days: 14
Expand All @@ -97,6 +120,7 @@ jobs:
path: C:\${{ github.run_id }}\build-results

- name: Upload sccache stats
if: steps.build.outcome != 'skipped'
uses: seemethere/upload-artifact-s3@v5
with:
s3-prefix: |
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/_win-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,33 @@ env:
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

jobs:
# This needs to be run right before the test starts so that it can gather the
# latest labels from the PR
filter:
runs-on: [self-hosted, linux.large]
outputs:
test-matrix: ${{ steps.filter.outputs.test-matrix }}
is-test-matrix-empty: ${{ steps.filter.outputs.is-test-matrix-empty }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
with:
fetch-depth: 1
submodules: false

- name: Select all requested test configurations
id: filter
uses: ./.github/actions/filter-test-configs
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-matrix: ${{ inputs.test-matrix }}

test:
# Don't run on forked repos.
if: github.repository_owner == 'pytorch'
needs: filter
# Don't run on forked repos or empty test matrix
if: github.repository_owner == 'pytorch' && needs.filter.outputs.is-test-matrix-empty == 'False'
strategy:
matrix: ${{ fromJSON(inputs.test-matrix) }}
matrix: ${{ fromJSON(needs.filter.outputs.test-matrix) }}
fail-fast: false
runs-on: ${{ matrix.runner }}
timeout-minutes: 300
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ jobs:
with:
build-environment: win-vs2019-cuda11.7-py3
cuda-version: "11.7"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}

win-vs2019-cuda11_7-py3-test:
name: win-vs2019-cuda11.7-py3
Expand All @@ -170,12 +176,7 @@ jobs:
with:
build-environment: win-vs2019-cuda11.7-py3
cuda-version: "11.7"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
test-matrix: ${{ needs.win-vs2019-cuda11_7-py3-build.outputs.test-matrix }}

ios-12-5-1-x86-64-coreml:
name: ios-12-5-1-x86-64-coreml
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ jobs:
with:
build-environment: win-vs2019-cpu-py3
cuda-version: cpu
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}

win-vs2019-cpu-py3-test:
name: win-vs2019-cpu-py3
Expand All @@ -245,12 +251,7 @@ jobs:
with:
build-environment: win-vs2019-cpu-py3
cuda-version: cpu
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
test-matrix: ${{ needs.win-vs2019-cpu-py3-build.outputs.test-matrix }}

win-vs2019-cuda11_6-py3-build:
if: github.event_name == 'pull_request'
Expand All @@ -260,6 +261,16 @@ jobs:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
sync-tag: win-cuda-build
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 3, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 4, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 5, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}

linux-bionic-cuda11_6-py3_10-gcc7-bazel-test:
name: linux-bionic-cuda11.6-py3.10-gcc7-bazel-test
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,6 @@ jobs:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
sync-tag: win-cuda-build

win-vs2019-cuda11_6-py3-test:
name: win-vs2019-cuda11.6-py3
uses: ./.github/workflows/_win-test.yml
needs: win-vs2019-cuda11_6-py3-build
with:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
Expand All @@ -239,6 +231,15 @@ jobs:
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}

win-vs2019-cuda11_6-py3-test:
name: win-vs2019-cuda11.6-py3
uses: ./.github/workflows/_win-test.yml
needs: win-vs2019-cuda11_6-py3-build
with:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
test-matrix: ${{ needs.win-vs2019-cuda11_6-py3-build.outputs.test-matrix }}

linux-focal-rocm5_2-py3_7-build:
name: linux-focal-rocm5.2-py3.7
uses: ./.github/workflows/_linux-build.yml
Expand Down