5.5. Read the timing columns carefully
LeanProfiler's total duration is the host interval from the start of a span to its end. Self time subtracts immediate same-thread child coverage. A synchronized CUDA hook makes that host interval wait for device completion, but it still does not become a sum of kernel durations.
PyTorch tables separate CPU and supported device measurements. A user range can have CPU total,
CPU self, and device-related columns derived from events correlated below it. Sorting by
self_cpu_time_total answers a different question from sorting by self_cuda_time_total.
Neither table should be treated as hardware utilization. Overlap, asynchronous launches, multiple threads, multiple streams, and profiler overhead all matter. Warm up first, keep synchronization policy fixed, and compare the same columns under the same configuration.
PyTorch's schedule also has details absent from LeanProfiler's current Schedule, including
skip_first_wait. LeanProfiler's runScheduledCycle runs waiting and warmup callbacks before
opening each active session. PyTorch keeps the profiler object around the loop and step() advances
its internal state.