forked from pytorch/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (205 loc) · 7.76 KB
/
Copy pathvalidate-linux-binaries.yml
File metadata and controls
218 lines (205 loc) · 7.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Validate linux binaries
on:
workflow_call:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: string
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
version:
description: 'Version to validate - optional'
default: ""
required: false
type: string
release-matrix:
description: 'Release matrix - optional'
default: ""
required: false
type: string
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean
include-torchaudio:
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
default: false
required: false
type: boolean
use-only-dl-pytorch-org:
description: 'Use only download.pytorch.org when generating wheel install command'
default: "false"
required: false
type: string
use-extra-index-url:
description: 'Use extra-index url for pip tests'
default: false
required: false
type: boolean
use-wheel-variants:
description: 'Use wheel-variants for installing pip binaries'
default: false
required: false
type: boolean
workflow_dispatch:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: choice
options:
- release
- nightly
- test
- all
torchonly:
description: 'Validate torchonly'
default: false
required: false
type: boolean
version:
description: 'Version to validate - optional'
default: ""
required: false
type: string
release-matrix:
description: 'Release matrix - optional'
default: ""
required: false
type: string
include-test-ops:
description: 'Include Test Ops tests (only Linux)'
default: false
required: false
type: boolean
include-torchaudio:
description: 'Include torchaudio in validation (by default only torch and torchvision are validated)'
default: false
required: false
type: boolean
use-only-dl-pytorch-org:
description: 'Use only download.pytorch.org when generating wheel install command'
default: "false"
required: false
type: string
use-extra-index-url:
description: 'Use extra-index url for pip tests'
default: false
required: false
type: boolean
use-wheel-variants:
description: 'Use wheel-variants for installing pip binaries'
default: false
required: false
type: boolean
jobs:
generate-linux-matrix:
uses: ./.github/workflows/generate_binary_build_matrix.yml
with:
package-type: wheel,libtorch
os: linux
channel: ${{ inputs.channel }}
test-infra-ref: release/2.14
use-only-dl-pytorch-org: ${{ inputs.use-only-dl-pytorch-org }}
with-xpu: enable
linux:
needs: generate-linux-matrix
strategy:
matrix: ${{ fromJson(needs.generate-linux-matrix.outputs.matrix) }}
fail-fast: false
uses: ./.github/workflows/linux_job_v2.yml
name: ${{ matrix.build_name }}
with:
runner: ${{ matrix.validation_runner }}
repository: "pytorch/pytorch"
ref: release/2.14
job-name: ${{ matrix.build_name }}
# ROCm validates on the regular almalinux image (like CUDA) to confirm
# the wheels are self-contained. Only XPU still needs its own container.
docker-image: ${{ (matrix.gpu_arch_type == 'xpu' && matrix.container_image) || 'pytorch/almalinux-builder:cpu-main' }}
binary-matrix: ${{ toJSON(matrix) }}
docker-build-dir: "skip-docker-build"
timeout: 180
script: |
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TORCH_ONLY=${{ inputs.torchonly }}
export INCLUDE_TEST_OPS=${{ inputs.include-test-ops }}
export INCLUDE_TORCHAUDIO=${{ inputs.include-torchaudio }}
export USE_ONLY_DL_PYTORCH_ORG=${{ inputs.use-only-dl-pytorch-org }}
export USE_EXTRA_INDEX_URL=${{ inputs.use-extra-index-url }}
export USE_WHEEL_VARIANTS=${{ inputs.use-wheel-variants }}
export RELEASE_VERSION=${{ inputs.version }}
export USE_FORCE_REINSTALL="true"
export TARGET_OS="linux"
eval "$(conda shell.bash hook)"
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
# Validate binaries. Poetry-based validation now lives in the
# standalone linux-poetry job below so Poetry's own ecosystem
# churn (it was previously installed from poetry@main) cannot
# flake the binary matrix.
source ../../test-infra/.github/scripts/validate_binaries.sh
linux-poetry:
if: ${{ inputs.channel == 'release' }}
uses: ./.github/workflows/linux_job_v2.yml
name: poetry-test
with:
runner: "linux.g5.4xlarge.nvidia.gpu"
repository: "pytorch/pytorch"
ref: release/2.14
job-name: "poetry-test"
docker-image: 'pytorch/almalinux-builder:cpu-main'
docker-build-dir: "skip-docker-build"
timeout: 60
script: |
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export TORCH_ONLY=${{ inputs.torchonly }}
export INCLUDE_TORCHAUDIO=${{ inputs.include-torchaudio }}
export RELEASE_VERSION=${{ inputs.version }}
export TARGET_OS="linux"
eval "$(conda shell.bash hook)"
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
# Poetry test is release-channel-only and covers a single
# stable-CUDA / Python 3.11 path. The full validate-binaries
# matrix above already covers every other combination via pip.
export MATRIX_PYTHON_VERSION="3.11"
export MATRIX_GPU_ARCH_VERSION=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${{ inputs.channel }})
source ../../test-infra/.github/scripts/validate_poetry.sh
linux-amazon-2023:
uses: ./.github/workflows/linux_job_v2.yml
name: amazon-linux-2023-test
with:
runner: "linux.g5.4xlarge.nvidia.gpu"
repository: "pytorch/pytorch"
ref: release/2.14
job-name: "amazon-linux-2023-test"
docker-image: 'almalinux/9-base'
docker-build-dir: "skip-docker-build"
timeout: 180
script: |
set -ex
# install Dev Tools and python-devel to test torch.compile
yum groupinstall -y "Development Tools"
# We use Python 3.11 not running inside venv
yum install -y python3.11 python3.11-devel
python3.11 -m ensurepip --upgrade
python3.11 --version
python3.11 -m pip install --upgrade pip
python3.11 -m pip --version
CUDA_VERSION=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${{ inputs.channel }})
CUDA_VERSION_NODOT=$(echo $CUDA_VERSION | tr -d '.')
export MATRIX_GPU_ARCH_VERSION="${CUDA_VERSION}"
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/nightly/cu${CUDA_VERSION_NODOT}"
if [[ ${{ inputs.channel }} == 'test' ]]; then
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/test/cu${CUDA_VERSION_NODOT}"
elif [[ ${{ inputs.channel }} == 'release' ]]; then
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/cu${CUDA_VERSION_NODOT}"
fi
python3.11 -m pip install torch --progress-bar off --index-url ${DWN_PYTORCH_ORG}
python3.11 .ci/pytorch/smoke_test/smoke_test.py --package torchonly