From 96aa69713749ebbdccff2f9354819a800493d59d Mon Sep 17 00:00:00 2001 From: Robert Esclapez Garcia Date: Mon, 13 Jul 2026 02:06:29 -0700 Subject: [PATCH 1/2] ci(gfx11): bundle librocprofiler-sdk for roofline; add roofline input The per-op roofline profiler dlopens librocprofiler-sdk.so.1 at runtime (ggml-cuda-roofline.cpp), but the release only bundled librocprofiler-register.so, so the profiler silently no-op'd and wrote no artifact. Pack librocprofiler-sdk.so* plus its one bundle-missing dep librocm_sysdeps_dw.so.1 (libdw, a hard DT_NEEDED of the sdk lib); the existing $ORIGIN RPATH step lets the dlopen resolve both locally with no LD_LIBRARY_PATH. Add a `roofline` workflow_dispatch input (default true, preserving the prior always-on behavior) gating both -DGGML_HIP_ROOFLINE and the extra lib packing, so lean builds can opt out. Co-Authored-By: Claude Opus 4 (1M context) --- .github/workflows/build-gfx11-rocm.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-gfx11-rocm.yml b/.github/workflows/build-gfx11-rocm.yml index 6a811fffbd77..903719e1d015 100644 --- a/.github/workflows/build-gfx11-rocm.yml +++ b/.github/workflows/build-gfx11-rocm.yml @@ -15,6 +15,10 @@ on: description: 'Publish a dated GitHub Release (b) with the built binaries. Set true only for the nightly dispatch.' required: false default: 'false' + roofline: + description: 'Build with per-op roofline profiling support (GGML_HIP_ROOFLINE) and bundle the profiler libs (librocprofiler-sdk + libdw). Set false for lean builds.' + required: false + default: 'true' # Tracks the latest multiarch ROCm nightly (auto-detected). The earlier pin to # 7.14.0a20260608 worked around a libhsa-runtime64 regression (build 1b2a555677) @@ -28,6 +32,9 @@ on: env: ROCM_VERSION: ${{ github.event.inputs.rocm_version || 'latest' }} + # Default ON so push/PR/cron (non-dispatch) runs keep roofline, matching prior + # always-on behavior; a workflow_dispatch can pass 'false' for a lean build. + ROOFLINE: ${{ github.event.inputs.roofline || 'true' }} jobs: build-ubuntu: @@ -225,7 +232,7 @@ jobs: -DGGML_CUDA_FORCE_CUBLAS=OFF \ -DGGML_RPC=ON \ -DGGML_HIP_ROCWMMA_FATTN=OFF \ - -DGGML_HIP_ROOFLINE=ON \ + -DGGML_HIP_ROOFLINE=${{ env.ROOFLINE == 'true' && 'ON' || 'OFF' }} \ -DLLAMA_BUILD_BORINGSSL=ON \ -DGGML_NATIVE=OFF \ -DGGML_STATIC=OFF \ @@ -274,6 +281,14 @@ jobs: cp -v /opt/rocm/lib/libhipblaslt.so* "$build_bin_path/" 2>/dev/null || echo "libhipblaslt.so* not found" cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_liblzma.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_liblzma.so* not found" cp -v /opt/rocm/lib/librocprofiler-register.so* "$build_bin_path/" 2>/dev/null || echo "librocprofiler-register.so* not found" + # Roofline builds dlopen librocprofiler-sdk.so.1 at runtime (ggml-cuda-roofline.cpp); + # the release must ship it plus its one bundle-missing dep libdw + # (librocm_sysdeps_dw.so.1 — a hard DT_NEEDED of the sdk lib). The $ORIGIN RPATH + # step below lets the dlopen resolve both locally with no LD_LIBRARY_PATH. + if [ "${{ env.ROOFLINE }}" = "true" ]; then + cp -v /opt/rocm/lib/librocprofiler-sdk.so* "$build_bin_path/" 2>/dev/null || echo "librocprofiler-sdk.so* not found" + cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_dw.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_dw.so* not found" + fi cp -v /opt/rocm/lib/libamd_comgr.so* "$build_bin_path/" 2>/dev/null || echo "libamd_comgr.so* not found" cp -v /opt/rocm/lib/libamd_comgr_loader.so* "$build_bin_path/" 2>/dev/null || echo "libamd_comgr_loader.so* not found" cp -v /opt/rocm/lib/libhsa-runtime64.so* "$build_bin_path/" 2>/dev/null || echo "libhsa-runtime64.so* not found" From e9236fdc4593e9b6f9f102feb7675ee0e77c73d0 Mon Sep 17 00:00:00 2001 From: Robert Esclapez Garcia Date: Mon, 13 Jul 2026 03:07:24 -0700 Subject: [PATCH 2/2] ci(gfx11): drop stale gather_required_libs.py reference The comment pointed at utils/gather_required_libs.py to regenerate the ROCm lib copy list, but that script does not exist in the repo; the list is maintained by hand. Remove the dead reference. Co-Authored-By: Claude Opus 4 (1M context) --- .github/workflows/build-gfx11-rocm.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-gfx11-rocm.yml b/.github/workflows/build-gfx11-rocm.yml index 903719e1d015..ce91fa77fd87 100644 --- a/.github/workflows/build-gfx11-rocm.yml +++ b/.github/workflows/build-gfx11-rocm.yml @@ -270,8 +270,6 @@ jobs: # Copy required ROCm libraries to build directory # If artifacts from ROCm or Llama.cpp change, you may need to update this list. - # To regenerate the list, run: - # utils/gather_required_libs.py --rocm-dir /opt/rocm --dest-dir build/bin echo "Copying required ROCm libraries to build directory..." cp -v /opt/rocm/lib/libhipblas.so* "$build_bin_path/" 2>/dev/null || echo "libhipblas.so* not found" cp -v /opt/rocm/lib/librocblas.so* "$build_bin_path/" 2>/dev/null || echo "librocblas.so* not found"