Repository navigation
fix(rccl): add weak stubs for ppc64le TOC-surviving symbols - #14913
Merged
Merged
Conversation
…ests On ppc64le, TOC references to extern symbols survive --gc-sections even when the code path referencing them is dead. Add weak stub definitions for topoPathTypeStr, network device-count functions, and GIN plugin functions so host-only test binaries link without GPU/network libraries. Co-Authored-By: Claude <noreply@anthropic.com>
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Contributor
There was a problem hiding this comment.
ARGUS
Findings
3 more finding(s), not posted inline
projects/rccl/test/host/fakes/nccl_fakes.cc:658(Low) #ifndef RCCL_NCCL_FAKES_OMIT_GRAPH excludes MicroGraph, the opposite of the description, and every other binary using topoPathTypeStr already links a strong copy, so this weak copy looks unused; drop it or name the target that needs it.projects/rccl/test/host/fakes/transport_stubs.cc:389(Low) The five extern "C" stubs (ncclNetIb_devices and the rest) name symbols nothing in projects/rccl references, topo.cc included; remove the block.projects/rccl/test/host/fakes/transport_stubs.cc:399(Low) Dev-count stubs return success with 0 devices in a fail-loud stub file (lines 7-11), and lines 394-397 exceed 120 columns; call FailLoudUnfaked instead.
Bottom line: Looks approval ready; the inline notes are small cleanups to the new ppc64le stubs.
Comment @argus review to re-run, or @argus re-review after pushing.
| // topo.cc stores ncclNetGetDevCount / ncclGinGetDevCount / etc. as function | ||
| // pointers in netInfo; the TOC entry survives --gc-sections on POWER even | ||
| // when the code path is dead. Weak stubs let MicroGraph (which links the | ||
| // real topo.cc but not graph_fakes.cc) resolve them. |
Contributor
There was a problem hiding this comment.
Low
Lines 390-393 restate the TOC note at lines 375-379, so they can go.
Suggested change
| // real topo.cc but not graph_fakes.cc) resolve them. |
mch
approved these changes
Nov 3, 2026
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of work for ROCm/TheRock#5518
Replaces #13502 which is now stale (upstream changes caused conflicts and a duplicate symbol).
On ppc64le, the POWER ABI's TOC (Table of Contents) keeps references to extern symbols alive through
--gc-sections, even when the code path referencing them is dead. This causes undefined-symbol link errors in host-only micro test binaries that link production source files (topo.cc, rome_models.cc) but not the GPU/network libraries that provide the symbols.Technical Details
Add weak stub definitions guarded by
__powerpc64__/__PPC64__in two test fake files:nccl_fakes.cc:topoPathTypeStr[](referenced by rome_models.cc). Guarded byRCCL_NCCL_FAKES_OMIT_GRAPHso it only applies when the graph fakes are excluded (e.g.rccl-UnitTestsMicroGraph).transport_stubs.cc: Plugin device-count and network functions referenced as function pointers in topo.cc:ncclNetIb_devices,ncclNetGdrCopy_devices,ncclNetSocket_devicesncclGinDeviceCount,ncclGinCustomAllReduceDeviceCountncclNetGetDevCount,ncclCollNetGetDevCount,ncclGinGetDevCount,ncclRmaGetDevCountncclNetSetVirtDevCount,ncclCollNetSetVirtDevCountAll stubs use
__attribute__((weak))so tests that supply their own strong definitions (e.g.gin-plugin-init-test,graph_fakes.cc) win without duplicate-symbol errors.x86_64 builds are unaffected — the
#if defined(__powerpc64__)guard ensures the stubs are only compiled on POWER.Test Plan
Built RCCL on a POWER10 ppc64le machine via TheRock. Ran the host microtest suites (
ctest -R "Micro|HostOnly|MicroTopo").Test Result
All micro test binaries link and run. 137/153 ctest targets pass. Remaining failures are pre-existing and unrelated (divide-by-zero death test on POWER, groupJob logic bug).