perf(rccl): don't emit line tables for device code #16723
<!-- 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.
<!-- therock-pr-bot-fix-policies -->
🎉 All checks passed! This PR is ready for review.
<!-- 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:
-gline-tables-only flag while preserving explicitly forwarded debug options.-g.| 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>
<!-- 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 gfx942gfx942 all_gather any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured archgfx942 reduce_scatter any/any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured archgfx950 all_reduce any/any, 1 node(s), 1 KiB to 4 GiB: kernels recompiled without line tables; only gfx90a measuredgfx950 all_gather any, 1 node(s), 1 KiB to 4 GiB: same codegen change, unmeasured archgfx1250 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, unmeasuredgfx90a 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>
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16723-oci-rccl-pr-smoke
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.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16723-ruby64-rccl-pr-smoke
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.
LGTM. I guess we can readd this if it's necessary.
alex-breslow-amd
lfmeadow
Motivation
The device linker compiles every specialized kernel as its own compile unit and
added
-gline-tables-onlyto each of those compiles. Line tables and the DWARFthat goes with them were about a third of the device image, the largest single
source of size in it.
Technical Details
device_compile_cmdintools/rccl-device-compileno longer adds-gline-tables-only. Debug information now comes only fromDL_OPT_FLAGS:Debug builds still get
-g, coverage builds still get-g0, and every otherbuild type gets none.
DUMP_ASMand thedevice_irtarget still add-gline-tables-only, sincetheir 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
develop(52cc98a5a18) and of this branch, withTheRock nightly 10.3.0a20261028; compare the gfx90a code object.
test_runnerunit tests.rccl-UnitTestscollectives 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 |.textis 71 KB smaller. ROCm's clang adds-mllvm -amdgpu-spill-cfi-saved-regsto any AMDGPU compile that emits DWARF, including
-gline-tables-only, so everynon-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.rccl-UnitTestsfiltered to AllReduce, AllGather, ReduceScatter,Broadcast, Reduce, AllToAll and SendRecv: 93 passed, 15 skipped (they need
more GPUs or gfx1250).
Submission Checklist