Scalene v2.2.1
Bug Fixes
-
sys.monitoring tool ID conflict with PyTorch (#1015, #1019): Fixed SIGSEGV crash when using Scalene with PyTorch Lightning on Python 3.12+. When PROFILER_ID is already claimed by another tool, Scalene now falls back to alternative tool IDs (3 or 4), or gracefully uses the legacy
PyEval_SetTracetracer. -
TensorFlow 2.21+ compatibility (#1018): Fixed compatibility with TensorFlow 2.21+ where
trace.enabledchanged from a callable to a bool. Scalene now applies a compatibility fix at profiler start time. -
Multiprocessing resource tracker (#1017): Fixed
BrokenPipeErroron NixOS with Python 3.13/3.14 when the resource tracker subprocess dies during semaphore creation. Scalene now falls back fromspawn/forkservertoforkcontext. -
Subprocess profiling (#1013): Fixed profiling failing when Python interpreter flags (like
-Bor-u) precede-cor-min subprocess invocations. -
Windows timer thread shutdown (#1012): Fixed fatal
gilstate_tss_seterror on Windows when the timer thread shuts down. -
Windows
--on/--offsupport (#1010): Added support for--onand--offflags on Windows using Named Events. -
__future__flags in exec/eval (#1008): Fixed__future__compiler flags not being propagated inexec/eval/compilereplacements. -
Windows multiprocessing (#1005, #998): Fixed spawn-mode multiprocessing Pool support on Windows, including pickle corruption and memoryview cleanup issues.
New Features
-
Async-aware profiling (#1006): Added async-aware profiling support using
sys.monitoringon Python 3.12+. -
C23 allocator support (#1011): Added support for C23
free_sizedandfree_aligned_sizedfunctions in SampleHeap.
Other Changes
- Improved shell script portability for NixOS/Guix using
#!/usr/bin/env bash - Code formatting updates via Black
Full Changelog: v2.1.4...v2.2.1