Skip to content

Define NCCL_WIN_CFT_COUNTED in the bitcode nccl.h (#4526) - #4526

Open
MittalMakwana wants to merge 2 commits into
meta-pytorch:mainfrom
MittalMakwana:export-D126785321
Open

MittalMakwana wants to merge 2 commits into
meta-pytorch:mainfrom
MittalMakwana:export-D126785321

Conversation

@MittalMakwana

@MittalMakwana MittalMakwana commented Oct 21, 2026 •

Copy link
Copy Markdown

Summary:

The Triton device bitcode build compiles device_window.cu with clang against a minimal ir_include/nccl.h that stands in for the full NCCL host header. NCCLX 2.32's device headers read the NCCL_WIN_CFT_COUNTED window flag in ncclGetMultimemLeInfo(), which that minimal header did not define, so the bitcode failed to compile against 2.32 with use of undeclared identifier 'NCCL_WIN_CFT_COUNTED'.

  • Define NCCL_WIN_CFT_COUNTED with the value from NCCLX 2.32's nccl.h (0x08).
  • No effect on 2.30, whose device headers do not read any window flag.

Reviewed By: cppccppccppc

Differential Revision: D126785321

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 21, 2026
@meta-codesync

meta-codesync Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@MittalMakwana has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126785321.

MittalMakwana pushed a commit to MittalMakwana/torchcomms that referenced this pull request Oct 27, 2026
Summary:

The Triton device bitcode build compiles `device_window.cu` with clang against a minimal `ir_include/nccl.h` that stands in for the full NCCL host header. NCCLX 2.32's device headers read the `NCCL_WIN_CFT_COUNTED` window flag in `ncclGetMultimemLeInfo()`, which that minimal header did not define, so the bitcode failed to compile against 2.32 with `use of undeclared identifier 'NCCL_WIN_CFT_COUNTED'`.

- Define `NCCL_WIN_CFT_COUNTED` with the value from NCCLX 2.32's `nccl.h` (`0x08`).
- No effect on 2.30, whose device headers do not read any window flag.

Reviewed By: cppccppccppc

Differential Revision: D126785321
Summary:

The 2.32 make build of `libnccl.so` failed to link with undefined references to `meta::comms::colltracev2::*` (`CollTraceV2::instance`, `enabled`, `selected`, `newCollId`, `registerComm`, ...), called from `ncclx/meta/colltrace/CollTraceWrapper.cc` and `ctran/colltrace/CollTraceWrapper.cc`.

- Root cause: the 2.30 Makefile was moved onto the prebuilt `libcommsutils.so.1` / `libobservatory.so.1`, but the 2.32 Makefile still compiled its own subset of `comms/utils` (only `colltrace/v1`) and never linked `libcommsutils`. Once the shared colltrace wrappers started calling colltrace v2, which lives only in `libcommsutils`, the 2.32 link had nothing to resolve those symbols against.
- Fix: port the same change to 2.32. The Makefile no longer compiles any `comms/utils` source or builds `libobservatory`; `libnccl.so` links `-lobservatory -lcommsutils` from `COMMSUTILS_LIB_DIR` (default: the environment's lib dir), and the link rule names both libraries as prerequisites so a missing package fails with a message naming it. `build_ncclx.sh` is shared across versions and already provisions `COMMSUTILS_LIB_DIR`.
- One process now holds a single copy of the cvars table, trainer state and colltrace registries, shared with the MCCL plugin, as with 2.30.
- The `ncclx_trainer_context` extension links `libcommsutils` too, since `TrainerContext` lives there.

Reviewed By: cppccppccppc

Differential Revision: D126780535
Summary:

The Triton device bitcode build compiles `device_window.cu` with clang against a minimal `ir_include/nccl.h` that stands in for the full NCCL host header. NCCLX 2.32's device headers read the `NCCL_WIN_CFT_COUNTED` window flag in `ncclGetMultimemLeInfo()`, which that minimal header did not define, so the bitcode failed to compile against 2.32 with `use of undeclared identifier 'NCCL_WIN_CFT_COUNTED'`.

- Define `NCCL_WIN_CFT_COUNTED` with the value from NCCLX 2.32's `nccl.h` (`0x08`).
- No effect on 2.30, whose device headers do not read any window flag.

Reviewed By: cppccppccppc

Differential Revision: D126785321
@meta-codesync meta-codesync Bot changed the title Define NCCL_WIN_CFT_COUNTED in the bitcode nccl.h Define NCCL_WIN_CFT_COUNTED in the bitcode nccl.h (#4526) Oct 27, 2026

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants