Skip to content

Commit 3ddb3e3

Browse files
authored
Parallel jobs for "Build and test" (#4007)
Execute workflow "Build and test" with parallel jobs: * `core` - core tests only * `rest` - all other tests, tutorials, e2e test. Duration: 1h20m -> 50m Note this is the first step, more improvements to follow in separate PRs. Required for #3820. Note that before merging the branch protection rules need to be updated to reflect new jobs names.
1 parent 5b4e69e commit 3ddb3e3

File tree

3 files changed

+82
-38
lines changed

3 files changed

+82
-38
lines changed

.github/workflows/build-test-reusable.yml

Lines changed: 74 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ env:
7474
jobs:
7575
integration-tests:
7676
name: Integration tests
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
suite:
81+
- core
82+
- rest
7783
timeout-minutes: 720
7884
runs-on: ${{ fromJson(inputs.runner_label && format('["linux", "{0}"]', inputs.runner_label) || format('["linux", "{0}", "{1}", "{2}"]', inputs.device, inputs.driver_version, inputs.runner_version)) }}
7985
defaults:
@@ -111,31 +117,23 @@ jobs:
111117
with:
112118
python-version: ${{ inputs.python_version }}
113119

114-
- name: Identify Python version
115-
run: |
116-
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info[0]}.{ sys.version_info[1]}")')"
117-
echo "PYTHON_VERSION=$PYTHON_VERSION" | tee -a $GITHUB_ENV
118-
119120
- name: Setup PyTorch
120121
uses: ./.github/actions/setup-pytorch
121122
with:
122123
ref: ${{ inputs.pytorch_ref }}
123124
mode: ${{ inputs.pytorch_mode }}
124125

125-
- name: Install pass_rate dependencies
126-
run: |
127-
pip install defusedxml setproctitle==1.3.5
128-
129126
- name: Setup Triton
130127
uses: ./.github/actions/setup-triton
131128
with:
132129
build_llvm: ${{ inputs.build_llvm }}
133130
use_spirv_backend: ${{ inputs.use_spirv_backend }}
134131

135132
- name: Report environment details
133+
if: matrix.suite == 'core'
136134
run: |
137-
source ./scripts/capture-hw-details.sh --quiet
138-
cat <<EOF | tee .env
135+
mkdir -p reports
136+
cat <<EOF | tee reports/.env
139137
TIMESTAMP=$(date '+%Y%m%d%H%M%S')
140138
GITHUB_RUN_ID=$GITHUB_RUN_ID
141139
GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER
@@ -145,11 +143,8 @@ jobs:
145143
PYTORCH_COMMIT_ID=$PYTORCH_COMMIT_ID
146144
PYTORCH_VERSION=$PYTORCH_VERSION
147145
TRITON_REPO=$GITHUB_REPOSITORY
148-
LIBIGC1_VERSION=$LIBIGC1_VERSION
149-
LEVEL_ZERO_VERSION=$LEVEL_ZERO_VERSION
150-
GPU_DEVICE=$GPU_DEVICE
151-
AGAMA_VERSION=$AGAMA_VERSION
152146
EOF
147+
./scripts/capture-hw-details.sh | tee -a reports/.env
153148
154149
- name: Create test-triton command line
155150
run: |
@@ -169,43 +164,54 @@ jobs:
169164
170165
{
171166
echo SKIPLIST="$skiplist"
172-
echo TRITON_TEST_CMD="bash -x scripts/test-triton.sh --warning-reports --skip-pytorch-install --reports-dir $GITHUB_WORKSPACE/reports ${{ inputs.ignore_errors && '--ignore-errors' || '' }} $skiplist"
167+
echo TRITON_TEST_CMD="bash -x scripts/test-triton.sh --skip-pip-install --warning-reports --skip-pytorch-install --reports-dir $GITHUB_WORKSPACE/reports ${{ inputs.ignore_errors && '--ignore-errors' || '' }} $skiplist"
173168
} | tee -a $GITHUB_ENV
174169
170+
- name: Install test dependencies
171+
run: |
172+
pip install -r scripts/requirements-test.txt git+https://github.com/kwasd/[email protected]
173+
175174
- name: Run Proton tests
176-
if: ${{ inputs.driver_version == 'rolling' && inputs.device == 'max1100' }}
175+
if: matrix.suite == 'rest' && inputs.driver_version == 'rolling' && inputs.device == 'max1100'
177176
run: |
178177
cd third_party/proton/test
179178
pytest test_api.py test_lib.py test_profile.py test_viewer.py test_record.py -s -v
180179
cd ..
181180
182181
- name: Run unit tests
182+
if: matrix.suite == 'rest'
183183
run: |
184184
${{ env.TRITON_TEST_CMD }} --unit
185185
186186
- name: Run core tests
187+
if: matrix.suite == 'core'
187188
run: |
188-
${{ env.TRITON_TEST_CMD }} --core --skip-pip-install
189+
${{ env.TRITON_TEST_CMD }} --core
189190
190191
- name: Run interpreter tests
192+
if: matrix.suite == 'rest'
191193
run: |
192-
${{ env.TRITON_TEST_CMD }} --interpreter --skip-pip-install
194+
${{ env.TRITON_TEST_CMD }} --interpreter
193195
194196
- name: Run Tutorials
197+
if: matrix.suite == 'rest'
195198
run: |
196-
${{ env.TRITON_TEST_CMD }} --tutorial --skip-pip-install
199+
${{ env.TRITON_TEST_CMD }} --tutorial
197200
198201
- name: Run instrumentation tests
202+
if: matrix.suite == 'rest'
199203
run: |
200-
${{ env.TRITON_TEST_CMD }} --instrumentation --skip-pip-install
204+
${{ env.TRITON_TEST_CMD }} --instrumentation
201205
202206
- name: Get transformers version
207+
if: matrix.suite == 'rest'
203208
run: |
204209
cd pytorch
205210
TRANSFORMERS_VERSION="$(<.ci/docker/ci_commit_pins/huggingface.txt)"
206211
echo "TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION" | tee -a $GITHUB_ENV
207212
208213
- name: Install transformers
214+
if: matrix.suite == 'rest'
209215
uses: ./.github/actions/install-dependency
210216
with:
211217
package: transformers
@@ -214,8 +220,9 @@ jobs:
214220
try-tag-prefix: v
215221

216222
- name: Run E2E test
223+
if: matrix.suite == 'rest'
217224
run: |
218-
${{ env.TRITON_TEST_CMD }} --inductor --skip-pip-install
225+
${{ env.TRITON_TEST_CMD }} --inductor
219226
220227
- name: Save pip cache
221228
if: ${{ steps.pip-cache.outputs.status == 'miss' }}
@@ -224,9 +231,52 @@ jobs:
224231
path: ${{ steps.pip-cache.outputs.path }}
225232
dest: ${{ steps.pip-cache.outputs.dest }}
226233

234+
- name: Upload test reports
235+
uses: actions/upload-artifact@v4
236+
with:
237+
name: test-reports-${{ matrix.suite }}-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }}
238+
include-hidden-files: true
239+
path: reports
240+
241+
reports:
242+
name: Reports
243+
runs-on:
244+
- linux
245+
needs: integration-tests
246+
steps:
247+
- name: Checkout repository
248+
uses: actions/checkout@v4
249+
250+
- name: Load pip cache
251+
id: pip-cache
252+
uses: ./.github/actions/load
253+
env:
254+
# Increase this value to reset cache
255+
CACHE_NUMBER: 1
256+
with:
257+
path: $HOME/.cache/pip
258+
key: pip-${{ inputs.python_version }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}
259+
260+
- name: Download test reports
261+
uses: actions/download-artifact@v4
262+
with:
263+
pattern: test-reports-*-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }}
264+
path: reports
265+
merge-multiple: true
266+
267+
- name: Install Python (using actions/setup-python) ${{ inputs.python_version }}
268+
uses: actions/setup-python@v5
269+
with:
270+
python-version: ${{ inputs.python_version }}
271+
272+
- name: Install pass_rate dependencies
273+
run: |
274+
pip install defusedxml
275+
227276
- name: Pass rate
228277
run: |
229-
source ./scripts/capture-hw-details.sh
278+
ls -la reports
279+
source ./reports/.env
230280
python scripts/pass_rate.py --reports reports
231281
python scripts/pass_rate.py --reports reports --json > pass_rate.json
232282
python scripts/pass_rate.py --reports reports --suite tutorials --json > pass_rate_tutorials.json
@@ -247,11 +297,4 @@ jobs:
247297
include-hidden-files: true
248298
path: |
249299
reports/*/*.csv
250-
.env
251-
252-
- name: Upload test reports
253-
if: inputs.upload_test_reports
254-
uses: actions/upload-artifact@v4
255-
with:
256-
name: test-reports-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }}
257-
path: reports
300+
reports/.env

.github/workflows/build-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
name: Integration tests matrix
101101

102102
strategy:
103+
fail-fast: false
103104
matrix:
104105
python:
105106
- "3.9"

scripts/capture-hw-details.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ else
110110
fi
111111

112112
if [[ $QUIET = false ]]; then
113-
echo "LIBIGC1_VERSION=$LIBIGC1_VERSION"
114-
echo "LEVEL_ZERO_VERSION=$LEVEL_ZERO_VERSION"
115-
echo "AGAMA_VERSION=$AGAMA_VERSION"
116-
echo "GPU_DEVICE=$GPU_DEVICE"
117-
echo "TORCH_VERSION=$TORCH_VERSION"
118-
echo "COMPILER_VERSION=$COMPILER_VERSION"
113+
echo "LIBIGC1_VERSION=\"$LIBIGC1_VERSION\""
114+
echo "LEVEL_ZERO_VERSION=\"$LEVEL_ZERO_VERSION\""
115+
echo "AGAMA_VERSION=\"$AGAMA_VERSION\""
116+
echo "GPU_DEVICE=\"$GPU_DEVICE\""
117+
echo "TORCH_VERSION=\"$TORCH_VERSION\""
118+
echo "COMPILER_VERSION=\"$COMPILER_VERSION\""
119119
if [[ ${BENCHMARKING_METHOD:-} ]]; then
120-
echo "BENCHMARKING_METHOD=$BENCHMARKING_METHOD"
120+
echo "BENCHMARKING_METHOD=\"$BENCHMARKING_METHOD\""
121121
fi
122122
fi

0 commit comments

Comments
 (0)