Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 23 additions & 1 deletion src/cco/cco_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,29 @@ static hipMemAllocationType CcoWindowAllocType() {
const char* e = getenv("CCO_UNCACHED_WINDOW");
return e && atoi(e) == 0;
}();
return cached ? hipMemAllocationTypePinned : hipMemAllocationTypeUncached;
if (cached) return hipMemAllocationTypePinned;
// hipMemAllocationTypeUncached was added on 2025-09-11 (HIP_VERSION > 70051831).
// Guard the symbol so CCO still builds on older ROCm (e.g. 7.0.0); mirror the
// shmem path in symmetric_memory.cpp: use the raw value 0x40000000 on the
// 70051831 build where the symbol may be missing (excluding the buggy
// 7c9236b16 build), and fall back to Pinned on anything older.
#if HIP_VERSION > 70051831
return hipMemAllocationTypeUncached;
#elif HIP_VERSION == 70051831
if (strcmp(HIP_VERSION_GITHASH, "7c9236b16") != 0) {
return static_cast<hipMemAllocationType>(0x40000000); // hipMemAllocationTypeUncached
}
MORI_SHMEM_WARN(
"CCO uncached window requested but ROCm build {} has a known "
"hipMemAllocationTypeUncached issue; falling back to Pinned memory",
HIP_VERSION_GITHASH);
return hipMemAllocationTypePinned;
#else
MORI_SHMEM_WARN(
"CCO uncached window requested but ROCm version does not support "
"hipMemAllocationTypeUncached; falling back to Pinned memory");
return hipMemAllocationTypePinned;
#endif
}

// Local slot base = the VA where this rank's slice of the flat VA starts.
Expand Down
10 changes: 10 additions & 0 deletions tests/python/ops/dispatch_combine_v2/bench_dispatch_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ def mock_fmoe():
def time_eager(fn, ct):
for _ in range(WARMUP):
fn(ct)
sync()
comm.barrier() # lock-step warmup: sync(device)+barrier so no
# rank starts call N+1 before all finish N (avoids the cco cross-
# device barrier flag-overwrite deadlock at small token counts).
# Untimed, so it does not affect the measured replay bandwidth.
sync()
comm.barrier()
s, e = torch.cuda.Event(enable_timing=True), torch.cuda.Event(
Expand All @@ -295,6 +300,11 @@ def time_eager(fn, ct):
def time_graph(fn, ct):
for _ in range(WARMUP):
fn(ct)
sync()
comm.barrier() # lock-step warmup: sync(device)+barrier so no
# rank starts call N+1 before all finish N (avoids the cco cross-
# device barrier flag-overwrite deadlock at small token counts).
# Untimed, so it does not affect the measured replay bandwidth.
sync()
gr = torch.cuda.CUDAGraph()
with torch.cuda.graph(gr):
Expand Down
Loading