Skip to content

Commit

Permalink
Add torchonly option to validation workflows (#1494)
Browse files Browse the repository at this point in the history
* Add torchonly option to validation workflows

* fix typo
  • Loading branch information
atalman committed Aug 23, 2023
1 parent 897b1df commit 63e0dab
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ else
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
TEST_SUFFIX=""
if [[ ${TORCH_ONLY} == 'true' ]]; then
INSTALLATION=${INSTALLATION/"torchvision torchaudio"/""}
TEST_SUFFIX=" --package torchonly"
fi

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

if [[ ${TARGET_OS} == 'windows' ]]; then
python ./test/smoke_test/smoke_test.py
python ./test/smoke_test/smoke_test.py ${TEST_SUFFIX}
elif [[ ${TARGET_OS} == 'linux-aarch64' ]]; then
python3 ./test/smoke_test/smoke_test.py --package=torchonly
else
python3 ./test/smoke_test/smoke_test.py
python3 ./test/smoke_test/smoke_test.py ${TEST_SUFFIX}
fi

if [[ ${TARGET_OS} == 'macos-arm64' ]]; then
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/validate-aarch64-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand All @@ -28,6 +33,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

jobs:
generate-aarch64-linux-matrix:
Expand Down Expand Up @@ -55,6 +65,7 @@ jobs:
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TARGET_OS="linux-aarch64"
export TORCH_ONLY=${{ inputs.torchonly }}
eval "$(conda shell.bash hook)"
# Standart case: Validate binaries
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
os:
Expand Down Expand Up @@ -50,6 +55,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

jobs:
win:
Expand All @@ -58,31 +68,36 @@ jobs:
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
torchonly: ${{ inputs.torchonly }}

linux:
if: inputs.os == 'linux' || inputs.os == 'all'
uses: ./.github/workflows/validate-linux-binaries.yml
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
torchonly: ${{ inputs.torchonly }}

linux-aarch64:
if: inputs.os == 'linux-aarch64'
uses: ./.github/workflows/validate-aarch64-linux-binaries.yml
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
torchonly: ${{ inputs.torchonly }}

mac:
if: inputs.os == 'macos' || inputs.os == 'all'
uses: ./.github/workflows/validate-macos-binaries.yml
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
torchonly: ${{ inputs.torchonly }}

mac-arm64:
if: inputs.os == 'macos' || inputs.os == 'all'
uses: ./.github/workflows/validate-macos-arm64-binaries.yml
with:
channel: ${{ inputs.channel }}
ref: ${{ inputs.ref || github.ref }}
torchonly: ${{ inputs.torchonly }}
11 changes: 11 additions & 0 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand All @@ -28,6 +33,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

jobs:
generate-linux-matrix:
Expand All @@ -53,6 +63,7 @@ jobs:
script: |
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TORCH_ONLY=${{ inputs.torchonly }}
export TARGET_OS="linux"
eval "$(conda shell.bash hook)"
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/validate-macos-arm64-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand All @@ -28,6 +33,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

jobs:
generate-macos-arm64-matrix:
Expand All @@ -53,4 +63,5 @@ jobs:
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TARGET_OS="macos-arm64"
export TORCH_ONLY=${{ inputs.torchonly }}
source ./.github/scripts/validate_binaries.sh
11 changes: 11 additions & 0 deletions .github/workflows/validate-macos-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand All @@ -28,6 +33,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

jobs:
generate-macos-matrix:
Expand All @@ -53,4 +63,5 @@ jobs:
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TARGET_OS="macos"
export TORCH_ONLY=${{ inputs.torchonly }}
source ./.github/scripts/validate_binaries.sh
11 changes: 11 additions & 0 deletions .github/workflows/validate-windows-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand All @@ -28,6 +33,11 @@ on:
default: ""
required: false
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean

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

0 comments on commit 63e0dab

Please sign in to comment.