Skip to content

Commit 5c716ab

Browse files
authored
Make torchaudio validation optional. Remove use-cloudflare-cdn and use-version-set options. (#7983)
## Summary - Remove `use-cloudflare-cdn` option from validate-binaries workflows and scripts (no longer needed) - Remove `use-version-set` option from validate-binaries workflows and scripts (no longer needed) - Change default binary validation to install and test **torch + torchvision** only (using `--package torch_torchvision` smoke test flag) - Add new `include-torchaudio` boolean option to validate torchaudio when explicitly needed ## Details The `use-cloudflare-cdn` and `use-version-set` options are removed from all validation workflow files and the `validate_binaries.sh` script as they are no longer used. Torchaudio is removed from default validation since `smoke_test.py` already supports `--package torch_torchvision` for testing only torch and torchvision. The new `include-torchaudio` option (default: false) can be set to include torchaudio when needed — this adds torchaudio to the install command and runs the full smoke test without a package filter. ## Test plan - [ ] Verify nightly validation workflow runs successfully with default (torch + torchvision only) - [ ] Verify `include-torchaudio: true` correctly installs and tests torchaudio - [ ] Verify `torchonly: true` still works as expected - [ ] Verify manual `workflow_dispatch` shows new `include-torchaudio` option
1 parent 3009116 commit 5c716ab

16 files changed

+261
-325
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,21 @@ build_installation_command() {
6464
installation=${installation/"--index-url"/"--extra-index-url"}
6565
fi
6666

67-
# use-cloudflare-cdn: use cloudflare cdn for pypi download
68-
if [[ ${USE_CLOUDFLARE_CDN:-} == 'true' ]]; then
69-
installation=${installation/"download.pytorch.org"/"download-r2.pytorch.org"}
67+
# torch-only option: remove torchvision
68+
if [[ ${TORCH_ONLY:-} == 'true' ]]; then
69+
installation=${installation/" torchvision"/""}
7070
fi
7171

72-
# torch-only option: remove vision and audio
73-
if [[ ${TORCH_ONLY:-} == 'true' ]]; then
74-
installation=${installation/"torchvision torchaudio"/""}
72+
# include-torchaudio option: add torchaudio to installation
73+
if [[ ${INCLUDE_TORCHAUDIO:-} == 'true' ]]; then
74+
installation=${installation/"torchvision "/"torchvision torchaudio "}
7575
fi
7676

7777
# if RELEASE version is passed as parameter - install specific version
7878
if [[ -n ${RELEASE_VERSION:-} ]]; then
7979
installation=${installation/"torch "/"torch==${RELEASE_VERSION} "}
8080
installation=${installation/"-y pytorch "/"-y pytorch==${RELEASE_VERSION} "}
8181
installation=${installation/"::pytorch "/"::pytorch==${RELEASE_VERSION} "}
82-
83-
if [[ ${USE_VERSION_SET:-} == 'true' ]]; then
84-
installation=${installation/"torchvision "/"torchvision==${VISION_RELEASE_VERSION} "}
85-
installation=${installation/"torchaudio "/"torchaudio==${AUDIO_RELEASE_VERSION} "}
86-
fi
8782
fi
8883

8984
echo "${installation}"
@@ -93,8 +88,10 @@ build_installation_command() {
9388
get_test_suffix() {
9489
if [[ ${TORCH_ONLY:-} == 'true' ]]; then
9590
echo "--package torchonly"
96-
else
91+
elif [[ ${INCLUDE_TORCHAUDIO:-} == 'true' ]]; then
9792
echo ""
93+
else
94+
echo "--package torch_torchvision"
9895
fi
9996
}
10097

.github/scripts/validate_poetry.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ cd test_poetry
1111
TEST_SUFFIX=""
1212
if [[ ${TORCH_ONLY} == 'true' ]]; then
1313
TEST_SUFFIX=" --package torchonly"
14+
elif [[ ${INCLUDE_TORCHAUDIO:-} == 'true' ]]; then
15+
TEST_SUFFIX=""
16+
else
17+
TEST_SUFFIX=" --package torch_torchvision"
1418
fi
1519

1620
RELEASE_SUFFIX=""
@@ -21,8 +25,10 @@ fi
2125

2226
if [[ ${TORCH_ONLY} == 'true' ]]; then
2327
poetry --quiet add torch${RELEASE_SUFFIX}
24-
else
28+
elif [[ ${INCLUDE_TORCHAUDIO:-} == 'true' ]]; then
2529
poetry --quiet add torch${RELEASE_SUFFIX} torchaudio torchvision
30+
else
31+
poetry --quiet add torch${RELEASE_SUFFIX} torchvision
2632
fi
2733

2834
pushd ${PWD}/../.ci/pytorch/

.github/workflows/validate-aarch64-linux-binaries.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,21 @@ on:
1717
default: ""
1818
required: false
1919
type: string
20-
use-version-set:
21-
description: 'Applies when version is used, use version for each domain'
22-
default: false
23-
required: false
24-
type: boolean
2520
release-matrix:
2621
description: 'Release matrix - optional'
2722
default: ""
2823
required: false
2924
type: string
25+
include-torchaudio:
26+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
27+
default: false
28+
required: false
29+
type: boolean
3030
use-only-dl-pytorch-org:
3131
description: 'Use only download.pytorch.org when generating wheel install command'
3232
default: "false"
3333
required: false
3434
type: string
35-
use-cloudflare-cdn:
36-
description: 'Use cloudflare cdn for installing pip binaries'
37-
default: false
38-
required: false
39-
type: boolean
4035
use-extra-index-url:
4136
description: 'Use extra-index url for pip tests'
4237
default: false
@@ -73,16 +68,16 @@ on:
7368
default: ""
7469
required: false
7570
type: string
71+
include-torchaudio:
72+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
73+
default: false
74+
required: false
75+
type: boolean
7676
use-only-dl-pytorch-org:
7777
description: 'Use only download.pytorch.org when generating wheel install command'
7878
default: "false"
7979
required: false
8080
type: string
81-
use-cloudflare-cdn:
82-
description: 'Use cloudflare cdn for installing pip binaries'
83-
default: false
84-
required: false
85-
type: boolean
8681
use-extra-index-url:
8782
description: 'Use extra-index url for pip tests'
8883
default: false
@@ -93,11 +88,6 @@ on:
9388
default: false
9489
required: false
9590
type: boolean
96-
use-version-set:
97-
description: 'Applies when version is used, use version for each domain'
98-
default: false
99-
required: false
100-
type: boolean
10191

10292
jobs:
10393
generate-aarch64-linux-matrix:
@@ -148,14 +138,9 @@ jobs:
148138
export TORCH_ONLY=${{ inputs.torchonly }}
149139
export RELEASE_VERSION=${{ inputs.version }}
150140
export USE_FORCE_REINSTALL="true"
141+
export INCLUDE_TORCHAUDIO=${{ inputs.include-torchaudio }}
151142
export USE_EXTRA_INDEX_URL=${{ inputs.use-extra-index-url }}
152-
export USE_CLOUDFLARE_CDN=${{ inputs.use-cloudflare-cdn }}
153143
export USE_WHEEL_VARIANTS=${{ inputs.use-wheel-variants }}
154-
export USE_VERSION_SET=${{ inputs.use-version-set }}
155-
if [[ ${USE_VERSION_SET} == 'true' ]]; then
156-
export VISION_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchvision }}
157-
export AUDIO_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchaudio }}
158-
fi
159144
160145
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
161146
eval "$(conda shell.bash hook)"

.github/workflows/validate-binaries.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ on:
2727
default: false
2828
required: false
2929
type: boolean
30-
use-version-set:
31-
description: 'Use version for each domain'
30+
include-torchaudio:
31+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
3232
default: false
3333
required: false
3434
type: boolean
@@ -37,11 +37,6 @@ on:
3737
default: "false"
3838
required: false
3939
type: string
40-
use-cloudflare-cdn:
41-
description: 'Use cloudflare cdn for installing pip binaries'
42-
default: false
43-
required: false
44-
type: boolean
4540
use-extra-index-url:
4641
description: 'Use extra-index url for pip tests'
4742
default: false
@@ -90,16 +85,16 @@ on:
9085
default: false
9186
required: false
9287
type: boolean
88+
include-torchaudio:
89+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
90+
default: false
91+
required: false
92+
type: boolean
9393
use-only-dl-pytorch-org:
9494
description: 'Use only download.pytorch.org when generating wheel install command'
9595
default: "false"
9696
required: false
9797
type: string
98-
use-cloudflare-cdn:
99-
description: 'Use cloudflare cdn for installing pip binaries'
100-
default: false
101-
required: false
102-
type: boolean
10398
use-extra-index-url:
10499
description: 'Use extra-index url for pip tests'
105100
default: false
@@ -126,9 +121,9 @@ jobs:
126121
torchonly: ${{ inputs.torchonly }}
127122
version: ${{ inputs.version }}
128123
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
124+
include-torchaudio: ${{ inputs.include-torchaudio }}
129125
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
130126
use-extra-index-url: ${{ inputs.use-extra-index-url }}
131-
use-cloudflare-cdn: ${{ inputs.use-cloudflare-cdn }}
132127
use-wheel-variants: ${{ inputs.use-wheel-variants }}
133128

134129
linux:
@@ -141,9 +136,9 @@ jobs:
141136
version: ${{ inputs.version }}
142137
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
143138
include-test-ops: ${{ inputs.include-test-ops }}
139+
include-torchaudio: ${{ inputs.include-torchaudio }}
144140
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
145141
use-extra-index-url: ${{ inputs.use-extra-index-url }}
146-
use-cloudflare-cdn: ${{ inputs.use-cloudflare-cdn }}
147142
use-wheel-variants: ${{ inputs.use-wheel-variants }}
148143

149144
linux-aarch64:
@@ -155,9 +150,9 @@ jobs:
155150
torchonly: ${{ inputs.torchonly }}
156151
version: ${{ inputs.version }}
157152
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
153+
include-torchaudio: ${{ inputs.include-torchaudio }}
158154
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
159155
use-extra-index-url: ${{ inputs.use-extra-index-url }}
160-
use-cloudflare-cdn: ${{ inputs.use-cloudflare-cdn }}
161156
use-wheel-variants: ${{ inputs.use-wheel-variants }}
162157

163158
mac-arm64:
@@ -169,7 +164,7 @@ jobs:
169164
torchonly: ${{ inputs.torchonly }}
170165
version: ${{ inputs.version }}
171166
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
167+
include-torchaudio: ${{ inputs.include-torchaudio }}
172168
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
173169
use-extra-index-url: ${{ inputs.use-extra-index-url }}
174-
use-cloudflare-cdn: ${{ inputs.use-cloudflare-cdn }}
175170
use-wheel-variants: ${{ inputs.use-wheel-variants }}

.github/workflows/validate-linux-binaries.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ on:
1717
default: ""
1818
required: false
1919
type: string
20-
use-version-set:
21-
description: 'Applies when version is used, use version for each domain'
22-
default: false
23-
required: false
24-
type: boolean
2520
release-matrix:
2621
description: 'Release matrix - optional'
2722
default: ""
@@ -32,16 +27,16 @@ on:
3227
default: false
3328
required: false
3429
type: boolean
30+
include-torchaudio:
31+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
32+
default: false
33+
required: false
34+
type: boolean
3535
use-only-dl-pytorch-org:
3636
description: 'Use only download.pytorch.org when generating wheel install command'
3737
default: "false"
3838
required: false
3939
type: string
40-
use-cloudflare-cdn:
41-
description: 'Use cloudflare cdn for installing pip binaries'
42-
default: false
43-
required: false
44-
type: boolean
4540
use-extra-index-url:
4641
description: 'Use extra-index url for pip tests'
4742
default: false
@@ -83,16 +78,16 @@ on:
8378
default: false
8479
required: false
8580
type: boolean
81+
include-torchaudio:
82+
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
83+
default: false
84+
required: false
85+
type: boolean
8686
use-only-dl-pytorch-org:
8787
description: 'Use only download.pytorch.org when generating wheel install command'
8888
default: "false"
8989
required: false
9090
type: string
91-
use-cloudflare-cdn:
92-
description: 'Use cloudflare cdn for installing pip binaries'
93-
default: false
94-
required: false
95-
type: boolean
9691
use-extra-index-url:
9792
description: 'Use extra-index url for pip tests'
9893
default: false
@@ -103,11 +98,6 @@ on:
10398
default: false
10499
required: false
105100
type: boolean
106-
use-version-set:
107-
description: 'Applies when version is used, use version for each domain'
108-
default: false
109-
required: false
110-
type: boolean
111101

112102
jobs:
113103
generate-linux-matrix:
@@ -140,16 +130,11 @@ jobs:
140130
export ENV_NAME="conda-env-${{ github.run_id }}"
141131
export TORCH_ONLY=${{ inputs.torchonly }}
142132
export INCLUDE_TEST_OPS=${{ inputs.include-test-ops }}
133+
export INCLUDE_TORCHAUDIO=${{ inputs.include-torchaudio }}
143134
export USE_ONLY_DL_PYTORCH_ORG=${{ inputs.use-only-dl-pytorch-org }}
144135
export USE_EXTRA_INDEX_URL=${{ inputs.use-extra-index-url }}
145-
export USE_CLOUDFLARE_CDN=${{ inputs.use-cloudflare-cdn }}
146136
export USE_WHEEL_VARIANTS=${{ inputs.use-wheel-variants }}
147137
export RELEASE_VERSION=${{ inputs.version }}
148-
export USE_VERSION_SET=${{ inputs.use-version-set }}
149-
if [[ ${USE_VERSION_SET} == 'true' ]]; then
150-
export VISION_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchvision }}
151-
export AUDIO_RELEASE_VERSION=${{ fromJson(inputs.release-matrix).torchaudio }}
152-
fi
153138
154139
export USE_FORCE_REINSTALL="true"
155140
export TARGET_OS="linux"

0 commit comments

Comments
 (0)