Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torchonly option to validation workflows #1494

Merged
merged 2 commits into from
Aug 23, 2023
Merged
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
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
Loading