Skip to content

CU masking works on gfx90a including under graph replay, and buys isolation not concurrency - #90

Open
Andrei-Dr wants to merge 1 commit into
mainfrom
bench/cu-mask-phase0
Open

Andrei-Dr wants to merge 1 commit into
mainfrom
bench/cu-mask-phase0

Conversation

@Andrei-Dr

Copy link
Copy Markdown
Collaborator

Phase 0 for the prefill/decode co-scheduling idea, measured on GPU0 (idle box) 2026-08-09. docs/58 + the probe source in benchmarks/cu_mask_probe.hip. Runs in under a minute, needs no model.

Four of five hardware assumptions hold. The fifth is the interesting one.

gate result
hipExtStreamGetCUMask read-back IDENTICAL for 16 / 52 / 104-bit masks
placement 16 bits -> exactly 16 physical CUs; 52 -> 52; 104 -> 104, read from HW_ID per workgroup, not from hipSuccess
disjoint masks 0 CU overlap between bits 0-51 and 52-103
HIP graph replay mask HELD — a graph captured on a 16-CU stream replays on 16 CUs; the same graph on an unmasked stream spreads to 104
concurrency disjoint masks 1.99x vs serial — and two ordinary unmasked streams also 1.99x

The graph row was the one I expected to fail (undocumented; the mask binds to a dedicated HSA queue at stream creation, and hipGraphLaunch could plausibly route around it). It does not fail, which matters because vLLM decode is graph-replayed.

The last row is why this is not a green light. HIP already overlaps independent streams here, so CU masking buys isolation, not concurrency — a real but strictly smaller property than the framing invites. And the probe kernel is pure-ALU spin, so it says nothing about HBM contention, which is where the interference actually lives given round 62 has decode at 10% of achievable bandwidth.

Two traps documented for whoever builds on this:

  • the flat mask is de-interleaved as SE = bit % 8 on 8 SE x 13 CU, so 13 contiguous bits span all eight shader engines, not one. Any "give decode N adjacent CUs" sweep is measuring a different partition than it thinks.
  • a masked stream takes a dedicated HSA queue against a 32-queue / 8-per-ACE budget, and the mask is creation-time only — no setter.

Framed against the incumbent rather than against nothing: this has to beat docs/52's already-adopted DP=2 (1.118x aggregate, 0.888x TPOT), and it contends for the board power budget docs/53 shows is already binding on prefill — a kill criterion the original framing omitted.

Ledger entry added. No production change.

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