-
Notifications
You must be signed in to change notification settings - Fork 142
209 lines (207 loc) · 7.26 KB
/
Copy pathtest_linux_job_v2.yml
File metadata and controls
209 lines (207 loc) · 7.26 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
name: Test build/test linux workflow (v2)
on:
pull_request:
paths:
- .github/workflows/linux_job_v2.yml
- .github/workflows/test_linux_job_v2.yml
- .github/actions/setup-linux/action.yml
- .github/scripts/run_with_env_secrets.py
workflow_dispatch:
jobs:
test-cpu:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
job-name: "linux-py3.9-cpu"
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
submodules: "recursive"
gpu-arch-type: cpu
gpu-arch-version: ""
script: |
conda create --yes --quiet -n test python=3.9
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-gpu:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
strategy:
matrix:
runner_type: ["linux.4xlarge.nvidia.gpu", "linux.g5.4xlarge.nvidia.gpu"]
with:
job-name: "linux-py3.9-cu121"
runner: ${{ matrix.runner_type }}
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
submodules: ${{ 'true' }}
gpu-arch-type: cuda
gpu-arch-version: "12.1"
timeout: 60
script: |
nvidia-smi
nvcc --version | grep "cuda_12.1"
conda create --yes --quiet -n test python=3.9
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cu121 --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch;cuda_avail = torch.cuda.is_available();print("CUDA available: " + str(cuda_avail));assert(cuda_avail)'
python3 -c 'import torch;t = torch.ones([2,2], device="cuda:0");print(t);print("tensor device:" + str(t.device))'
python3 -c 'import torch;assert(torch.version.cuda == "12.1")'
test-gpu-containers:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
strategy:
matrix:
runner_type: ["linux.aws.a100"]
with:
job-name: "linux-py3.9-cu121-container"
runner: ${{ matrix.runner_type }}
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
submodules: ${{ 'true' }}
gpu-arch-type: cuda
gpu-arch-version: "12.1"
timeout: 60
script: |
nvidia-smi
nvcc --version | grep "cuda_12.1"
conda create --yes --quiet -n test python=3.9
conda activate test
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cu121 --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch;cuda_avail = torch.cuda.is_available();print("CUDA available: " + str(cuda_avail));assert(cuda_avail)'
python3 -c 'import torch;t = torch.ones([2,2], device="cuda:0");print(t);print("tensor device:" + str(t.device))'
python3 -c 'import torch;assert(torch.version.cuda == "12.1")'
test-docker-image:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
docker-image: fedora:37@sha256:f2c083c0b7d2367a375f15e002c2dc7baaca2b3181ace61f9d5113a8fe2f6b44
script: |
source /etc/os-release && [[ "${ID}" = "fedora" ]] || exit 1
test-upload-artifact:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-no-artifact:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
script: |
echo "hello"
test-upload-artifact-s3:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
upload-artifact-to-s3: true
script: |
echo "hello" > "${RUNNER_ARTIFACT_DIR}/cool_beans"
test-upload-artifact-s3-no-artifact:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
upload-artifact: my-cool-artifact
upload-artifact-to-s3: true
script: |
echo "hello"
test-download-artifact:
needs: test-upload-artifact
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
download-artifact: my-cool-artifact
script: |
grep "hello" "${RUNNER_ARTIFACT_DIR}/cool_beans"
upload-docs:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
script: |
echo "hello" > "${RUNNER_DOCS_DIR}/index.html"
verify-upload-docs:
needs: upload-docs
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
script: |
# Sleep a couple of seconds just in case S3 is being slow (might not be needed?)
sleep 10
REPO_NAME="$(echo "${GITHUB_REPOSITORY}" | cut -d '/' -f2)"
curl -fsSL "https://docs-preview.pytorch.org/pytorch/${REPO_NAME}/${PR_NUMBER}/index.html" | grep "hello"
test-with-matrix:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
with:
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
binary-matrix: ${{ toJSON(matrix) }}
script: |
set -x
PYTHON_VERSION="${{ matrix.python_version }}"
conda create --yes --quiet -n test python="${PYTHON_VERSION}"
conda activate test
python --version | grep "${PYTHON_VERSION}"
test-no-docker:
uses: ./.github/workflows/linux_job_v2.yml
permissions:
id-token: write
with:
job-name: "no-docker-test"
runner: linux.2xlarge
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
gpu-arch-type: cpu
gpu-arch-version: ""
run-with-docker: false
script: |
export PYTHON_VERSION="3.9"
docker run -e PYTHON_VERSION -t -v $PWD:$PWD -w $PWD "${DOCKER_IMAGE}" echo "hello from inside docker"
echo "hello from outside docker"