Skip to content

fix(rccl): [ppc64le] Fix test build break - #11460

Merged
benrichard-amd merged 1 commit into
developfrom
benrichard-amd/rccl-nettransport-stub
Sep 18, 2026
Merged

benrichard-amd merged 1 commit into
developfrom
benrichard-amd/rccl-nettransport-stub

Conversation

@benrichard-amd

Copy link
Copy Markdown
Contributor

Motivation

Part of ROCm/TheRock#5518

Tests were failing to build on ppc64le architecture because of how dead code that is pruned on x86, is not pruned on ppc64le.

Technical Details

The MicroEnqueue host test (#10861) compiles enqueue.cc against stub implementations. enqueue.cc references the global netTransport (defined in src/transport/net.cc) but the test does not link against net.cc. The code path that uses netTransport is unreachable, so on x86 --gc-sections eliminates the reference and linking succeeds.

On ppc64le, the ELFv2 ABI uses a TOC (Table of Contents) for global variable access. The compiler emits a TOC entry for netTransport at compile time, and this TOC entry creates a hard symbol reference that survives --gc-sections — the linker can discard the code section but not the TOC relocation. This causes:

ld.lld: error: undefined symbol: netTransport
>>> referenced by enqueue-test.cc
>>>               test/host/CMakeFiles/rccl-UnitTestsMicroEnqueue.dir/enqueue-test.cc.o:(.toc+0x28)

The fix adds a zero-initialized definition of netTransport in transport_stubs.cc. It is never called — it only satisfies the TOC reference.

Issue Tracking

Test plan

  • Full TheRock ppc64le build succeeds with this patch applied
  • No impact on x86 builds (the stub is benign — netTransport was already undefined and GC'd)

Submission Checklist

@benrichard-amd
benrichard-amd requested review from a team September 10, 2026 18:22
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

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: projects/rccl/test/host/fakes/transport_stubs.cc; no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

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

🙋 Wish to Override Policy?

@mch
mch requested a review from pvallem September 10, 2026 18:48

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

Findings

1 finding(s) that fall outside the diff and could not be anchored to a line
  • projects/rccl/test/host/CMakeLists.txt:271 (Low) Comment at CMakeLists.txt:267-276 now misdescribes netTransport

Bottom line: LGTM once #include "transport.h" moves up to the file's existing include block. That's mechanical, so it doesn't need another pass from me.

Comment @argus review to re-run, or @argus re-review after pushing.

@benrichard-amd

Copy link
Copy Markdown
Contributor Author

Hi @pvallem we need 1 more review in order to merge this. Thanks!

On ppc64le, the TOC (Table of Contents) entry for netTransport survives
--gc-sections even though the code section referencing it is dead. This
causes an undefined symbol error at link time for the MicroEnqueue host
test. Add a zero-initialized stub definition so the symbol resolves.

The x86 build is unaffected because its relocation model allows
--gc-sections to eliminate the reference entirely.
@benrichard-amd
benrichard-amd force-pushed the benrichard-amd/rccl-nettransport-stub branch from 23a0c62 to 079a1e9 Compare September 18, 2026 14:49

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

Findings

1 finding(s) that could not be posted as inline comments
  • projects/rccl/test/host/CMakeLists.txt:384 (Low) Defining netTransport makes the undefined-symbol inventory comment in test/host/CMakeLists.txt stale, including three hard counts and the recount recipe below them Defining netTransport makes the undefined-symbol inventory in projects/rccl/test/host/CMakeLists.txt stale, and the recount recipe at lines 392-393 of that file will now report a number the comment contradicts: ''' line 382 "leaves 34 undefined" -> 33 line 383 "33 ordinary externals" -> 32 line 384 drop netTransport from the named symbols line 388 "All 34 that remain" -> 33 ''' The standalone block needs no edit, since line 966 of that file only cross-references this one.

Bottom line: LGTM once the symbol inventory in test/host/CMakeLists.txt drops netTransport and its three counts come down by one. That one is mechanical, so it does not need another pass from me.

Comment @argus review to re-run, or @argus re-review after pushing.

@benrichard-amd
benrichard-amd merged commit 39cc764 into develop Sep 18, 2026
42 of 47 checks passed
@benrichard-amd
benrichard-amd deleted the benrichard-amd/rccl-nettransport-stub branch September 18, 2026 17:27
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants