Skip to content

Commit 63e0dab

Browse files
authored
Add torchonly option to validation workflows (#1494)
* Add torchonly option to validation workflows * fix typo
1 parent 897b1df commit 63e0dab

7 files changed

+77
-2
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ else
66
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
77
conda activate ${ENV_NAME}
88
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
9+
TEST_SUFFIX=""
10+
if [[ ${TORCH_ONLY} == 'true' ]]; then
11+
INSTALLATION=${INSTALLATION/"torchvision torchaudio"/""}
12+
TEST_SUFFIX=" --package torchonly"
13+
fi
914

1015
export OLD_PATH=${PATH}
1116
# Workaround macos-arm64 runners. Issue: https://github.com/pytorch/test-infra/issues/4342
@@ -26,11 +31,11 @@ else
2631
fi
2732

2833
if [[ ${TARGET_OS} == 'windows' ]]; then
29-
python ./test/smoke_test/smoke_test.py
34+
python ./test/smoke_test/smoke_test.py ${TEST_SUFFIX}
3035
elif [[ ${TARGET_OS} == 'linux-aarch64' ]]; then
3136
python3 ./test/smoke_test/smoke_test.py --package=torchonly
3237
else
33-
python3 ./test/smoke_test/smoke_test.py
38+
python3 ./test/smoke_test/smoke_test.py ${TEST_SUFFIX}
3439
fi
3540

3641
if [[ ${TARGET_OS} == 'macos-arm64' ]]; then

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
default: ""
1313
required: false
1414
type: string
15+
torchonly:
16+
description: 'Validate torchonly'
17+
default: false
18+
required: false
19+
type: boolean
1520
workflow_dispatch:
1621
inputs:
1722
channel:
@@ -28,6 +33,11 @@ on:
2833
default: ""
2934
required: false
3035
type: string
36+
torchonly:
37+
description: 'Validate torchonly'
38+
default: false
39+
required: false
40+
type: boolean
3141

3242
jobs:
3343
generate-aarch64-linux-matrix:
@@ -55,6 +65,7 @@ jobs:
5565
set -ex
5666
export ENV_NAME="conda-env-${{ github.run_id }}"
5767
export TARGET_OS="linux-aarch64"
68+
export TORCH_ONLY=${{ inputs.torchonly }}
5869
eval "$(conda shell.bash hook)"
5970
6071
# Standart case: Validate binaries

.github/workflows/validate-binaries.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
default: ""
2323
required: false
2424
type: string
25+
torchonly:
26+
description: 'Validate torchonly'
27+
default: false
28+
required: false
29+
type: boolean
2530
workflow_dispatch:
2631
inputs:
2732
os:
@@ -50,6 +55,11 @@ on:
5055
default: ""
5156
required: false
5257
type: string
58+
torchonly:
59+
description: 'Validate torchonly'
60+
default: false
61+
required: false
62+
type: boolean
5363

5464
jobs:
5565
win:
@@ -58,31 +68,36 @@ jobs:
5868
with:
5969
channel: ${{ inputs.channel }}
6070
ref: ${{ inputs.ref || github.ref }}
71+
torchonly: ${{ inputs.torchonly }}
6172

6273
linux:
6374
if: inputs.os == 'linux' || inputs.os == 'all'
6475
uses: ./.github/workflows/validate-linux-binaries.yml
6576
with:
6677
channel: ${{ inputs.channel }}
6778
ref: ${{ inputs.ref || github.ref }}
79+
torchonly: ${{ inputs.torchonly }}
6880

6981
linux-aarch64:
7082
if: inputs.os == 'linux-aarch64'
7183
uses: ./.github/workflows/validate-aarch64-linux-binaries.yml
7284
with:
7385
channel: ${{ inputs.channel }}
7486
ref: ${{ inputs.ref || github.ref }}
87+
torchonly: ${{ inputs.torchonly }}
7588

7689
mac:
7790
if: inputs.os == 'macos' || inputs.os == 'all'
7891
uses: ./.github/workflows/validate-macos-binaries.yml
7992
with:
8093
channel: ${{ inputs.channel }}
8194
ref: ${{ inputs.ref || github.ref }}
95+
torchonly: ${{ inputs.torchonly }}
8296

8397
mac-arm64:
8498
if: inputs.os == 'macos' || inputs.os == 'all'
8599
uses: ./.github/workflows/validate-macos-arm64-binaries.yml
86100
with:
87101
channel: ${{ inputs.channel }}
88102
ref: ${{ inputs.ref || github.ref }}
103+
torchonly: ${{ inputs.torchonly }}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
default: ""
1313
required: false
1414
type: string
15+
torchonly:
16+
description: 'Validate torchonly'
17+
default: false
18+
required: false
19+
type: boolean
1520
workflow_dispatch:
1621
inputs:
1722
channel:
@@ -28,6 +33,11 @@ on:
2833
default: ""
2934
required: false
3035
type: string
36+
torchonly:
37+
description: 'Validate torchonly'
38+
default: false
39+
required: false
40+
type: boolean
3141

3242
jobs:
3343
generate-linux-matrix:
@@ -53,6 +63,7 @@ jobs:
5363
script: |
5464
set -ex
5565
export ENV_NAME="conda-env-${{ github.run_id }}"
66+
export TORCH_ONLY=${{ inputs.torchonly }}
5667
export TARGET_OS="linux"
5768
eval "$(conda shell.bash hook)"
5869

.github/workflows/validate-macos-arm64-binaries.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
default: ""
1313
required: false
1414
type: string
15+
torchonly:
16+
description: 'Validate torchonly'
17+
default: false
18+
required: false
19+
type: boolean
1520
workflow_dispatch:
1621
inputs:
1722
channel:
@@ -28,6 +33,11 @@ on:
2833
default: ""
2934
required: false
3035
type: string
36+
torchonly:
37+
description: 'Validate torchonly'
38+
default: false
39+
required: false
40+
type: boolean
3141

3242
jobs:
3343
generate-macos-arm64-matrix:
@@ -53,4 +63,5 @@ jobs:
5363
set -ex
5464
export ENV_NAME="conda-env-${{ github.run_id }}"
5565
export TARGET_OS="macos-arm64"
66+
export TORCH_ONLY=${{ inputs.torchonly }}
5667
source ./.github/scripts/validate_binaries.sh

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
default: ""
1313
required: false
1414
type: string
15+
torchonly:
16+
description: 'Validate torchonly'
17+
default: false
18+
required: false
19+
type: boolean
1520
workflow_dispatch:
1621
inputs:
1722
channel:
@@ -28,6 +33,11 @@ on:
2833
default: ""
2934
required: false
3035
type: string
36+
torchonly:
37+
description: 'Validate torchonly'
38+
default: false
39+
required: false
40+
type: boolean
3141

3242
jobs:
3343
generate-macos-matrix:
@@ -53,4 +63,5 @@ jobs:
5363
set -ex
5464
export ENV_NAME="conda-env-${{ github.run_id }}"
5565
export TARGET_OS="macos"
66+
export TORCH_ONLY=${{ inputs.torchonly }}
5667
source ./.github/scripts/validate_binaries.sh

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
default: ""
1313
required: false
1414
type: string
15+
torchonly:
16+
description: 'Validate torchonly'
17+
default: false
18+
required: false
19+
type: boolean
1520
workflow_dispatch:
1621
inputs:
1722
channel:
@@ -28,6 +33,11 @@ on:
2833
default: ""
2934
required: false
3035
type: string
36+
torchonly:
37+
description: 'Validate torchonly'
38+
default: false
39+
required: false
40+
type: boolean
3141

3242
jobs:
3343
generate-windows-matrix:
@@ -55,6 +65,7 @@ jobs:
5565
set -ex
5666
export ENV_NAME="conda-env-${{ github.run_id }}"
5767
export TARGET_OS="windows"
68+
export TORCH_ONLY=${{ inputs.torchonly }}
5869
source /c/Jenkins/Miniconda3/etc/profile.d/conda.sh
5970
if [[ ${MATRIX_GPU_ARCH_VERSION} == "12.1" ]]; then
6071
./windows/internal/driver_update.bat

0 commit comments

Comments
 (0)