Skip to content

Commit

Permalink
change scheduler to ONEDNN_THREADING
Browse files Browse the repository at this point in the history
Change-Id: I8789154698a44c123ff186624240570185187978
  • Loading branch information
taoye9 committed Oct 16, 2024
1 parent d5ead02 commit c896db4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
20 changes: 13 additions & 7 deletions .github/automation/build_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ install_eigen() {

mkdir -p eigen-build && cd eigen-build

echo "EIGEN_INSTALL_PATH: ${EIGEN_INSTALL_PATH}"
echo "EIGEN_PATH: $EIGEN_PATH"
if ! cmake -DCMAKE_INSTALL_PREFIX="${EIGEN_INSTALL_PATH}" "$EIGEN_PATH"; then
echo "Error: CMake configuration failed."
return 1
Expand All @@ -66,6 +68,8 @@ source ${SCRIPT_DIR}/common_aarch64.sh
export ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"}

CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"}
ONEDNN_THREADING=${ONEDNN_THREADING:-"SEQ"}

ONEDNN_TEST_SET=SMOKE

# ACL is not built with OMP on macOS.
Expand All @@ -82,23 +86,25 @@ CMAKE_OPTIONS="-Bbuild -S. \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
"

if [[ "$SCHEDULER" == 'TP' ]]; then
if [[ "$ONEDNN_THREADING" == 'TP' ]]; then
# install eigen
export EIGEN_INSTALL_PATH=${EIGEN_INSTALL_PATH:-"$PWD"}
export EIGEN_PATH=${EIGEN_PATH:-"$PWD/eigen"}
export EIGEN_INSTALL_PATH="$WORKSPACE/eigen-build"
export EIGEN_PATH="${WORKSPACE}/eigen"
install_eigen

CMAKE_OPTIONS="${CMAKE_OPTIONS} -DDNNL_CPU_RUNTIME=THREADPOOL \
-D_DNNL_TEST_THREADPOOL_IMPL=EIGEN -DEigen3_DIR=${EIGEN_INSTALL_PATH}/share/eigen3/cmake"
elif [[ "$SCHEDULER" == "OMP" ] || [ "$SCHEDULER" == "SEQ" ]]; then
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DDNNL_CPU_RUNTIME=OMP"
elif [[ "$ONEDNN_THREADING" == "OMP" || "$ONEDNN_THREADING" == "SEQ" ]]; then
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DDNNL_CPU_RUNTIME=${ONEDNN_THREADING}"
else
echo "Only OMP, TP, SEQ schedulers supported, $SCHEDULER requested"
echo "Only OMP, TP, SEQ schedulers supported, $ONEDNN_THREADING requested"
exit 1
fi

echo "eigen tasks completed."
echo "compile oneDNN......"
set -x
cd $WORKSPACE
cmake ${CMAKE_OPTIONS}

cmake --build build $MP
set +x
11 changes: 6 additions & 5 deletions .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
id: cache-acl-restore
uses: actions/cache/restore@v4
with:
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.toolset }}-${{ matrix.config }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.toolset }}-${{ matrix.config }}-SEQ-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
path: ${{ github.workspace }}/ComputeLibrary/build

- name: Build ACL
Expand All @@ -87,6 +87,7 @@ jobs:
BUILD_TOOLSET: ${{ matrix.toolset }}
ACL_CONFIG: ${{ matrix.config }}
GCC_VERSION: 13
ACL_THREADING: SEQ

- name: Save ACL in cache
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
Expand All @@ -103,7 +104,8 @@ jobs:
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 14
GCC_VERSION: 13
WORKSPACE: ${{ github.workspace }}/oneDNN

- name: Run oneDNN smoke tests
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
Expand All @@ -114,7 +116,7 @@ jobs:

# We only run the linux aarch64 runners if macOS smoke tests pass.
linux:
needs: macos
# needs: macos
strategy:
matrix:
toolset: [clang, gcc]
Expand Down Expand Up @@ -213,8 +215,7 @@ jobs:
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 13
ONEDNN_THREADING: ${{ matrix.threading }}
EIGEN_INSTALL_PATH: ${{ github.workspace }}
SCHEDULER: ${{ matrix.threading }}
WORKSPACE: ${{ github.workspace }}/oneDNN

- name: Run oneDNN tests
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
Expand Down

0 comments on commit c896db4

Please sign in to comment.