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.
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.