Skip to content

nccl-ep: fix HT LSA barrier allocation for runtime CTA counts - #14

Open
EvanZhang118 wants to merge 1 commit into
NVIDIA:mainfrom
EvanZhang118:fix/ht-dynamic-lsa-barriers
Open

nccl-ep: fix HT LSA barrier allocation for runtime CTA counts#14
EvanZhang118 wants to merge 1 commit into
NVIDIA:mainfrom
EvanZhang118:fix/ht-dynamic-lsa-barriers

Conversation

@EvanZhang118

@EvanZhang118 EvanZhang118 commented Aug 27, 2026

Copy link
Copy Markdown

Problem

HT dispatch resolves its communication grid size at runtime from ncclEpGroupConfig_t::max_num_sms or NCCL_EP_COMM_SMS. Each dispatch CTA uses blockIdx.x as its LSA barrier session ID when the HT synchronization
guard is enabled.

The DevComm requirements instead allocate a fixed NCCL_EP_HT_DISPATCH_BLOCKS + 1 sessions, which is 17 with the default configuration. A runtime grid larger than 16 CTAs therefore addresses LSA barrier sessions outside the allocated range and can hang. The combine-tail barrier also uses the default dispatch block count as its session ID rather than the JIT-specialized grid size.

Fix

  • Size lsaBarrierCount from the resolved communication SM count in both the LSA-only and cross-LSA DevComm creation paths.
  • Retain the existing default allocation floor for configurations that request fewer communication SMs.
  • Use the JIT-specialized NBLOCKS value for the combine-tail barrier session, keeping it disjoint from dispatch sessions [0, NBLOCKS).

No public API or default launch configuration changes.

HT dispatch accepts a runtime communication grid size through max_num_sms
and NCCL_EP_COMM_SMS. Each dispatch CTA uses blockIdx.x as its LSA barrier
session ID, but DevComm creation allocates only the fixed default count plus
one. Grids larger than the 16-CTA default can therefore access sessions
outside the allocated range and hang with the synchronization guard enabled.

Allocate barrier sessions from the resolved communication SM count in both
DevComm creation paths. Use the JIT-specialized block count for the combine
tail so its session remains disjoint from the dispatch CTA sessions.

Signed-off-by: Evan <91120837+EvanZhang118@users.noreply.github.com>
@EvanZhang118 EvanZhang118 changed the title nccl-ep: size HT LSA barriers for runtime CTA count nccl-ep: fix HT LSA barrier allocation for runtime CTA counts Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant