Skip to content

Optimize the oneDNN matmul (brgemm) to close the gap with AMX intrinsics for DeepSeek R1 shapes MoE on GNR #11671

Optimize the oneDNN matmul (brgemm) to close the gap with AMX intrinsics for DeepSeek R1 shapes MoE on GNR

Optimize the oneDNN matmul (brgemm) to close the gap with AMX intrinsics for DeepSeek R1 shapes MoE on GNR #11671

Workflow file for this run

# *******************************************************************************
# Copyright 2025 Intel Corporation
# Copyright 2025-2026 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.
# *******************************************************************************
name: "Clang-Tidy"
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/automation/aarch64/**"
- ".github/automation/x64/**"
- ".github/workflows/clang-tidy.yml"
- "cmake/**"
- "examples/**"
- "include/**"
- "src/common/**"
- "src/cpu/*"
- "src/cpu/aarch64/**"
- "src/cpu/gemm/**"
- "src/cpu/matmul/**"
- "src/cpu/reorder/**"
- "src/cpu/rnn/**"
- "src/cpu/x64/**"
- "src/gpu/*"
- "src/gpu/intel/**"
- "src/graph/**"
- "tests/**"
- "CMakeLists.txt"
## Declare default permissions as read only.
permissions: read-all
# Kill stale checks
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
pr-clang-tidy:
strategy:
fail-fast: false
matrix:
config: [
{ arch: AArch64, compiler: clang, label: ubuntu-24.04-arm},
{ arch: x64, compiler: clang, label: ubuntu-24.04},
{ arch: x64, compiler: DPC++, label: ubuntu-24.04},
]
name: Clang-Tidy - ${{matrix.config.arch}} (${{matrix.config.compiler}})
runs-on: ${{matrix.config.label}}
steps:
- name: Checkout oneDNN
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
path: oneDNN
fetch-depth: 0
- if: ${{ matrix.config.compiler == 'clang' }}
name: Install clang
run: |
sudo apt-get update
sudo apt-get install -y clang libomp-dev ocl-icd-libopencl1 ocl-icd-opencl-dev clang-tidy
- if: ${{ matrix.config.compiler == 'DPC++' }}
name: Install DPC++
run: |
sudo apt update
sudo apt install -y gpg-agent wget
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-tbb-devel
# This needs to run on all platforms even if it is not used.
- name: Read ci.json versions file
id: get-versions
run: |
content=`cat ${{ github.workspace }}/oneDNN/.github/automation/aarch64/ci.json`
content="${content//[$'\t\r\n$ ']}"
echo "output=$content" >> $GITHUB_OUTPUT
- if: ${{ matrix.config.arch == 'AArch64' }}
name: Clone ACL
run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build_acl.sh
env:
ACL_ACTION: clone
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
# We can avoid having to actually build ComputeLibrary by faking the files
# that cmake/FindACL.cmake and cmake/ACL.cmake expect to see.
- if: ${{ matrix.config.arch == 'AArch64' }}
name: Fake ACL Build
working-directory: ${{ github.workspace }}/ComputeLibrary/
env:
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
run: |
mkdir ./build
echo "arm_compute_version=${ACL_VERSION}" > ./build/arm_compute_version.embed
touch ./build/libarm_compute.so
touch ./build/libarm_compute_graph.so
# Delete this since clang-tidy seems to get confused and read this
# external config
rm .clang-tidy
- if: ${{ matrix.config.arch == 'x64' }}
name: Configure oneDNN - x64
working-directory: ${{github.workspace}}/oneDNN
run: .github/automation/x64/build_linters.sh
env:
BUILD_TOOLSET: ${{matrix.config.compiler}}
ONEDNN_ACTION: configure
- if: ${{ matrix.config.arch == 'AArch64' }}
name: Configure oneDNN - AArch64
working-directory: ${{github.workspace}}/oneDNN
run: .github/automation/aarch64/build.sh
env:
BUILD_TOOLSET: ${{matrix.config.compiler}}
ACL_ROOT_DIR: ${{github.workspace}}/ComputeLibrary
ONEDNN_ACTION: configure
- name: Check source files
working-directory: ${{github.workspace}}/oneDNN
shell: bash
run: |
set +e
if [[ "${{matrix.config.compiler}}" == "DPC++" ]]; then
. /opt/intel/oneapi/setvars.sh
export PATH=$(dirname $(which icx))/compiler:$PATH
fi
echo -e "Checking Clang-Tidy $(clang-tidy --version)\n"
touch clang-tidy.log
analysis_list="$(git diff --name-only ${{ github.event.pull_request.base.sha }} | grep -E '\.c(pp|xx)?$')"
if [[ -z "$analysis_list" ]]; then
echo "No source files to check."
exit 0
else
printf "File list:\n$analysis_list\n"
run-clang-tidy -j $(nproc) -format -p ./build $analysis_list 2>&1 | tee -a clang-tidy.log
fi
grep -i -E "warning:|error:" clang-tidy.log | sort -u
grep -q -i -E "warning:|error:" clang-tidy.log && exit 1 || true