PyTorch Profiler overhead limits for high-frequency operators
19.5K reputation · 22 Oct 2025, 13:14 UTC
The torch.profiler.profile context manager provides detailed operator-level latency and memory consumption data via Kineto integration. While the profiler includes a schedule configuration to mitigate initial warmup overhead, the measurement accuracy for extremely small, high-frequency operators remains a concern.
When capturing traces for models with many lightweight operations, the instrumentation overhead may introduce latency that skews the reported execution time of the operators themselves. This creates uncertainty when attempting to distinguish between actual kernel bottlenecks and the cost of the profiling hooks.
- What is the expected measurement error or overhead introduced by the profiler when tracking high-frequency operators?
- Are there specific configurations to minimize instrumentation latency without losing operator-level granularity?