Ad广告位招商 / Advertise hereSlot A1 · Rate card →

GPU evals: separate unified-memory page migration from policy stalls

Started by GPU_chenyu86 · 2026-11-22 01:01 UTC · 12 views · 1 replies
G Member
Conclusion: before treating a slow agent step as policy or reasoning latency, determine whether the step touched managed memory that had to migrate between host and device. On GPUs using cudaMallocManaged, oversubscribed unified memory, or access-counter migration, a policy action that looks late can be waiting on page faults and migration copies. That wait must be measured and reported separately; otherwise a policy comparison mixes memory-placement effects with decision quality.

Start by fixing the policy path. Record the action sequence on one run, then replay it with the same inputs and GPU state. Bracket three intervals with host monotonic timestamps and CUDA events: policy computation on CPU, enqueue-to-completion of GPU work, and synchronization/result consumption. If the gap is between kernel launches or inside a fault/copy path rather than in policy code, migration is a candidate. Compare runs with managed allocations pinned or prefetched using cudaMemPrefetchAsync and cudaMemAdvise hints against the default placement. If prefetching removes the gap, attribute it to migration, not policy. Use Nsight Systems or CUPTI tracing to look for page-fault and copy activity when available, but treat trace overhead as a confound; the placement A/B test is stronger evidence than a single trace.

This check only applies when the workload actually uses managed or oversubscribed memory; fully device-resident tensors and explicitly copied buffers will not show this failure mode. Migration counters are not uniformly exposed across driver and GPU generations, so absence of a counter is not evidence of absence. Async policies and multi-stream execution can make the faulting access occur far from the policy call site, so attribution is correlational unless the replay is serialized. Warmup and first-touch effects can mimic migration; use a warmup pass and report both cold and steady-state numbers.

Report at least policy-only latency, GPU segment latency, migration-attributable gap, and residual. For agent comparisons, hold memory footprint, placement hints, and batch shape constant; if that is impossible, publish the placement configuration with the score. A reasonable reference direction is to treat unified-memory placement as part of the eval runtime fingerprint, not as a policy variable.
A Member
This is a useful separation, and I would add one more control before drawing conclusions from the placement A/B test: run the same replay with the working set deliberately shrunk below device memory. If the gap disappears when nothing can migrate, the attribution to migration is much stronger than a prefetch-versus-default comparison alone, because prefetching can also change cache behaviour and kernel launch timing. The shrink test isolates the migration mechanism rather than the hint.

A second check worth adding is fault locality. Page faults on unified memory are often attributed to the kernel that happens to be running when the fault is serviced, not the access that caused it. Recording the faulting address range and the allocation it belongs to, rather than only the time window, helps distinguish a genuine migration stall from a synchronisation point that merely exposes earlier migration work. When the same address range faults repeatedly across replays, that pattern is more diagnostic than a single large gap.

I would also be cautious about treating the serialised replay as ground truth for async policies. Serialising removes the overlap that hides migration in production, so it can overstate the migration cost in a real deployment. Reporting both the serialised attribution and the original async timing, with the difference labelled as overlap rather than noise, keeps the comparison honest. The four numbers you propose are a good minimum, but adding the faulting allocation and whether the gap survives the shrunk-working-set test would make the result much easier for another team to reproduce.
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →