-
Notifications
You must be signed in to change notification settings - Fork 1
180 lines (158 loc) · 7.35 KB
/
Copy pathweekly-riscv.yml
File metadata and controls
180 lines (158 loc) · 7.35 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
# *******************************************************************************
# Copyright 2024-2025 Arm Limited and affiliates.
# Copyright 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# *******************************************************************************
name: "Weekly RISC-V"
on:
workflow_dispatch:
schedule:
#* minute (0-59) hour (0-23) day (1-31) month (1-12) day of the week (0 - 6)
#* cron jobs run on the default (main) branch.
#* set to run at 5am Saturday UCT
- cron: "0 5 * * 6"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Declare default permissions as read only.
permissions: read-all
jobs:
build:
strategy:
matrix:
config: [
{ name: riscv-build, label: ubuntu-24.04, threading: OMP, toolset: gcc, build: RelWithAssert, testset: CI }
]
name: ${{ matrix.config.name }}, ${{ matrix.config.toolset }}, ${{ matrix.config.threading }}, ${{ matrix.config.build }}
runs-on: ${{ matrix.config.label }}
steps:
- name: Checkout oneDNN
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
path: oneDNN
- name: Read version file
id: get-versions
run: |
content=`cat ${{ github.workspace }}/oneDNN/.github/automation/riscv/ci.json`
content="${content//[$'\t\r\n$ ']}"
echo "output=$content" >> $GITHUB_OUTPUT
# Note: This will create a github actions cache
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@f5b8fbb4d77cec1acc5a5f9f0df4beffaf5d98d9 # v4.3.4
with:
cmakeVersion: 3.31.0
ninjaVersion: 1.12.0
# Install cross-compilation tools
- name: Install cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}-riscv64-linux-gnu g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}-riscv64-linux-gnu
- name: Configure oneDNN
run: ${{ github.workspace }}/oneDNN/.github/automation/riscv/build.sh
working-directory: ${{ github.workspace }}/oneDNN
env:
BUILD_TOOLSET: ${{ matrix.config.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
CMAKE_GENERATOR: Ninja
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
ONEDNN_ACTION: configure
ONEDNN_TEST_SET: ${{ matrix.config.testset }}
ONEDNN_THREADING: ${{ matrix.config.threading }}
- name: Build oneDNN
run: ${{ github.workspace }}/oneDNN/.github/automation/riscv/build.sh
working-directory: ${{ github.workspace }}/oneDNN
env:
ONEDNN_ACTION: build
- name: Create archive with preserved permissions
working-directory: ${{ github.workspace }}/oneDNN
run: |
tar -czf build.tar.gz build
# Upload build artifacts
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-artifact-weekly
path: |
${{ github.workspace }}/oneDNN/build.tar.gz
retention-days: 1
test:
needs: build
strategy:
matrix:
config: [
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 1, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 2, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 3, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 4, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 5, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 6, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 7, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 8, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 9, stride: 10 },
{ name: riscv-test-vlen128, threading: OMP, testset: CI, vlen: 128, build: RelWithAssert, part: 10, stride: 10 }
]
name: ${{ matrix.config.name }}, ${{ matrix.config.threading }}, part-${{ matrix.config.part }}
runs-on: ubuntu-24.04
steps:
- name: Checkout oneDNN
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
path: oneDNN
- name: Read version file
id: get-versions
run: |
content=`cat ${{ github.workspace }}/oneDNN/.github/automation/riscv/ci.json`
content="${content//[$'\t\r\n$ ']}"
echo "output=$content" >> $GITHUB_OUTPUT
# Setup QEMU for RISC-V platform support
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
with:
platforms: riscv64
# Install cross-compilation tools
- name: Install cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}-riscv64-linux-gnu g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}-riscv64-linux-gnu
# Download build artifacts
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-artifact-weekly
path: ${{ github.workspace }}/oneDNN/
- name: Extract archive
working-directory: ${{ github.workspace }}/oneDNN/
run: |
tar -xzf build.tar.gz
- name: Run oneDNN tests
run: ${{ github.workspace }}/oneDNN/.github/automation/riscv/test.sh
working-directory: ${{ github.workspace }}/oneDNN/build
env:
CTEST_PARALLEL_LEVEL: 4
ONEDNN_TEST_PARTITION: balanced
ONEDNN_THREADING: ${{ matrix.config.threading }}
ONEDNN_TEST_SET: ${{ matrix.config.testset }}
ONEDNN_TEST_PART: ${{ matrix.config.part }}
ONEDNN_TEST_STRIDE: ${{ matrix.config.stride }}
QEMU_CPU: "rv64,v=true,vlen=${{ matrix.config.vlen }},vext_spec=v1.0"
# This job adds a check named "Weekly RISC-V" that represents overall
# workflow status and can be used in branch rulesets
status:
needs: [build, test]
runs-on: ubuntu-24.04
name: "Weekly RISC-V"
steps:
- name: Print success
run: echo Success