Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flagcx/adaptor/flagcx_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,10 @@ flagcxResult_t flagcxDevCommCreate(flagcxComm_t comm,
if (ret == flagcxSuccess)
handle->devComm = innerDevComm;
}
if (handle->devComm != nullptr && handle->intraSize > 0) {
int nNodes = handle->nRanks / handle->intraSize;
handle->nInterPeers = nNodes - 1;
}
if (handle->devComm == nullptr) {
// ---- Fallback path: IPC barriers + inter-node signal relay + one-sided
// ----
Expand Down
40 changes: 19 additions & 21 deletions flagcx/adaptor/include/device_api/comm_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,48 @@ template <typename PlatformTag>
struct Fallback {};

// ============================================================
// Action types for one-sided operations (needed by traits Net types).
// Action types for one-sided operations (needed by traits Transport types).
// Pure POD structs with no device builtins.
// ============================================================
typedef uint32_t flagcxDevNetSignal_t;
typedef uint32_t flagcxDevNetCounter_t;
typedef uint32_t flagcxDevTransportSignal_t;
typedef uint32_t flagcxDevTransportCounter_t;

struct flagcxDevNet_None {};
struct flagcxDevNet_SignalInc {
flagcxDevNetSignal_t signal;
struct flagcxDevTransport_None {};
struct flagcxDevTransport_SignalInc {
flagcxDevTransportSignal_t signal;
};
struct flagcxDevNet_SignalAdd {
flagcxDevNetSignal_t signal;
struct flagcxDevTransport_SignalAdd {
flagcxDevTransportSignal_t signal;
uint64_t value;
};
struct flagcxDevNet_CounterInc {
flagcxDevNetCounter_t counter;
struct flagcxDevTransport_CounterInc {
flagcxDevTransportCounter_t counter;
};

// Shared memory descriptor for NIC descriptor optimization.
// Uses void* on all paths; vendor Net casts to native type in toNccl().
// Uses void* on all paths; vendor Transport casts to native type in toNccl().
struct flagcxDescriptorSmem {
void *_impl = nullptr;
};

struct flagcxDevNet_DescriptorSmem {
struct flagcxDevTransport_DescriptorSmem {
flagcxDescriptorSmem smem;
};

// Fence level enum — available on all tiers for unified barrier API
enum class flagcxGinFenceLevel { Relaxed };

// ============================================================
// Barrier tag types for DevBarrier<Backend, Tag> dispatch.
// Unified team/barrier tag types.
// Used as both DevBarrier<Backend, Tag> template parameter
// and as ctor dispatch tags — eliminating the old two-tag redundancy.
// ============================================================
struct flagcxBarrierIntra {};
struct flagcxBarrierInter {};
struct flagcxBarrierWorld {
struct World {}; // tag for world-barrier ctor
struct Intra {}; // tag for intra-only ctor
struct Inter {}; // tag for inter-only ctor
};
struct flagcxTeamTagIntra {};
struct flagcxTeamTagInter {};
struct flagcxTeamTagWorld {};

// Primary template — each backend provides specializations
template <typename Backend, typename BarrierTag, typename Coop>
template <typename Backend, typename Tag, typename Coop>
struct DevBarrier;

// Vendor specializations + DeviceAPI selection
Expand Down
Loading