Skip to content

Commit

Permalink
Add test ops validation for validation workflows (#1650)
Browse files Browse the repository at this point in the history
* Add test ops validation

* include workflows
  • Loading branch information
atalman authored Dec 28, 2023
1 parent 770c827 commit 27c4702
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/scripts/validate_test_ops.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -eux -o pipefail

retry () {
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}

# Clone the Pytorch branch
retry git clone --depth 1 https://github.com/pytorch/pytorch.git
retry git submodule update --init --recursive
pushd pytorch

# Run test_ops validation
export CUDA_LAUNCH_BLOCKING=1
python3 test/test_ops.py
11 changes: 11 additions & 0 deletions .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
default: false
required: false
type: boolean
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
os:
Expand Down Expand Up @@ -65,6 +70,11 @@ on:
default: ""
required: false
type: string
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean


jobs:
Expand Down Expand Up @@ -94,6 +104,7 @@ jobs:
torchonly: ${{ inputs.torchonly }}
version: ${{ inputs.version }}
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
include-test-ops: ${{ inputs.include-test-ops }}

linux-aarch64:
if: inputs.os == 'linux-aarch64' || inputs.os == 'all'
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
default: ""
required: false
type: string
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
Expand Down Expand Up @@ -58,6 +63,11 @@ on:
default: ""
required: false
type: string
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean

jobs:
generate-linux-matrix:
Expand All @@ -84,6 +94,7 @@ jobs:
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TORCH_ONLY=${{ inputs.torchonly }}
export INCLUDE_TEST_OPS=${{ inputs.include-test-ops }}
export RELEASE_VERSION=${{ inputs.version }}
export TARGET_OS="linux"
eval "$(conda shell.bash hook)"
Expand All @@ -97,3 +108,7 @@ jobs:
# Standart case: Validate binaries
source ./.github/scripts/validate_binaries.sh
if [[ ${INCLUDE_TEST_OPS} == 'true' ]]; then
source ./.github/scripts/validate_test_ops.sh
fi

0 comments on commit 27c4702

Please sign in to comment.