Scalene: A high-performance, high-precision CPU+GPU+memory profiler for Python
summary
Scalene is a CPU+memory+GPU profiler for Python that claims high precision with low overhead by combining timer-driven sampling, virtual-clock inference, and allocation sampling to separate python vs native vs system time, measure copy volume, and detect leaks. Benchmarks show default runs at about 20% overhead versus memory profiler’s extreme ~300x slowdown. A concrete case eliminates a redundant np.array copy, cutting peak memory from 1.6GB to 900MB and trimming runtime ~15%. It handles threads, multiprocessing, numpy and GPU workloads (PyTorch) and produces actionable line-level guidance.
AI-written summary · about
chapters (6)
- 0:00Intro
- 0:22Profilers
- 8:37Options
- 16:25Technical challenges
- 20:11GPU profiling
- 21:31Memory leak detection
related talks
39mPython Performance Matters
15mTriangulating Python Performance Issues with SCALENE
30mHow to Tune your Python Analysis Pipeline: A Profiler Guide
31m"Optimizing Scientific Python with C++, CUDA, and Serverless Compute"
37mTuning Python applications can dramatically increase performance
30mHighLoad Python SIMD, GPU, and Horizontal Scaling Looking into Silicon
22mExperiences making CPU-bound tasks run much faster
01h 31mDebugging and profiling techniques
