Skip to content

Initial version of test case for streamk with mxfp4 data type #3345

Initial version of test case for streamk with mxfp4 data type

Initial version of test case for streamk with mxfp4 data type #3345

Workflow file for this run

name: clang-tidy
on:
# Paths filtering is intentionally not used at the trigger level.
# - For pushes, dorny/paths-filter in the setup job determines which opted-in
# libraries changed (via each library's path_filters) and builds the matrix.
# - For PRs, the workflow must always run so the required check is registered
# for every PR; the clang-tidy job is skipped when no opted-in component is affected.
push:
branches:
- develop
- release/therock-*
pull_request:
workflow_dispatch:
concurrency:
# For PRs, group by PR number so a new commit cancels any in-progress run
# for the same PR. For postsubmits, group by commit SHA (unique per commit)
# so runs never cancel each other. The workflow name is prepended to avoid
# conflicts between different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
setup:
name: "Setup"
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
- name: Checkout rocm-libraries
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: .github
sparse-checkout-cone-mode: true
fetch-depth: 2
- name: Define opted-in libraries
id: lib-config
run: |
# To opt in a new library: add one jq -cn block to LIBS below, then:
# - Add an "Install deps (<name>)" step in the clang-tidy job if needed.
# - Add a "Run clang-tidy (<name>)" step in the clang-tidy job.
# Required fields: name, path_filters (array), checkout_paths (array)
# Optional fields: (all build config is handled in the per-library run step)
# path_filters controls which file changes trigger clang-tidy for this library;
# use specific globs rather than /** to avoid false triggers.
# NOTE: dorny/paths-filter uses picomatch where '?' means "any single char",
# NOT GitHub Actions' "zero or one of preceding char". Use explicit extensions.
# checkout_paths lists all repo paths needed for sparse checkout.
LIBS=()
# hipDNN
LIBS+=($(jq -cn '{
name: "hipdnn",
path_filters: [
"projects/hipdnn/**/*.{c,h,cpp,hpp,cxx,hxx}",
"projects/hipdnn/cmake/ClangTidy.cmake",
"projects/hipdnn/.clang-tidy"
],
checkout_paths: ["projects/hipdnn"]
}'))
# stinkytofu
LIBS+=($(jq -cn '{
name: "stinkytofu",
path_filters: [
"shared/stinkytofu/**/*.{c,h,cpp,hpp,cxx,hxx,def}",
"shared/stinkytofu/.clang-tidy",
"cmake/modules/ClangTidy.cmake",
"cmake/modules/CheckToolVersion.cmake"
],
checkout_paths: ["shared/stinkytofu", "cmake/modules"]
}'))
# Disabled: see https://github.com/ROCm/rocm-libraries/issues/5067
# LIBS+=($(jq -cn '{
# name: "miopen-provider",
# path_filters: [
# "dnn-providers/miopen-provider/**/*.{c,h,cpp,hpp,cxx,hxx}",
# "dnn-providers/miopen-provider/cmake/ClangTidy.cmake",
# "dnn-providers/miopen-provider/.clang-tidy"
# ],
# checkout_paths: ["dnn-providers/miopen-provider"]
# }'))
# Common filters applied to every library — changes here re-run all opted-in libraries.
COMMON_FILTERS='[".github/workflows/clang-tidy.yml"]'
printf '%s\n' "${LIBS[@]}" \
| jq -rs --argjson common "$COMMON_FILTERS" \
'.[] | "\(.name):\n" + ((.path_filters + $common) | map(" - \"\(.)\"") | join("\n")) + "\n"' \
> path-filters.yml
LIBS_JSON=$(printf '%s\n' "${LIBS[@]}" \
| jq -sc '[.[] | . + {checkout_paths_str: (.checkout_paths | join("\n"))}]')
echo "libs=${LIBS_JSON}" >> "$GITHUB_OUTPUT"
- name: Detect changed opted-in projects
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
filters: path-filters.yml
- name: Build job matrix
id: build-matrix
run: |
CHANGED='${{ steps.changes.outputs.changes }}'
LIBS='${{ steps.lib-config.outputs.libs }}'
IS_DISPATCH=${{ github.event_name == 'workflow_dispatch' }}
MATRIX=$(
echo "$LIBS" | jq -c \
--argjson changed "$CHANGED" \
--argjson dispatch "$IS_DISPATCH" \
'[.[] | select($dispatch or (.name as $n | $changed | index($n) != null))]
| {"include": .}'
)
echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT"
clang-tidy:
name: "clang-tidy (${{ matrix.name }})"
needs: setup
if: needs.setup.outputs.matrix != '{"include":[]}'
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
fail-fast: false
runs-on: azure-linux-scale-rocm
steps:
- name: Checkout rocm-libraries
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: ${{ matrix.checkout_paths_str }}
sparse-checkout-cone-mode: true
- name: Checkout TheRock
uses: actions/checkout@v6
with:
repository: ROCm/TheRock
path: TheRock
- name: Install base dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
ninja-build \
python3-venv \
python3-dev \
lsb-release wget \
software-properties-common \
gnupg
python3 -m venv .venv
. .venv/bin/activate
pip install boto3 cmake
pip install -r TheRock/requirements.txt
- name: Install ROCm
run: |
sudo .venv/bin/python3 TheRock/build_tools/install_rocm_from_artifacts.py \
--latest-release \
--amdgpu-family gfx94X-dcgpu \
--output-dir /opt/rocm \
--base-only
# Per-library optional dependency steps — only the matching step runs.
# Add a new step here when opting in a library that has custom deps.
- name: Install deps (hipDNN)
if: matrix.name == 'hipdnn'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
sudo apt-get update
sudo apt-get install -y \
clang-tidy-20 \
clang-tools-20
- name: Install deps (stinkytofu)
if: matrix.name == 'stinkytofu'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
sudo apt-get update
sudo apt-get install -y \
clang-tidy-20 \
clang-tools-20 \
libgtest-dev \
python3-dev
. .venv/bin/activate
pip install -r shared/stinkytofu/requirements.txt
# Disabled: see https://github.com/ROCm/rocm-libraries/issues/5067
# To re-enable: uncomment the LIBS entry above and these two steps.
# - name: Install deps (miopen-provider)
# if: matrix.name == 'miopen-provider'
# run: |
# wget https://apt.llvm.org/llvm.sh
# chmod +x llvm.sh
# sudo ./llvm.sh 20
# sudo apt-get update
# sudo apt-get install -y \
# clang-tidy-20 \
# clang-tools-20
# Per-library run steps — each library defines its own build and tidy sequence.
# Add a new step here when opting in a library.
- name: Run clang-tidy (hipDNN)
if: matrix.name == 'hipdnn'
run: |
. .venv/bin/activate
export PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:$PATH
export CXX=/opt/rocm/llvm/bin/clang++
cmake -S projects/hipdnn -B build-hipdnn -G Ninja \
-DENABLE_CLANG_TIDY=ON \
-DROCM_PATH=/opt/rocm \
-DCMAKE_PREFIX_PATH=/opt/rocm \
-DENABLE_CLANG_FORMAT=OFF \
-DHIP_PLATFORM=amd \
-DHIPDNN_BUILD_PYTHON_BINDINGS=ON
ninja -C build-hipdnn tidy
- name: Run clang-tidy (stinkytofu)
if: matrix.name == 'stinkytofu'
run: |
. .venv/bin/activate
export ROCM_PATH=/opt/rocm
cd shared/stinkytofu
invoke build
invoke tidy
# Disabled: see https://github.com/ROCm/rocm-libraries/issues/5067
# - name: Run clang-tidy (miopen-provider)
# if: matrix.name == 'miopen-provider'
# run: |
# . .venv/bin/activate
# export PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:$PATH
# export CXX=/opt/rocm/llvm/bin/clang++
# cmake -S dnn-providers/miopen-provider -B build-miopen-provider -G Ninja \
# -DENABLE_CLANG_TIDY=ON \
# -DROCM_PATH=/opt/rocm \
# -DCMAKE_PREFIX_PATH=/opt/rocm \
# -DENABLE_CLANG_FORMAT=OFF \
# -DHIP_PLATFORM=amd
# ninja -C build-miopen-provider tidy
clang_tidy_summary:
name: "clang-tidy summary"
if: always()
needs:
- setup
- clang-tidy
runs-on: ubuntu-24.04
steps:
- name: Output failed jobs
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi