-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: workflows: Enable Linux aarch64 CI
- Backport for v3.6 - Plus a small change to compile with gcc. Signed-off-by: Hamza Butt <[email protected]>
- Loading branch information
1 parent
0ddf12e
commit 9c9905b
Showing
6 changed files
with
402 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#! /bin/bash | ||
|
||
# ******************************************************************************* | ||
# Copyright 2024 Arm Limited and affiliates. | ||
# 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. | ||
# ******************************************************************************* | ||
|
||
# Build oneDNN for aarch64. | ||
|
||
set -o errexit -o pipefail -o noclobber | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
|
||
# Defines MP, CC, CXX and OS. | ||
source ${SCRIPT_DIR}/common_aarch64.sh | ||
|
||
export ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"} | ||
|
||
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"} | ||
ONEDNN_TEST_SET=SMOKE | ||
|
||
# ACL is not built with OMP on macOS. | ||
if [[ "$OS" == "Darwin" ]]; then | ||
ONEDNN_THREADING=SEQ | ||
fi | ||
|
||
set -x | ||
cmake \ | ||
-Bbuild -S. \ | ||
-DDNNL_AARCH64_USE_ACL=ON \ | ||
-DONEDNN_BUILD_GRAPH=0 \ | ||
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \ | ||
-DONEDNN_WERROR=OFF \ | ||
-DDNNL_BUILD_FOR_CI=ON \ | ||
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \ | ||
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE | ||
|
||
cmake --build build $MP | ||
set +x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#! /bin/bash | ||
|
||
# ******************************************************************************* | ||
# Copyright 2024 Arm Limited and affiliates. | ||
# 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. | ||
# ******************************************************************************* | ||
|
||
# Common variables for aarch64 ci. Exports: | ||
# CC, CXX, OS, MP | ||
|
||
set -o errexit -o pipefail -o noclobber | ||
|
||
export OS=$(uname) | ||
|
||
# Num threads on system. | ||
if [[ "$OS" == "Darwin" ]]; then | ||
export MP="-j$(sysctl -n hw.ncpu)" | ||
elif [[ "$OS" == "Linux" ]]; then | ||
export MP="-j$(nproc)" | ||
fi | ||
|
||
if [[ "$BUILD_TOOLSET" == "gcc" ]]; then | ||
export CC=gcc-${GCC_VERSION} | ||
export CXX=g++-${GCC_VERSION} | ||
elif [[ "$BUILD_TOOLSET" == "clang" ]]; then | ||
export CC=clang | ||
export CXX=clang++ | ||
fi | ||
|
||
# Print every exported variable. | ||
echo "OS: $OS" | ||
echo "Toolset: $BUILD_TOOLSET" | ||
echo "CC: $CC" | ||
echo "CXX: $CXX" | ||
echo "MP: $MP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#! /bin/bash | ||
|
||
# ******************************************************************************* | ||
# Copyright 2024 Arm Limited and affiliates. | ||
# 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. | ||
# ******************************************************************************* | ||
|
||
# Test oneDNN for aarch64. | ||
|
||
set -o errexit -o pipefail -o noclobber | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
|
||
# Defines MP, CC, CXX and OS. | ||
source ${SCRIPT_DIR}/common_aarch64.sh | ||
|
||
# Skip tests for certain config to preserve resources, while maintaining | ||
# coverage. Skip: | ||
# (SEQ,CLANG) | ||
# (OMP,CLANG,DEBUG) | ||
SKIP_TESTS=0 | ||
if [[ "$OS" == "Linux" ]]; then | ||
if [[ "$ONEDNN_THREADING" == "SEQ" ]]; then | ||
if [[ "$BUILD_TOOLSET" == "clang" ]]; then | ||
SKIP_TESTS=1 | ||
fi | ||
elif [[ "$ONEDNN_THREADING" == "OMP" ]]; then | ||
if [[ "$BUILD_TOOLSET" == "clang" ]]; then | ||
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then | ||
SKIP_TESTS=1 | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
if [[ $SKIP_TESTS == 1 ]]; then | ||
echo "Skipping tests for this configuration: $OS $ONEDNN_THREADING $BUILD_TOOLSET". | ||
exit 0 | ||
fi | ||
|
||
# We currently have some OS and config specific test failures. | ||
if [[ "$OS" == "Linux" ]]; then | ||
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then | ||
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|cpu-primitives-matmul-cpp" | ||
SKIPPED_TEST_FAILURES+="|test_convolution_backward_weights_f32" | ||
SKIPPED_TEST_FAILURES+="|test_matmul" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_conv_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_deconv_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_matmul_smoke_cpu" | ||
elif [[ "$CMAKE_BUILD_TYPE" == "Release" ]]; then | ||
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu" | ||
fi | ||
elif [[ "$OS" == "Darwin" ]]; then | ||
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then | ||
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_ci_cpu" | ||
elif [[ "$CMAKE_BUILD_TYPE" == "Release" ]]; then | ||
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu" | ||
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_ci_cpu" | ||
fi | ||
fi | ||
|
||
if [[ "$OS" == "Darwin" ]]; then | ||
# Since macos does not build with OMP, we can use multiple ctest threads. | ||
CTEST_MP=$MP | ||
elif [[ "$OS" == "Linux" ]]; then | ||
if [[ "$ONEDNN_THREADING" == "OMP" ]]; then | ||
# OMP is already multi-threaded. Let's not oversubscribe. | ||
CTEST_MP=-j2 | ||
elif [[ "$ONEDNN_THREADING" == "SEQ" ]]; then | ||
CTEST_MP=$MP | ||
fi | ||
fi | ||
|
||
set -x | ||
ctest $CTEST_MP --no-tests=error --verbose --output-on-failure -E "$SKIPPED_TEST_FAILURES" | ||
set +x |
Oops, something went wrong.