Skip to content

fix(cco): guard hipMemAllocationTypeUncached for older ROCm#480

Merged
jhchouuu merged 2 commits into
mainfrom
jiahzhou/cco-uncached-hip-guard
Jul 16, 2026
Merged

fix(cco): guard hipMemAllocationTypeUncached for older ROCm#480
jhchouuu merged 2 commits into
mainfrom
jiahzhou/cco-uncached-hip-guard

Conversation

@jhchouuu

@jhchouuu jhchouuu commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • CCO's CcoWindowAllocType() used hipMemAllocationTypeUncached unguarded. That symbol was only added to HIP on 2025-09-11 (HIP_VERSION > 70051831), so CCO fails to compile on older ROCm such as 7.0.0 — the reason sgl-project/sglang#31406 had to revert the mori pin.
  • Apply the same 3-way HIP_VERSION guard already used by the shmem path in src/application/memory/symmetric_memory.cpp:
    • > 70051831 → use the symbol
    • == 70051831 → use raw 0x40000000 (symbol may be missing in that build; exclude the buggy 7c9236b16 build)
    • < 70051831 (incl. ROCm 7.0.0) → warn and fall back to Pinned memory
  • The CCO_UNCACHED_WINDOW=0 opt-out is preserved; both call sites already route through this single function, so no other changes are needed.

Test plan

  • Build CCO on ROCm 7.0.0 (HIP_VERSION < 70051831) — compiles, falls back to Pinned with a warning.
  • Build CCO on a recent ROCm (HIP_VERSION > 70051831) — still uses uncached windows.
  • CCO CI (ci_cco.yml) on MI355X-AINIC passes unchanged.

🤖 Generated with Claude Code

hipMemAllocationTypeUncached was added to HIP on 2025-09-11
(HIP_VERSION > 70051831). CCO used the symbol unguarded in
CcoWindowAllocType(), so it fails to compile on older ROCm such as
7.0.0 (the reason sglang had to revert the mori pin).

Mirror the existing shmem guard in symmetric_memory.cpp: use the symbol
when available, the raw value 0x40000000 on the 70051831 build (symbol
may be missing; exclude the buggy 7c9236b16 build), and fall back to
Pinned memory with a warning on anything older. The CCO_UNCACHED_WINDOW=0
opt-out is preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dispatch/combine cross-device (xdb) barrier matches per-call flags across
ranks; if one rank gets a full call ahead it overwrites the flag a slower rank
is still waiting on -> deadlock. The graph/eager warmup fired the kernel
back-to-back with no per-iteration cross-rank sync, so at small token counts
(short kernels, e.g. ct=128) rank drift intermittently hung the EP8 smoke.

Add sync()+comm.barrier() inside the warmup loops: sync() waits this rank's
kernel to finish, comm.barrier() holds until all ranks finished, so no rank
starts call N+1 before every rank completed N. Warmup is untimed, so measured
replay bandwidth is unchanged.

Verified on MI355X (8 ranks, MODE=graph SWEEP=128,512,4096,8192): 8/8 runs
clean (was ~1-in-2 hang); perf identical to baseline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jhchouuu jhchouuu merged commit f7e6ac6 into main Jul 16, 2026
14 checks passed
@jhchouuu jhchouuu deleted the jiahzhou/cco-uncached-hip-guard branch July 16, 2026 05:25
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