Skip to content

feat(ci): separate CI and release ASAN build configs for debug info control - #7511

Open
nunnikri wants to merge 2 commits into
mainfrom
users/nunnikri/asan-no-debug-ci
Open

feat(ci): separate CI and release ASAN build configs for debug info control#7511
nunnikri wants to merge 2 commits into
mainfrom
users/nunnikri/asan-no-debug-ci

Conversation

@nunnikri

@nunnikri nunnikri commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Separate ASAN build configurations into CI (no debug info) and
release/nightly (with debug info) variants to reduce binary size for
CI builds while preserving debuggable symbols for nightly releases.

ISSUE ID : 6631

Motivation

ASAN instrumentation already bloats binary size 3-5x due to shadow memory
checks. Combined with debug symbols, an ASAN-instrumented rocBLAS library
was ~350MB, dropping to ~50MB after stripping. For CI builds (pull_request,
workflow_dispatch from rocm-systems/rocm-libraries), debug info is
unnecessary — the goal is simply catching bugs. For rockrel nightly/release
builds, -g1 is needed so that ASAN stack traces include source line
numbers for user investigation.

Technical Details

cmake/therock_sanitizers.cmake
Removed -g from the sanitizer CMAKE_CXX/C_FLAGS_INIT stanza for both
HOST_ASAN and ASAN. Debug info is now controlled exclusively by the
CMake preset, eliminating the redundant (and previously overridden) flag.

CMakePresets.json

  • linux-release-asan / linux-release-host-asan (modified):
    CMAKE_BUILD_TYPE changed from RelWithDebInfo to Release. Debug
    flags (-g1 -gdwarf-4) removed. Used for CI ASAN builds — smaller
    binaries, faster builds.
  • linux-release-asan-debug / linux-release-host-asan-debug (new):
    RelWithDebInfo + -g1 -gdwarf-4. Used for rockrel nightly/release
    builds where stack traces need source line info.

build_tools/github_actions/amdgpu_family_matrix.py
Added asan-debug and host-asan-debug build variants pointing to the
new debug presets.

.github/workflows/multi_arch_release_asan.yml
Changed build_variant: "asan"build_variant: "asan-debug" so that
rockrel nightly/release builds use RelWithDebInfo with -g1.

Impact on normal builds: Zero. All changes are scoped to ASAN presets
and the THEROCK_SANITIZER code path which is never active in normal
Release or RelWithDebInfo builds.

Build path Preset CMAKE_BUILD_TYPE Debug flags
CI ASAN (rocm-systems/libraries PR) linux-release-asan Release none
CI host-ASAN (PR) linux-release-host-asan Release none
Nightly/release ASAN (rockrel) linux-release-asan-debug RelWithDebInfo -g1 -gdwarf-4
Nightly/release host-ASAN linux-release-host-asan-debug RelWithDebInfo -g1 -gdwarf-4

Test Plan

  • Trigger ASAN CI from rocm-systems: verify build uses Release + no debug flags
  • Trigger rockrel nightly ASAN: verify build uses RelWithDebInfo + -g1 -gdwarf-4
  • Trigger normal release CI: verify no change in build flags

Test Results

Test asan run(No debug) : https://github.com/ROCm/TheRock/actions/runs/32318830419
Reference asan run(with -g1) : https://github.com/ROCm/TheRock/actions/runs/32316786022

Metric ASAN (no debug) ASAN (with -g1 debug)
Build time 5.5 hours 6.5 hours
Archive size (compressed) <4 GB 20 GB
Full size (decompressed) 15 GB 141 GB
Archive size increase baseline 5× larger
Decompressed size increase baseline 9.4× larger

… control

ASAN CI builds do not need debug info — they only need to catch bugs.
Removing -g reduces binary size significantly. ASAN release/nightly builds
need -g1 so stack traces include source line info for user investigation.

Changes:
- cmake/therock_sanitizers.cmake: remove -g from sanitizer INIT flags
  (debug info now controlled exclusively by the preset).
- CMakePresets.json:
  - linux-release-asan / linux-release-host-asan: switch to Release
    build type, remove all debug flags (for CI ASAN builds).
  - linux-release-asan-debug / linux-release-host-asan-debug (new):
    RelWithDebInfo + -g1 -gdwarf-4 (for nightly/release ASAN builds).
- build_tools/github_actions/amdgpu_family_matrix.py: add asan-debug
  and host-asan-debug variants pointing to the new debug presets.
- .github/workflows/multi_arch_release_asan.yml: switch to asan-debug
  so nightly/release builds use RelWithDebInfo + -g1.

Normal release and RelWithDebInfo builds are unaffected.
@therock-pr-bot

therock-pr-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: build_tools/github_actions/amdgpu_family_matrix.py; no test file found
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled
🤖 therock-pr-bot ✅ Pass

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot therock-pr-bot Bot added the Not ready to Review PR has unresolved policy failures — reviews blocked label Aug 20, 2026
@therock-pr-bot

therock-pr-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@nunnikri
nunnikri requested a review from raramakr August 20, 2026 00:39
@nunnikri nunnikri changed the title feat(asan): separate CI and release ASAN build configs for debug info control feat(ci): separate CI and release ASAN build configs for debug info control Aug 20, 2026
@therock-pr-bot therock-pr-bot Bot removed the Not ready to Review PR has unresolved policy failures — reviews blocked label Aug 20, 2026
@nunnikri nunnikri added ci:asan Opt-in to building ASAN ci:host-asan Opt-in to running multi-arch host-asan CI on a pull request labels Aug 20, 2026
@nunnikri

Copy link
Copy Markdown
Contributor Author

The ci build is showing even better build time. https://github.com/ROCm/TheRock/actions/runs/32383947983/job/96535471079?pr=7511
Build time 1 arch(gfx94X) - 3:35h
Archive size (compressed) : 3.75GB
Archive size (uncompressed) : 15GB

@sa-faizal

@nunnikri nunnikri removed the ci:asan Opt-in to building ASAN label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:host-asan Opt-in to running multi-arch host-asan CI on a pull request

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

1 participant