Skip to content

Commit e8e5c55

Browse files
committed
ci: restore upstream cpu github actions
1 parent 6b6492b commit e8e5c55

51 files changed

Lines changed: 1639 additions & 1203 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/automation/aarch64/build.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
set -o errexit -o pipefail -o noclobber
2323

24-
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
24+
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
2525

2626
# Defines MP, CC, CXX and OS.
2727
source ${SCRIPT_DIR}/common.sh
@@ -31,37 +31,52 @@ export ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"}
3131
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"}
3232
ONEDNN_TEST_SET=${ONEDNN_TEST_SET:-"SMOKE"}
3333
ONEDNN_BUILD_GRAPH=${ONEDNN_BUILD_GRAPH:-"ON"}
34+
ONEDNN_EXPERIMENTAL_UKERNEL=${ONEDNN_EXPERIMENTAL_UKERNEL:-"ON"}
35+
ONEDNN_CMAKE_EXTRA_FLAGS=${ONEDNN_CMAKE_EXTRA_FLAGS:-""}
36+
37+
GENERATOR_ARGS=()
38+
if [[ -n "${CMAKE_GENERATOR}" ]]; then
39+
GENERATOR_ARGS=(-G "${CMAKE_GENERATOR}")
40+
fi
3441

3542
if [[ "$ONEDNN_ACTION" == "configure" ]]; then
3643
if [[ "$GITHUB_JOB" == "pr-clang-tidy" ]]; then
3744
CC=clang CXX=clang++ \
3845
cmake \
46+
"${GENERATOR_ARGS[@]}" \
3947
-Bbuild -S. \
4048
-DDNNL_USE_ACL=ON \
41-
-DONEDNN_BUILD_GRAPH=ON \
49+
-DONEDNN_BUILD_GRAPH=OFF \
4250
-DDNNL_CPU_RUNTIME=OMP \
43-
-DONEDNN_WERROR=ON \
51+
-DDNNL_WERROR=ON \
4452
-DDNNL_BUILD_FOR_CI=ON \
4553
-DONEDNN_TEST_SET=NO_CORR \
4654
-DCMAKE_BUILD_TYPE=Debug \
47-
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
55+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
56+
-DDNNL_EXPERIMENTAL_UKERNEL=ON \
57+
${ONEDNN_CMAKE_EXTRA_FLAGS}
4858
set +x
4959
else
5060
set -x
5161
cmake \
62+
"${GENERATOR_ARGS[@]}" \
5263
-Bbuild -S. \
5364
-DDNNL_USE_ACL=ON \
5465
-DONEDNN_BUILD_GRAPH=$ONEDNN_BUILD_GRAPH \
5566
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \
56-
-DONEDNN_WERROR=ON \
67+
-DDNNL_WERROR=ON \
5768
-DDNNL_BUILD_FOR_CI=ON \
5869
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
59-
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
70+
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
71+
-DCMAKE_SKIP_BUILD_RPATH=FALSE \
72+
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
73+
-DDNNL_EXPERIMENTAL_UKERNEL=$ONEDNN_EXPERIMENTAL_UKERNEL \
74+
${ONEDNN_CMAKE_EXTRA_FLAGS}
6075
set +x
6176
fi
6277
elif [[ "$ONEDNN_ACTION" == "build" ]]; then
6378
set -x
64-
cmake --build build
79+
cmake --build build --parallel "${MP#-j}"
6580
set +x
6681
else
6782
echo "Unknown action: $ONEDNN_ACTION"

.github/automation/aarch64/build_acl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
set -o errexit -o pipefail -o noclobber
2323

24-
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
24+
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
2525

2626
# Defines MP, CC, CXX and OS.
2727
source ${SCRIPT_DIR}/common.sh

.github/automation/aarch64/skipped-tests.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,54 @@
1717
# limitations under the License.
1818
# *******************************************************************************
1919

20-
# Test oneDNN for aarch64.
21-
2220
set -eo pipefail
2321

2422
OS=${OS:-"Linux"}
2523

2624
# Nightly failures
2725
SKIPPED_TEST_FAILURES+="test_benchdnn_modeC_graph_fusions_cpu"
2826

29-
# We currently have some OS and config specific test failures.
27+
# We currently have some OS and config specific test failures.
3028
if [[ "$OS" == "Linux" ]]; then
29+
SKIPPED_TEST_FAILURES+="|cpu-matmul-coo-cpp"
30+
SKIPPED_TEST_FAILURES+="|cpu-matmul-csr-cpp"
31+
SKIPPED_TEST_FAILURES+="|cpu-tutorials-matmul-sgemm-and-matmul-cpp"
32+
SKIPPED_TEST_FAILURES+="|cpu-tutorials-matmul-weights-decompression-matmul-cpp"
3133
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_graph_ci_cpu"
3234

33-
# OpenVINO Toolkit OneDNN fork failed tests
3435
SKIPPED_TEST_FAILURES+="|test_batch_normalization"
3536
SKIPPED_TEST_FAILURES+="|test_eltwise"
3637
SKIPPED_TEST_FAILURES+="|test_iface_attr"
38+
SKIPPED_TEST_FAILURES+="|test_iface_sparse"
3739
SKIPPED_TEST_FAILURES+="|test_lrn"
3840
SKIPPED_TEST_FAILURES+="|test_pooling_forward"
3941
SKIPPED_TEST_FAILURES+="|test_reduction"
4042
SKIPPED_TEST_FAILURES+="|test_api"
4143
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_binary_smoke_cpu"
4244
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_bnorm_smoke_cpu"
45+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu"
4346
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_conv_smoke_cpu"
4447
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_deconv_smoke_cpu"
4548
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_eltwise_smoke_cpu"
4649
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lrn_smoke_cpu"
4750
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_pool_smoke_cpu"
4851
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_reduction_smoke_cpu"
52+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_softmax_smoke_cpu"
53+
elif [[ "$OS" == "Darwin" ]]; then
54+
SKIPPED_TEST_FAILURES+="|cpu-matmul-coo-cpp"
55+
SKIPPED_TEST_FAILURES+="|cpu-matmul-csr-cpp"
56+
SKIPPED_TEST_FAILURES+="|cpu-tutorials-matmul-sgemm-and-matmul-cpp"
57+
SKIPPED_TEST_FAILURES+="|cpu-tutorials-matmul-weights-decompression-matmul-cpp"
58+
SKIPPED_TEST_FAILURES+="|test_eltwise"
59+
SKIPPED_TEST_FAILURES+="|test_iface_attr"
60+
SKIPPED_TEST_FAILURES+="|test_iface_sparse"
61+
SKIPPED_TEST_FAILURES+="|test_pooling_forward"
62+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu"
63+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_conv_smoke_cpu"
64+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_deconv_smoke_cpu"
65+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_eltwise_smoke_cpu"
66+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_pool_smoke_cpu"
67+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_softmax_smoke_cpu"
4968
fi
5069

5170
printf "${SKIPPED_TEST_FAILURES}"

.github/automation/aarch64/test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121

2222
set -o errexit -o pipefail -o noclobber
2323

24-
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
24+
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
25+
OUTPUT_XML=$1
26+
OUTPUT_LOG=$2
27+
28+
if [[ -z "${OUTPUT_XML}" || -z "${OUTPUT_LOG}" ]]; then
29+
echo "Usage: $0 <output-xml> <output-log>" >&2
30+
exit 2
31+
fi
2532

2633
# Defines MP, CC, CXX and OS.
2734
source ${SCRIPT_DIR}/common.sh
@@ -31,6 +38,8 @@ if [[ "$ONEDNN_THREADING" == "SEQ" ]]; then
3138
export CTEST_PARALLEL_LEVEL=""
3239
fi
3340

41+
CTEST_OPTS=(--no-tests=error --output-on-failure -E "$("${SCRIPT_DIR}"/skipped-tests.sh)" --output-junit "${OUTPUT_XML}")
42+
3443
set -x
35-
ctest --no-tests=error --output-on-failure -E $("${SCRIPT_DIR}"/skipped-tests.sh) --output-junit $1
44+
ctest "${CTEST_OPTS[@]}" | tee "${OUTPUT_LOG}"
3645
set +x

.github/automation/clang-format.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#! /bin/bash
1+
#!/usr/bin/env bash
22

33
#===============================================================================
4-
# Copyright 2019-2020 Intel Corporation
4+
# Copyright 2019 Intel Corporation
5+
# Copyright 2025 Arm Ltd. and affiliates
56
#
67
# Licensed under the Apache License, Version 2.0 (the "License");
78
# you may not use this file except in compliance with the License.
@@ -16,7 +17,7 @@
1617
# limitations under the License.
1718
#===============================================================================
1819

19-
CLANG_FORMAT=clang-format-11
20+
CLANG_FORMAT=clang-format-18
2021

2122
echo "Checking ${CLANG_FORMAT}"
2223
if ! ${CLANG_FORMAT} --version; then
@@ -26,7 +27,21 @@ fi
2627

2728
echo "Starting format check..."
2829

29-
for filename in $(find "$(pwd)" -type f | grep -P ".*\.(c|cpp|h|hpp|cl)$"); do ${CLANG_FORMAT} -style=file -i $filename; done
30+
src_regex='.*\.(c|h|cpp|hpp|cxx|hxx|cl)$'
31+
32+
# Treat the first argument as a base SHA for git diff. If called with no
33+
# arguments, check the whole repo.
34+
if [[ $# -gt 0 ]]; then
35+
base_sha=$1
36+
file_list=$(git diff --name-only --diff-filter=ACMRT "$base_sha" | grep -E "$src_regex" || true)
37+
echo "Checking: $file_list"
38+
while IFS= read -r filename; do
39+
[[ -f "$filename" ]] || continue
40+
"${CLANG_FORMAT}" -style=file -i "$filename"
41+
done <<< "$file_list"
42+
else
43+
find "$(pwd)" -type f -regextype posix-egrep -regex "$src_regex" -exec "$CLANG_FORMAT" -style=file -i {} \+
44+
fi
3045

3146
RETURN_CODE=0
3247

.github/automation/commit-msg-check.py

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
# limitations under the License.
1919
# *******************************************************************************
2020

21+
import re
2122
import argparse
2223
import subprocess
23-
import re
2424

2525
# Ensure the scope ends in a colon and that same level scopes are
2626
# comma delimited.
@@ -30,9 +30,21 @@
3030
def __scopeCheck(msg: str):
3131
status = "Message scope: "
3232

33-
if not re.match('^[a-z0-9_]+(, [a-z0-9_]+)*: ', msg):
34-
print(f"{status} FAILED: Commit message must follow the format "
35-
"<scope>:[ <scope>:] <short description>")
33+
if not re.match(r"^[a-z0-9_]+(, [a-z0-9_]+)*: ", msg):
34+
if re.match(r"^\s+", msg):
35+
print(
36+
f"{status} FAILED: Commit message shouldn't have leading spaces"
37+
)
38+
return False
39+
40+
if re.match(r"^Merge ", msg):
41+
print(f"{status} FAILED: Merge commits are not allowed")
42+
return False
43+
44+
print(
45+
f"{status} FAILED: Commit message must follow the format "
46+
"<scope>:[ <scope>:] <short description>"
47+
)
3648
return False
3749

3850
print(f"{status} OK")
@@ -45,14 +57,20 @@ def __numCharacterCheck(msg: str):
4557
print(f"{status} OK")
4658
return True
4759
else:
48-
# Fixup commits usually include the full name of the commit they are
49-
# fixing, which adds 6 more symbols to the message. Let them in.
50-
if re.match('^fixup: ', msg):
60+
# Fixup or revert commits usually include the full name of the commit
61+
# they are fixing, which adds 6 more symbols to the message.
62+
# Let them in.
63+
if re.match(r"^fixup: ", msg):
5164
print(f"{status} Fixup message, OK")
5265
return True
66+
elif re.match(r"^revert: ", msg):
67+
print(f"{status} Revert message, OK")
68+
return True
5369
else:
54-
print(f"{status} FAILED: Commit message summary must not "
55-
"exceed 72 characters.")
70+
print(
71+
f"{status} FAILED: Commit message summary must not "
72+
"exceed 72 characters."
73+
)
5674
return False
5775

5876
def main():
@@ -64,23 +82,28 @@ def main():
6482
head: str = args.head
6583

6684
commit_range = base + ".." + head
67-
messages = subprocess.run(["git", "rev-list", "--format=oneline",
68-
commit_range], capture_output=True, text=True).stdout
85+
messages = subprocess.run(
86+
["git", "rev-list", "--format=oneline", commit_range],
87+
capture_output=True,
88+
text=True,
89+
).stdout
6990

7091
is_ok = True
7192
for i in messages.splitlines():
72-
print(i)
73-
commit_msg=i.split(' ', 1)[1]
74-
result = __numCharacterCheck(commit_msg)
75-
is_ok = is_ok and result
76-
result = __scopeCheck(commit_msg)
77-
is_ok = is_ok and result
93+
print(i)
94+
commit_msg = i.split(" ", 1)[1]
95+
result = __numCharacterCheck(commit_msg)
96+
is_ok = is_ok and result
97+
result = __scopeCheck(commit_msg)
98+
is_ok = is_ok and result
7899

79100
if is_ok:
80101
print("All commmit messages are formatted correctly. ")
81102
else:
82-
print("Some commit message checks failed. Please align commit messages "
83-
"with Contributing Guidelines and update the PR.")
103+
print(
104+
"Some commit message checks failed. Please align commit messages "
105+
"with Contributing Guidelines and update the PR."
106+
)
84107
exit(1)
85108

86109

.github/automation/riscv/build.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#! /bin/bash
2+
3+
# *******************************************************************************
4+
# Copyright 2024 Arm Limited and affiliates.
5+
# Copyright 2025 Intel Corporation
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
# *******************************************************************************
20+
21+
# Build oneDNN for RISC-V.
22+
23+
set -o errexit -o pipefail -o noclobber
24+
25+
SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)"
26+
27+
# Defines MP, CC, CXX, OS and RISC-V specific variables.
28+
source ${SCRIPT_DIR}/common.sh
29+
30+
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"}
31+
ONEDNN_TEST_SET=${ONEDNN_TEST_SET:-"SMOKE"}
32+
ONEDNN_BUILD_GRAPH=${ONEDNN_BUILD_GRAPH:-"ON"}
33+
ONEDNN_THREADING=${ONEDNN_THREADING:-"OMP"}
34+
ONEDNN_CMAKE_EXTRA_FLAGS=${ONEDNN_CMAKE_EXTRA_FLAGS:-""}
35+
36+
GENERATOR_ARGS=()
37+
if [[ -n "${CMAKE_GENERATOR}" ]]; then
38+
GENERATOR_ARGS=(-G "${CMAKE_GENERATOR}")
39+
fi
40+
41+
if [[ "$ONEDNN_ACTION" == "configure" ]]; then
42+
set -x
43+
cmake \
44+
"${GENERATOR_ARGS[@]}" \
45+
-Bbuild -S. \
46+
-DONEDNN_BUILD_GRAPH=$ONEDNN_BUILD_GRAPH \
47+
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \
48+
-DDNNL_WERROR=ON \
49+
-DDNNL_BUILD_FOR_CI=ON \
50+
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
51+
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
52+
-DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" \
53+
${ONEDNN_CMAKE_EXTRA_FLAGS}
54+
set +x
55+
elif [[ "$ONEDNN_ACTION" == "build" ]]; then
56+
set -x
57+
cmake --build build --parallel "${MP#-j}"
58+
set +x
59+
else
60+
echo "Unknown action: $ONEDNN_ACTION"
61+
exit 1
62+
fi

.github/automation/riscv/ci.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"gcc": "14"
4+
}
5+
}

0 commit comments

Comments
 (0)