← Back to Pull requests

perf(rccl): don't emit line tables for device code #16723

Open
lfmeadow opened this pull request with 25 lines diff across 3 files
View on GitHub
lfmeadow lfmeadow commented on Nov 24, 2026 20:03 UTC
Author

Motivation

The device linker compiles every specialized kernel as its own compile unit and
added -gline-tables-only to each of those compiles. Line tables and the DWARF
that goes with them were about a third of the device image, the largest single
source of size in it.

Technical Details

device_compile_cmd in tools/rccl-device-compile no longer adds
-gline-tables-only. Debug information now comes only from DL_OPT_FLAGS:
Debug builds still get -g, coverage builds still get -g0, and every other
build type gets none.

DUMP_ASM and the device_ir target still add -gline-tables-only, since
their output is meant to be read against the source.

This is one part of #16304, split out to land on its own.

Issue Tracking

No ticket. Follow-up to #14896.

Test Plan

  • Clean gfx90a builds of develop (52cc98a5a18) and of this branch, with

  • TheRock nightly 10.3.0a20261028; compare the gfx90a code object.
  • test_runner unit tests.

  • rccl-UnitTests collectives and send/receive on an MI210.
  • Test Result

    | | develop | this PR |
    |---|---:|---:|
    | librccl.so | 21.4 MB | 16.3 MB |
    | .hip_fatbin (compressed) | 13.0 MB | 8.0 MB |
    | gfx90a code object | 220.6 MB | 151.5 MB |
    | DWARF sections | 68.1 MB | 0 |
    | .text | 145.0 MB | 144.9 MB |

    .text is 71 KB smaller. ROCm's clang adds -mllvm -amdgpu-spill-cfi-saved-regs
    to any AMDGPU compile that emits DWARF, including -gline-tables-only, so every
    non-kernel function's prologue saved EXEC to two VGPR lanes for the unwinder.
    Without line tables those saves, and in a few functions the extra SGPR spills they
    caused, are gone. Debug builds still get them.

  • test_runner: 176 tests pass.

  • MI210, rccl-UnitTests filtered to AllReduce, AllGather, ReduceScatter,

  • Broadcast, Reduce, AllToAll and SendRecv: 93 passed, 15 skipped (they need
    more GPUs or gfx1250).

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
  • Diff: 25 lines (+12 / -13) across 3 files Reviewer: alex-breslow-amd Review duration: 15123m
    All Vouch review confidence checks passed
    Residual risk 0.02 = Change Risk (0.25) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.25 · 25 lines diff across 3 files
    0.25
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.90 · 4 substantive comment(s)
    0.90
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    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.195
    Real PR Conversation Timeline
    8 items
    therock-pr-bot[bot] therock-pr-bot[bot] commented on Nov 24, 2026 20:04 UTC
    Bot

    <!-- therock-pr-bot-policy-check -->

    ✅ All Checks Passed — Ready for Review

    | Check | Status | Details |
    |---|:---:|---|
    | 📝 PR Description | ✅ Pass | — |
    | ⛔ Forbidden Files | ✅ Pass | — |
    | 🧪 Unit Test | ✅ Pass | PR does not contain code files — Unit Test auto-passed |
    | 🔎 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[bot] therock-pr-bot[bot] commented on Nov 24, 2026 20:04 UTC
    Bot

    <!-- therock-pr-bot-fix-policies -->
    🎉 All checks passed! This PR is ready for review.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 24, 2026 20:05 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    The review records no outstanding issues with the device-compilation debug-information cleanup.

    No open issues 🎉

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    This PR reduces RCCL’s device-linker image size by removing automatic source-line debug information from device compilation, splitting out one part of the broader image-size cleanup.

    Changes:

  • Removes the unconditional -gline-tables-only flag while preserving explicitly forwarded debug options.

  • Updates command-generation tests to check that Release adds no debug flags and Debug retains -g.

  • Adds a changelog entry documenting the size reduction and source-line information tradeoff.
  • | File | Description |
    | ---- | ----------- |
    | projects/​rccl/​tools/​scripts/​test_runner/​tests/​test_device_compile.py | Updates assertions for Release and Debug flag handling. |
    | projects/​rccl/​tools/​rccl-device-compile | Removes default line-table generation from device compile commands. |
    | projects/​rccl/​changelog.d/​device-no-line-tables.changed.md | Documents the smaller library and changed debug-information behavior. |
    </details>

    <sub>Review effort: Balanced</sub>

    amd-argus[bot] amd-argus[bot] commented on Nov 24, 2026 20:10 UTC
    Reviewer

    <!-- argus:v1 pr=16723 sha=369f9a82980f mode=review -->

    ARGUS

    Findings

    <details>
    <summary>1 more finding(s), not posted inline</summary>

  • projects/rccl/cmake/DeviceLinker.cmake:180 (Low) RelWithDebInfo device code now gets no line info, since only the Debug branch of DL_OPT_FLAGS adds -g; add a RelWithDebInfo branch or confirm Debug-only is intended. With CMAKE_BUILD_TYPE=RelWithDebInfo (host gets -O3 -g at CMakeLists.txt:335), MATCHES "Debug" does not match, so device code takes the bare -O3 at line 183 and loses the line tables it had before this PR; could we add a RelWithDebInfo branch with -O3 -gline-tables-only, or is Debug-only intended?
  • </details>

    Impact

    <details>
    <summary>Reaches gfx906, gfx908, gfx90a, gfx942, gfx950, gfx1030, gfx1100, gfx1101, gfx1102, gfx1151, gfx1200, gfx1201, gfx1250; the PR targets gfx90a; 4 test(s) to run, 7 heatmap cell(s) to measure</summary>

    Release and RelWithDebInfo builds with the device linker on (the default) now compile every specialized kernel and the dispatcher with no line tables, on every arch in GPU_TARGETS. That reaches every collective, algorithm, protocol, size and node count through the dispatcher's aggregated register and scratch envelope (rccl-device-compile:209 and 714). Debug and coverage builds keep their own -g / -g0, and DUMP_ASM and device_ir still add -gline-tables-only. Only the gfx90a code size and gfx90a correctness were checked. No perf run was done. Reaches gfx906, gfx908, gfx90a, gfx942, gfx950, gfx1030, gfx1100, gfx1101, gfx1102, gfx1151, gfx1200, gfx1201, gfx1250; the PR targets gfx90a.

    Tests that exercise this change

  • rccl-UnitTests quick, AllReduce.InPlace: smoke launch through the rebuilt dispatcher and kernels at 8 GPUs (projects/rccl/test/test_categories.yaml)

  • rccl-UnitTests quick, AllGather.OutOfPlace: second collective family through the same recompiled dispatcher (projects/rccl/test/test_categories.yaml)

  • rccl-UnitTests quick, ReduceScatter.InPlace: reduction kernels whose register use may shift with codegen (projects/rccl/test/test_categories.yaml)

  • rccl-UnitTests standard, AllReduce.*: broad check of every recompiled all_reduce kernel variant (projects/rccl/test/test_categories.yaml)
  • Heatmap cells to measure, baseline against this PR, interleaved A/B

  • gfx942 all_reduce any/any, 1 node(s), 1 KiB to 4 GiB: kernels recompiled without line tables; dispatcher occupancy envelope not measured on gfx942

  • gfx942 all_gather any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured arch

  • gfx942 reduce_scatter any/any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured arch

  • gfx950 all_reduce any/any, 1 node(s), 1 KiB to 4 GiB: kernels recompiled without line tables; only gfx90a measured

  • gfx950 all_gather any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured arch

  • gfx1250 all_reduce any/any, 2 node(s), 1 KiB to 4 GiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): same codegen change on gfx1250, unmeasured

  • gfx90a all_reduce any/any, 1 node(s), 1 KiB to 4 GiB (no heatmap baseline on this arch): only size and correctness were checked on gfx90a, with no perf A/B even here
  • </details>

    Bottom line: LGTM.

    <sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 20:45 UTC
    Bot

    <!-- markdownlint-disable MD013 -->

    pr-rocm-systems-16723-oci-rccl-pr-smoke

    View this job on CoCo

    Builds

    All 15 components built.

    Failures

    No failing tests in this run.

    12 tests skipped.

    Performance regressions

    Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 10% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.

    pr-16723_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf

    Readings: flat 2070.

    Fails the run: 0 regressed point(s) past 10%, each confirmed by an adjacent size.

    No confirmed regressions or improvements.

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 20:45 UTC
    Bot

    <!-- markdownlint-disable MD013 -->

    pr-rocm-systems-16723-ruby64-rccl-pr-smoke

    View this job on CoCo

    Builds

    All 15 components built.

    Failures

    No failing tests in this run.

    12 tests skipped.

    Performance regressions

    Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 8% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.

    pr-16723_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf

    Readings: flat 2070.

    Fails the run: 0 regressed point(s) past 8%, each confirmed by an adjacent size.

    No confirmed regressions or improvements.

    alex-breslow-amd alex-breslow-amd approved these changes on Nov 24, 2026 22:35 UTC
    Approved Reviewer

    LGTM. I guess we can readd this if it's necessary.

    Assignees
    lfmeadow lfmeadow
    Labels
    risk: low confidence: 90.8% 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: 25.4% (LOW) · Higher = larger blast radius
    25.4%
    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: 90.8% · Lower = rushed or shallow review
    90.8%
    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: 2.3% · Safe to merge
    2.3%