Skip to content

Commit 27c4702

Browse files
authored
Add test ops validation for validation workflows (#1650)
* Add test ops validation * include workflows
1 parent 770c827 commit 27c4702

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/scripts/validate_test_ops.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -eux -o pipefail
4+
5+
retry () {
6+
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
7+
}
8+
9+
# Clone the Pytorch branch
10+
retry git clone --depth 1 https://github.com/pytorch/pytorch.git
11+
retry git submodule update --init --recursive
12+
pushd pytorch
13+
14+
# Run test_ops validation
15+
export CUDA_LAUNCH_BLOCKING=1
16+
python3 test/test_ops.py

.github/workflows/validate-binaries.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ on:
2727
default: false
2828
required: false
2929
type: boolean
30+
include-test-ops:
31+
description: 'Include Test Ops tests (only Linux)'
32+
default: false
33+
required: false
34+
type: boolean
3035
workflow_dispatch:
3136
inputs:
3237
os:
@@ -65,6 +70,11 @@ on:
6570
default: ""
6671
required: false
6772
type: string
73+
include-test-ops:
74+
description: 'Include Test Ops tests (only Linux)'
75+
default: false
76+
required: false
77+
type: boolean
6878

6979

7080
jobs:
@@ -94,6 +104,7 @@ jobs:
94104
torchonly: ${{ inputs.torchonly }}
95105
version: ${{ inputs.version }}
96106
release-matrix: ${{ needs.generate-release-matrix.outputs.matrix }}
107+
include-test-ops: ${{ inputs.include-test-ops }}
97108

98109
linux-aarch64:
99110
if: inputs.os == 'linux-aarch64' || inputs.os == 'all'

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ on:
2727
default: ""
2828
required: false
2929
type: string
30+
include-test-ops:
31+
description: 'Include Test Ops tests (only Linux)'
32+
default: false
33+
required: false
34+
type: boolean
3035
workflow_dispatch:
3136
inputs:
3237
channel:
@@ -58,6 +63,11 @@ on:
5863
default: ""
5964
required: false
6065
type: string
66+
include-test-ops:
67+
description: 'Include Test Ops tests (only Linux)'
68+
default: false
69+
required: false
70+
type: boolean
6171

6272
jobs:
6373
generate-linux-matrix:
@@ -84,6 +94,7 @@ jobs:
8494
set -ex
8595
export ENV_NAME="conda-env-${{ github.run_id }}"
8696
export TORCH_ONLY=${{ inputs.torchonly }}
97+
export INCLUDE_TEST_OPS=${{ inputs.include-test-ops }}
8798
export RELEASE_VERSION=${{ inputs.version }}
8899
export TARGET_OS="linux"
89100
eval "$(conda shell.bash hook)"
@@ -97,3 +108,7 @@ jobs:
97108
98109
# Standart case: Validate binaries
99110
source ./.github/scripts/validate_binaries.sh
111+
112+
if [[ ${INCLUDE_TEST_OPS} == 'true' ]]; then
113+
source ./.github/scripts/validate_test_ops.sh
114+
fi

0 commit comments

Comments
 (0)