← Back to Pull requests

fix(tensilelite): supply a FindNUMA module so find_package(hsakmt) resolves #11450

Closed
unknown closed this pull request without merging on Aug 31, 2026 03:07 UTC
View on GitHub
unknown unknown commented on Aug 28, 2026 21:36 UTC
Author

JIRA ID : N/A (upstream defect tracked as ROCM-21395 in rocm-systems)

Targets users/yiding12/gemm-a2a (the source branch for #10925), not develop — this unblocks the 2gfx950 preliminary-screening stage on that PR.

Motivation

The 2gfx950 preliminary-screening stage fails at configure time:

CMake Error at CMakeFindDependencyMacro.cmake:93 (find_package):
  By not providing "FindNUMA.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "NUMA", but
  CMake did not find one.
Call Stack (most recent call first):
  /opt/rocm/lib/cmake/hsakmt/hsakmt-config.cmake:34 (find_dependency)
  tensilelite/client/CMakeLists.txt:73 (find_package)

That stage routes to the new tox -e comm env, which is the only config that builds with -DTENSILELITE_ENABLE_SDMA=ON and therefore the only one that reaches find_package(hsakmt).

This is not a missing libnuma. libnuma-dev is installed on the ubuntu24-therock image (dockerfile-mci-stg0-ubu24 lines 40-41), and the block this PR replaces located it successfully — its libnuma not found FATAL_ERROR never fired, and configure got as far as line 73.

What is missing is a NUMA package config. rocm-systems 0adba114d0e2 (2026-07-21) added a bare find_dependency(NUMA) to hsakmt-config.cmake.in, but nothing installs a NUMAConfig.cmake or FindNUMA.cmake for it to find:

  • libnuma-dev ships only numa.h / libnuma.so / numa.pc — no CMake file

  • CMake has no builtin FindNUMA

  • libhsakmt has its own FindNUMA.cmake but never installs it
  • So find_package(hsakmt) is broken for every consumer on such a build, and searching harder for libnuma.so cannot fix it.

    Technical Details

    Move the libnuma lookup out of client/CMakeLists.txt into cmake/FindNUMA.cmake, and put that directory on CMAKE_MODULE_PATH before find_package(hsakmt) so hsakmt's internal find_dependency resolves in module mode:

    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake")
    find_package(NUMA REQUIRED)
    

    The module preserves the existing preference for the ROCm-vendored libnuma under lib/rocm_sysdeps over a system one, so hsakmt and the client still agree on a single libnuma, and it now creates numa::numa in one place instead of two. Net: client/CMakeLists.txt loses 37 lines and gains 15.

    Upstream fixed the defect in 4d81cbd3496f (ROCM-21395, 2026-07-29) by forcing CONFIG mode against the bundled config under lib/rocm_sysdeps. CONFIG mode does not consult CMAKE_MODULE_PATH, so a ROCm built from that commit or later ignores this module entirely — both paths keep working. The CI image's TheRock pin currently sits in the ~8-day window between the regression and the fix.

    This module can be deleted once every ROCm we build against postdates 4d81cbd3496f.

    Test Plan

    Verified locally against fakes of both hsakmt config variants, since neither is reproducible on a stock ROCm install:

    1. Pre-fix hsakmt (bare find_dependency(NUMA)) + this module
    2. Control: same project with the module removed from CMAKE_MODULE_PATH
    3. Vendored libnuma present under lib/rocm_sysdeps — must win over the system copy
    4. Post-fix hsakmt (find_dependency(NUMA CONFIG PATHS .../lib/rocm_sysdeps)) — forward-compat

    Test Result

    1. Configures cleanly; numa::numa -> /usr/lib/x86_64-linux-gnu/libnuma.so; hsakmt config loads with NUMA_FOUND=TRUE. Re-entrancy holds — find_dependency re-runs the module without a duplicate-target error.
    2. Reproduces the CI error verbatim, confirming the module is what fixes it.
    3. numa::numa -> .../rocm_sysdeps/lib/libnuma.so, includes from .../rocm_sysdeps/include. Vendored wins.
    4. Resolves through the vendored NUMAConfig.cmake; our module correctly ignored. No conflict.

    Not yet exercised on real CI hardware — that is what merging this into #10925 will do.

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
  • Risk level

    Low. Entirely inside if(TENSILELITE_ENABLE_SDMA AND NOT WIN32), which is OFF by default, so no existing build configuration changes behaviour. The only consumer is the new tox -e comm env, which is broken today.

    Note for reviewers

    cmake/FindNUMA.cmake is force-added past the blanket *.cmake rule in projects/hipblaslt/.gitignore:51, matching how the two sibling modules in that directory are already tracked. .gitignore does not affect the file now that it is committed.

    Diff: 570 lines (+427 / -143) across 7 files Reviewer: DDEle Review duration: 3211m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 570 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.380
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11450"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.8% (MEDIUM) · Higher = larger blast radius
    49.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%