Skip to content

fix(rccl): declare librocshmem.a as a byproduct of rocshmem_ext - #12331

Merged
alex-breslow-amd merged 1 commit into
developfrom
users/lmeadows/rocshmem-ninja-byproducts
Oct 21, 2026
Merged

alex-breslow-amd merged 1 commit into
developfrom
users/lmeadows/rocshmem-ninja-byproducts

Conversation

@lfmeadow

@lfmeadow lfmeadow commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : LCOMPILER-2794

A clean ./install.sh --ninja --rocshmem never starts:

ninja: error: '../../ext/rocshmem/lib/librocshmem.a', needed by 'librccl.so.1.0',
missing and no known rule to make it

src/CMakeLists.txt and test/CMakeLists.txt link the archive by absolute path, so ninja needs an edge that produces it. ExternalProject_Add declares no outputs without BUILD_BYPRODUCTS, and the existing add_dependencies(rccl rocshmem_ext) contributes only an order-only edge.

The per-arch librocshmem_device_*.bc files need no entry: they are passed as command arguments and sequenced by target dependencies on rocshmem_static.

Test

Clean builds that previously stopped at [0/2] now reach [4010/4010] and link librccl.so:

  • ./install.sh --ninja --rocshmem --amdgpu_targets gfx950
  • the same plus --address-sanitizer

@lfmeadow
lfmeadow requested review from a team and a lite review from Copilot September 27, 2026 03:53
@therock-pr-bot

therock-pr-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 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?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

This comment was marked as resolved.

@lfmeadow

Copy link
Copy Markdown
Contributor Author

@argus re-review

This comment was marked as resolved.

amd-argus[bot]

This comment was marked as outdated.

@lfmeadow
lfmeadow force-pushed the users/lmeadows/rocshmem-ninja-byproducts branch 2 times, most recently from 412aa55 to 26f4b25 Compare September 28, 2026 01:53

@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

Bottom line: Looks approval ready. The rocshmem_config.h byproduct asked for last round is in and matches its consumer exactly.

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

Comment thread projects/rccl/cmake/ROCSHMEM.cmake Resolved
@lfmeadow

Copy link
Copy Markdown
Contributor Author

@argus re-review

This comment was marked as resolved.

@amd-argus

This comment has been minimized.

@alex-breslow-amd alex-breslow-amd 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.

LGTM

lfmeadow added a commit that referenced this pull request Sep 29, 2026
JIRA ID : LCOMPILER-2794

`./install.sh -t --rocshmem` fails to link four host test binaries.
`init.cc` and `enqueue.cc` reach their `ENABLE_ROCSHMEM` arms, and
nothing in `fakes/` defines the ten symbols those arms call. Each fake
goes in the file named after the owning production TU;
`rocshmem_fakes.cc` is new and conditional, since it includes
`rocshmem.hpp`.

Pre-existing, but unreachable under ninja until #12331 let `--rocshmem`
start building.

## Test

- `-t --ninja --rocshmem --address-sanitizer`: 3197/3197, was 3 link
failures
- `-t --ninja`: 4366/4366, unchanged
@lfmeadow

lfmeadow commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@Kapil-Shyam-Pawar @corey-derochie-amd gentle ping when you have a moment: this is approved by alex-breslow-amd, Argus is LGTM, and there are no open threads. It needs one more RCCL-Reviewers approval to merge. (The RCCL PR gate is re-running after a Ruby smoke infra failure.) Thanks!

@lfmeadow
lfmeadow force-pushed the users/lmeadows/rocshmem-ninja-byproducts branch from 26f4b25 to 5c168a4 Compare October 19, 2026 19:39

@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

Bottom line: LGTM.

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

A clean --ninja --rocshmem or --rocshmem-gin build never starts. Ninja
validates the whole graph before running any step, and two files named by
absolute path have no edge producing them: librocshmem.a, linked by
src/CMakeLists.txt and test/CMakeLists.txt, and rocshmem_config.h, which the
GIN header copy takes as a DEPENDS. ExternalProject_Add declares no outputs
unless asked, and the existing add_dependencies() calls contribute only
order-only edges, which sequence the steps but do not say where the files come
from -- and the load-time error fires before those steps could run anyway.

The per-arch librocshmem_device_*.bc files need no entry: they are passed to
the device compiles as command arguments, never as file-level dependencies.

Verified from a tree with both build/ and ext/rocshmem removed, since
ext/rocshmem lives in the source tree and a leftover copy hides the bug:
  --ninja --rocshmem      4010/4010
  --ninja --rocshmem-gin  4051/4051
both previously stopped at [0/2].
@lfmeadow
lfmeadow force-pushed the users/lmeadows/rocshmem-ninja-byproducts branch from 5c168a4 to 13ca068 Compare October 21, 2026 19:30
@lfmeadow

Copy link
Copy Markdown
Contributor Author

@corey-derochie-amd @Kapil-Shyam-Pawar gentle ping when you have a moment. I've rebased this onto current develop. That picks up #13706, which fixes the topo_expl duplicate-symbol link failure behind the earlier math-ci red, so CI is re-running now. It's approved by alex-breslow-amd and has no open threads; it just needs one more RCCL-Reviewers approval. Thanks!

@alex-breslow-amd
alex-breslow-amd merged commit 527823b into develop Oct 21, 2026
31 of 37 checks passed
@alex-breslow-amd
alex-breslow-amd deleted the users/lmeadows/rocshmem-ninja-byproducts branch October 21, 2026 20:06
@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