Skip to content

Commit dc9ad8a

Browse files
authored
On-Board check-catalyst workflow to use GitHub Large Runners (#675)
**Context:** When high volume of jobs are being queued on CI. It is possible that it will take a while before a job is picked up. To get around this, we have provisioned an organization runner group of GitHub Large Runners. Since these are paid runners, we retain the ability to scale this up to a value suitable for us during periods of high usage. **Description of the Change:** A new label `urgent` has been introduced to this repo. Whenever a pull request has this label attached, all the jobs within check-catalyst.yml will swap over to use the new Large runner group described above. This PR also bumps the version of actions/checkout and actions/cache being used. This was done to deal with the deprecation of node16 within github actions. **Benefits:** Lowered queue times for urgent CI workloads to get picked up. **Possible Drawbacks:** We can still see jobs being queued for a while if enough PRs have the `urgent` label at once. To get around this, only add it to PRs that are truly urgent. Also, we can increase the scaling factor of the group if needed. **Related GitHub Issues:** None. [sc-61791](https://app.shortcut.com/xanaduai/story/61791/update-catalyst-ci-to-use-large-runners) [sc-61184]: fix for cache issues
1 parent ef00ceb commit dc9ad8a

9 files changed

+221
-156
lines changed

.github/workflows/build-wheel-linux-x86_64.yaml

+24-11
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19+
determine_runner:
20+
name: Determine runner type to use
21+
uses: ./.github/workflows/determine-workflow-runner.yml
22+
with:
23+
default_runner: ubuntu-latest
24+
1925
check_if_wheel_build_required:
2026
uses: ./.github/workflows/check-for-wheel-build.yml
2127

2228
constants:
23-
needs: [check_if_wheel_build_required]
29+
needs: [check_if_wheel_build_required, determine_runner]
2430
if: needs.check_if_wheel_build_required.outputs.build-wheels == 'true'
2531
name: "Set build matrix"
2632
uses: ./.github/workflows/constants.yaml
33+
with:
34+
runs_on: ${{ needs.determine_runner.outputs.runner_group }}
2735

2836
build-dependencies:
29-
needs: [constants, check_if_wheel_build_required]
37+
needs: [constants, check_if_wheel_build_required, determine_runner]
3038

3139
strategy:
3240
fail-fast: false
@@ -37,12 +45,13 @@ jobs:
3745
container_img: ["quay.io/pypa/manylinux2014_x86_64"]
3846

3947
name: Build Dependencies (Python ${{ matrix.python_version }})
40-
runs-on: ubuntu-latest
48+
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
4149
container: ${{ matrix.container_img }}
4250

4351
if: needs.check_if_wheel_build_required.outputs.build-wheels == 'true'
4452

4553
steps:
54+
# TODO: Cannot use actions/checkout@v4 as node20 is not supported in manylinux2014 container
4655
- name: Checkout Catalyst repo
4756
uses: actions/checkout@v3
4857

@@ -78,6 +87,7 @@ jobs:
7887
key: ${{ runner.os }}-enzyme-${{ needs.constants.outputs.enzyme_version }}-generic-source
7988
enableCrossOsArchive: True
8089

90+
# TODO: Cannot use actions/checkout@v4 as node20 is not supported in manylinux2014 container
8191
- name: Clone LLVM Submodule
8292
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
8393
uses: actions/checkout@v3
@@ -86,6 +96,7 @@ jobs:
8696
ref: ${{ needs.constants.outputs.llvm_version }}
8797
path: mlir/llvm-project
8898

99+
# TODO: Cannot use actions/checkout@v4 as node20 is not supported in manylinux2014 container
89100
- name: Clone MHLO Submodule
90101
if: steps.cache-mhlo-source.outputs.cache-hit != 'true'
91102
uses: actions/checkout@v3
@@ -94,6 +105,7 @@ jobs:
94105
ref: ${{ needs.constants.outputs.mhlo_version }}
95106
path: mlir/mlir-hlo
96107

108+
# TODO: Cannot use actions/checkout@v4 as node20 is not supported in manylinux2014 container
97109
- name: Clone Enzyme Submodule
98110
if: steps.cache-enzyme-source.outputs.cache-hit != 'true'
99111
uses: actions/checkout@v3
@@ -206,20 +218,21 @@ jobs:
206218
cmake --build enzyme-build --target EnzymeStatic-18
207219
208220
catalyst-linux-wheels-x86-64:
209-
needs: [constants, build-dependencies]
221+
needs: [constants, build-dependencies, determine_runner]
210222
strategy:
211223
fail-fast: false
212224
matrix:
213-
os: [ubuntu-latest]
225+
os: ${{ fromJSON(format('[{0}]', needs.determine_runner.outputs.runner_group)) }}
214226
arch: [x86_64]
215-
python_version: ${{ fromJson(needs.constants.outputs.python_versions) }}
227+
python_version: ${{ fromJSON(needs.constants.outputs.python_versions) }}
216228
container_img: ["quay.io/pypa/manylinux2014_x86_64"]
217229

218230
name: Build Wheels (Python ${{ matrix.python_version }})
219231
runs-on: ${{ matrix.os }}
220232
container: ${{ matrix.container_img }}
221233

222234
steps:
235+
# TODO: Cannot use actions/checkout@v4 as node20 is not supported in manylinux2014 container
223236
- name: Checkout Catalyst repo
224237
uses: actions/checkout@v3
225238

@@ -357,20 +370,20 @@ jobs:
357370
retention-days: 14
358371

359372
test-wheels:
360-
needs: [constants, catalyst-linux-wheels-x86-64]
373+
needs: [constants, catalyst-linux-wheels-x86-64, determine_runner]
361374
strategy:
362375
fail-fast: false
363376
matrix:
364-
os: [ubuntu-latest, ubuntu-20.04]
365-
python_version: ${{ fromJson(needs.constants.outputs.python_versions) }}
377+
os: ${{ fromJSON(format('[{0}]', needs.determine_runner.outputs.runner_group)) }}
378+
python_version: ${{ fromJSON(needs.constants.outputs.python_versions) }}
366379

367380
# To check all wheels for supported python3 versions
368381
name: Test Wheels (Python ${{ matrix.python_version }}) on ${{ matrix.os }}
369382
runs-on: ${{ matrix.os }}
370383

371384
steps:
372385
- name: Checkout Catalyst repo
373-
uses: actions/checkout@v3
386+
uses: actions/checkout@v4
374387

375388
- name: Download Wheel Artifact
376389
uses: actions/download-artifact@v3
@@ -379,7 +392,7 @@ jobs:
379392
path: dist
380393

381394
- name: Set up Python ${{ matrix.python_version }}
382-
uses: actions/setup-python@v4
395+
uses: actions/setup-python@v5
383396
with:
384397
python-version: ${{ matrix.python_version }}
385398

.github/workflows/build-wheel-macos-arm64.yaml

+20-20
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
steps:
4646
- name: Checkout Catalyst repo
47-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4848

4949
- name: Setup Runner Environment
5050
id: setup_env
@@ -55,47 +55,47 @@ jobs:
5555
# Cache external project sources
5656
- name: Cache LLVM Source
5757
id: cache-llvm-source
58-
uses: actions/cache@v3
58+
uses: actions/cache@v4
5959
with:
6060
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/llvm-project
6161
key: Linux-llvm-${{ needs.constants.outputs.llvm_version }}-generic-source
6262
enableCrossOsArchive: True
6363

6464
- name: Cache MHLO Source
6565
id: cache-mhlo-source
66-
uses: actions/cache@v3
66+
uses: actions/cache@v4
6767
with:
6868
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/mlir-hlo
6969
key: Linux-mhlo-${{ needs.constants.outputs.mhlo_version }}-generic-source
7070
enableCrossOsArchive: True
7171

7272
- name: Cache Enzyme Source
7373
id: cache-enzyme-source
74-
uses: actions/cache@v3
74+
uses: actions/cache@v4
7575
with:
7676
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/Enzyme
7777
key: Linux-enzyme-${{ needs.constants.outputs.enzyme_version }}-generic-source
7878
enableCrossOsArchive: True
7979

8080
- name: Clone LLVM Submodule
8181
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
82-
uses: actions/checkout@v3
82+
uses: actions/checkout@v4
8383
with:
8484
repository: llvm/llvm-project
8585
ref: ${{ needs.constants.outputs.llvm_version }}
8686
path: mlir/llvm-project
8787

8888
- name: Clone MHLO Submodule
8989
if: steps.cache-mhlo-source.outputs.cache-hit != 'true'
90-
uses: actions/checkout@v3
90+
uses: actions/checkout@v4
9191
with:
9292
repository: tensorflow/mlir-hlo
9393
ref: ${{ needs.constants.outputs.mhlo_version }}
9494
path: mlir/mlir-hlo
9595

9696
- name: Clone Enzyme Submodule
9797
if: steps.cache-enzyme-source.outputs.cache-hit != 'true'
98-
uses: actions/checkout@v3
98+
uses: actions/checkout@v4
9999
with:
100100
repository: EnzymeAD/Enzyme
101101
ref: ${{ needs.constants.outputs.enzyme_version }}
@@ -133,21 +133,21 @@ jobs:
133133
# Cache external project builds
134134
- name: Cache LLVM Build
135135
id: cache-llvm-build
136-
uses: actions/cache@v3
136+
uses: actions/cache@v4
137137
with:
138138
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/llvm-build
139139
key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-generic-build
140140

141141
- name: Cache MHLO Build
142142
id: cache-mhlo-build
143-
uses: actions/cache@v3
143+
uses: actions/cache@v4
144144
with:
145145
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mhlo-build
146146
key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-generic-build
147147

148148
- name: Cache Enzyme Build
149149
id: cache-enzyme-build
150-
uses: actions/cache@v3
150+
uses: actions/cache@v4
151151
with:
152152
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/enzyme-build
153153
key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-generic-build
@@ -218,7 +218,7 @@ jobs:
218218

219219
steps:
220220
- name: Checkout Catalyst repo
221-
uses: actions/checkout@v3
221+
uses: actions/checkout@v4
222222

223223
- name: Setup Runner Environment
224224
id: setup_env
@@ -232,7 +232,7 @@ jobs:
232232
233233
- name: Get Cached LLVM Source
234234
id: cache-llvm-source
235-
uses: actions/cache@v3
235+
uses: actions/cache@v4
236236
with:
237237
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/llvm-project
238238
key: Linux-llvm-${{ needs.constants.outputs.llvm_version }}-generic-source
@@ -241,15 +241,15 @@ jobs:
241241

242242
- name: Get Cached LLVM Build
243243
id: cache-llvm-build
244-
uses: actions/cache@v3
244+
uses: actions/cache@v4
245245
with:
246246
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/llvm-build
247247
key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-generic-build
248248
fail-on-cache-miss: True
249249

250250
- name: Get Cached MHLO Source
251251
id: cache-mhlo-source
252-
uses: actions/cache@v3
252+
uses: actions/cache@v4
253253
with:
254254
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/mlir-hlo
255255
key: Linux-mhlo-${{ needs.constants.outputs.mhlo_version }}-generic-source
@@ -258,23 +258,23 @@ jobs:
258258

259259
- name: Get Cached MHLO Build
260260
id: cache-mhlo-build
261-
uses: actions/cache@v3
261+
uses: actions/cache@v4
262262
with:
263263
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mhlo-build
264264
key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-generic-build
265265
fail-on-cache-miss: True
266266

267267
- name: Get Cached Enzyme Source
268268
id: cache-enzyme-source
269-
uses: actions/cache@v3
269+
uses: actions/cache@v4
270270
with:
271271
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/mlir/Enzyme
272272
key: Linux-enzyme-${{ needs.constants.outputs.enzyme_version }}-generic-source
273273
fail-on-cache-miss: True
274274

275275
- name: Get Cached Enzyme Build
276276
id: cache-enzyme-build
277-
uses: actions/cache@v3
277+
uses: actions/cache@v4
278278
with:
279279
path: ${{ steps.setup_env.outputs.dependency_build_dir }}/enzyme-build
280280
key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-generic-build
@@ -356,7 +356,7 @@ jobs:
356356
delocate-wheel --require-archs=arm64 -w ./wheel -v dist/*.whl --ignore-missing-dependencies -vv
357357
358358
- name: Upload Wheel Artifact
359-
uses: actions/upload-artifact@v3
359+
uses: actions/upload-artifact@v4
360360
with:
361361
name: catalyst-macos_arm64-wheel-py-${{ matrix.python_version }}.zip
362362
path: wheel/
@@ -376,7 +376,7 @@ jobs:
376376

377377
steps:
378378
- name: Checkout Catalyst repo
379-
uses: actions/checkout@v3
379+
uses: actions/checkout@v4
380380

381381
- name: Setup Runner Environment
382382
id: setup_env
@@ -385,7 +385,7 @@ jobs:
385385
python_version: ${{ matrix.python_version }}
386386

387387
- name: Download Wheel Artifact
388-
uses: actions/download-artifact@v3
388+
uses: actions/download-artifact@v4
389389
with:
390390
name: catalyst-macos_arm64-wheel-py-${{ matrix.python_version }}.zip
391391
path: dist

0 commit comments

Comments
 (0)