plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.22k stars 399 forks source link

Is there a way to not use GPU monitoring and pynvml? #829

Closed Wizard1209 closed 4 months ago

Wizard1209 commented 4 months ago

Describe the bug Hi, I'm trying to optimize memory usage of our framework and keep getting pynvml in report using around 100M of memory, is there a way to exclude this module as I'm only optimizing CPU and memory with corresponding arguments? By the way, I wasn't able to exclude it with --profile-exclude.

To Reproduce It's not easy to provide an example I'm working with, but here is the command scalene --cpu --memory --allocation-sampling-window 2097152 --profile-all /root/.pyenv/versions/3.12.2/envs/dipdup/bin/dipdup -e .env -c dipdup.yaml -c configs/dipdup.sqlite.yaml run

Expected behavior It would be nice not to load GPU modules and monitoring code when only CPU and memory profilers are enabled.

Screenshots image

Desktop (please complete the following information):

emeryberger commented 4 months ago

Please install the latest version from the repository (python3 -m pip install git+https://github.com/plasma-umass/scalene); in theory, it should solve this problem.