Skip to content

Commit 2e5ec4c

Browse files
Merge pull request #446 from puneetmatharu/update-github-workflows
Update GitHub workflows
2 parents f32a44c + e11e929 commit 2e5ec4c

3 files changed

Lines changed: 140 additions & 102 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# SPDX-FileCopyrightText: Copyright 2026 Arm Limited and affiliates.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: "PyTorch single platform build-and-test"
6+
7+
on:
8+
workflow_call:
9+
inputs:
10+
target_name:
11+
required: true
12+
type: string
13+
runner_label:
14+
required: true
15+
type: string
16+
onednn_fpmath_modes_json:
17+
required: true
18+
type: string
19+
20+
# Declare default permissions as read only.
21+
permissions: read-all
22+
23+
jobs:
24+
build-image:
25+
runs-on: ${{ inputs.runner_label }}
26+
env:
27+
TARGET_NAME: ${{ inputs.target_name }}
28+
CCACHE_LOCAL_DIR: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/.ccache
29+
TORCH_BUILD_CONTAINER_ID_FILE: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/.torch_build_container_id
30+
steps:
31+
- name: Checkout Tool-Solutions
32+
uses: actions/checkout@v6.0.2
33+
with:
34+
path: Tool-Solutions
35+
36+
- name: Set up Docker
37+
uses: docker/setup-docker-action@v5.0.0
38+
39+
- name: Create unique cache key from the year and week (YYYY-WW)
40+
id: cache_suffix
41+
run: echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
42+
43+
# Restore cache if available. GitHub automatically evicts cache entries that have not been
44+
# accessed for over 7 days. We rotate the cache key weekly; if no cache exists for the
45+
# current week, a cache from a previous week (via the prefix restore key) will be restored
46+
# and then saved under the current week's key at the end of the job. This effectively limits
47+
# the cache to at most two weeks of cache data.
48+
- name: Restore ccache cache
49+
uses: actions/cache@v5.0.3
50+
with:
51+
path: ${{ env.CCACHE_LOCAL_DIR }}
52+
key: ccache-${{ env.TARGET_NAME }}-${{ steps.cache_suffix.outputs.week }}
53+
restore-keys: |
54+
ccache-${{ env.TARGET_NAME }}-
55+
56+
- name: Build Tool-Solutions PyTorch
57+
working-directory: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64
58+
run: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/build.sh
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
CCACHE_LOCAL_DIR: ${{ env.CCACHE_LOCAL_DIR }}
62+
CCACHE_MAXSIZE: 2G
63+
64+
- name: Print ccache disk usage
65+
run: du -sh "${{ env.CCACHE_LOCAL_DIR }}" || true
66+
67+
- name: Report final ccache build stats
68+
run: docker exec "$(cat ${{ env.TORCH_BUILD_CONTAINER_ID_FILE }})" ccache -s || true
69+
70+
- name: Save image as an artifact
71+
run: docker save toolsolutions-pytorch:latest -o toolsolutions-pytorch-image-${{ env.TARGET_NAME }}.tar
72+
73+
- name: Upload build artifact
74+
uses: actions/upload-artifact@v7.0.0
75+
with:
76+
name: toolsolutions-pytorch-image-${{ env.TARGET_NAME }}
77+
path: toolsolutions-pytorch-image-${{ env.TARGET_NAME }}.tar
78+
compression-level: 9
79+
retention-days: 1
80+
81+
test:
82+
needs: build-image
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
onednn_fpmath_mode: ${{ fromJSON(inputs.onednn_fpmath_modes_json) }}
87+
runs-on: ${{ inputs.runner_label }}
88+
steps:
89+
- name: Download image artifact
90+
uses: actions/download-artifact@v8.0.0
91+
with:
92+
name: toolsolutions-pytorch-image-${{ inputs.target_name }}
93+
path: .
94+
95+
- name: Set up Docker
96+
uses: docker/setup-docker-action@v5.0.0
97+
98+
- name: Load Docker image
99+
run: docker load -i toolsolutions-pytorch-image-${{ inputs.target_name }}.tar
100+
101+
- name: Run smoke tests
102+
run: |
103+
docker run --rm \
104+
-e ONEDNN_DEFAULT_FPMATH_MODE=${{ matrix.onednn_fpmath_mode }} \
105+
toolsolutions-pytorch:latest ./test-examples.sh
106+
107+
- name: Run unit tests
108+
run: |
109+
docker run --rm \
110+
-e ONEDNN_DEFAULT_FPMATH_MODE=${{ matrix.onednn_fpmath_mode }} \
111+
toolsolutions-pytorch:latest ./run_unit_tests.sh

.github/workflows/pytorch.yml

Lines changed: 26 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -45,102 +45,29 @@ concurrency:
4545
permissions: read-all
4646

4747
jobs:
48-
build-image:
49-
strategy:
50-
matrix:
51-
config:
52-
[
53-
{ name: c7g, label: ah-ubuntu_24_04-c7g_8x-100 },
54-
{ name: c8g, label: ah-ubuntu_24_04-c8g_8x }
55-
]
56-
runs-on: ${{ matrix.config.label }}
57-
env:
58-
CCACHE_LOCAL_DIR: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/.ccache
59-
TORCH_BUILD_CONTAINER_ID_FILE: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/.torch_build_container_id
60-
steps:
61-
- name: Checkout Tool-Solutions
62-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63-
with:
64-
path: Tool-Solutions
65-
66-
- name: Set up Docker
67-
uses: docker/setup-docker-action@v4
68-
69-
- name: Create unique cache key from the year and week (YYYY-WW)
70-
id: cache_suffix
71-
run: echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
72-
73-
# Restore cache if available. GitHub automatically evicts cache entries that have not been
74-
# accessed for over 7 days. We rotate the cache key weekly; if no cache exists for the
75-
# current week, a cache from a previous week (via the prefix restore key) will be restored
76-
# and then saved under the current week's key at the end of the job. This effectively limits
77-
# the cache to at most two weeks of cache data.
78-
- name: Restore ccache cache
79-
uses: actions/cache@v5
80-
with:
81-
path: ${{ env.CCACHE_LOCAL_DIR }}
82-
key: ccache-${{ matrix.config.name }}-${{ steps.cache_suffix.outputs.week }}
83-
restore-keys: |
84-
ccache-${{ matrix.config.name }}-
85-
86-
- name: Build Tool-Solutions PyTorch
87-
working-directory: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64
88-
run: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/build.sh
89-
env:
90-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
CCACHE_LOCAL_DIR: ${{ env.CCACHE_LOCAL_DIR }}
92-
CCACHE_MAXSIZE: 2G
93-
94-
- name: Print ccache disk usage
95-
run: du -sh "${{ env.CCACHE_LOCAL_DIR }}" || true
96-
97-
- name: Report final ccache build stats
98-
run: docker exec "$(cat ${{ env.TORCH_BUILD_CONTAINER_ID_FILE }})" ccache -s || true
99-
100-
- name: Save image as an artifact
101-
run: docker save toolsolutions-pytorch:latest -o toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
102-
103-
- name: Upload build artifact
104-
uses: actions/upload-artifact@v5
105-
with:
106-
name: toolsolutions-pytorch-image-${{ matrix.config.name }}
107-
path: toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
108-
compression-level: 9
109-
retention-days: 1
110-
111-
test:
112-
needs: build-image
113-
strategy:
114-
fail-fast: false
115-
matrix:
116-
config:
117-
[
118-
{ name: c7g, label: ah-ubuntu_24_04-c7g_8x-100 },
119-
{ name: c8g, label: ah-ubuntu_24_04-c8g_8x }
120-
]
121-
onednn_fpmath_mode: [FP32, BF16]
122-
runs-on: ${{ matrix.config.label }}
123-
steps:
124-
- name: Download image artifact
125-
uses: actions/download-artifact@v5
126-
with:
127-
name: toolsolutions-pytorch-image-${{ matrix.config.name }}
128-
path: .
129-
130-
- name: Set up Docker
131-
uses: docker/setup-docker-action@v4
132-
133-
- name: Load Docker image
134-
run: docker load -i toolsolutions-pytorch-image-${{ matrix.config.name }}.tar
135-
136-
- name: Run smoke tests
137-
run: |
138-
docker run --rm \
139-
-e ONEDNN_DEFAULT_FPMATH_MODE=${{ matrix.onednn_fpmath_mode }} \
140-
toolsolutions-pytorch:latest ./test-examples.sh
141-
142-
- name: Run unit tests
143-
run: |
144-
docker run --rm \
145-
-e ONEDNN_DEFAULT_FPMATH_MODE=${{ matrix.onednn_fpmath_mode }} \
146-
toolsolutions-pytorch:latest ./run_unit_tests.sh
48+
run-c6g:
49+
name: "c6g - build & test"
50+
uses: ./.github/workflows/_pytorch-single-platform.yml
51+
with:
52+
target_name: c6g
53+
runner_label: ah-ubuntu_22_04-c6g_8x-100
54+
onednn_fpmath_modes_json: '["FP32"]'
55+
secrets: inherit
56+
57+
run-c7g:
58+
name: "c7g - build & test"
59+
uses: ./.github/workflows/_pytorch-single-platform.yml
60+
with:
61+
target_name: c7g
62+
runner_label: ah-ubuntu_24_04-c7g_8x-100
63+
onednn_fpmath_modes_json: '["FP32","BF16"]'
64+
secrets: inherit
65+
66+
run-c8g:
67+
name: "c8g - build & test"
68+
uses: ./.github/workflows/_pytorch-single-platform.yml
69+
with:
70+
target_name: c8g
71+
runner_label: ah-ubuntu_24_04-c8g_8x
72+
onednn_fpmath_modes_json: '["FP32","BF16"]'
73+
secrets: inherit

.github/workflows/tensorflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and affiliates.
1+
# SPDX-FileCopyrightText: Copyright 2025, 2026 Arm Limited and affiliates.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -55,12 +55,12 @@ jobs:
5555
runs-on: ${{ matrix.config.label }}
5656
steps:
5757
- name: Checkout Tool-Solutions
58-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
uses: actions/checkout@v6.0.2
5959
with:
6060
path: Tool-Solutions
6161

6262
- name: Set up Docker
63-
uses: docker/setup-docker-action@v4
63+
uses: docker/setup-docker-action@v5.0.0
6464

6565
- name: Build Tool-Solutions Tensorflow
6666
working-directory: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/tensorflow-aarch64

0 commit comments

Comments
 (0)