Comments (3)
The Tensorflow script seems working on Linux
Environment:
python: Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 18:10:19)
tensorflow: 1.7.8 (CPU)
scalene: installed by pip
System: Ubuntu 18.04
(Memory profiling not enabled)
from scalene.
PyTorch script fails though
Fatal Python error: GC object already tracked
Thread 0x00007f6d7e613700 (most recent call first):
Thread 0x00007f6d7ee14700 (most recent call first):
Current thread 0x00007f6ea0975240 (most recent call first):
File "test.py", line 31 in forward
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550 in __call__
File "test.py", line 55 in <module>
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/site-packages/scalene/scalene.py", line 1394 in main
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/site-packages/scalene/__main__.py", line 4 in main
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/site-packages/scalene/__main__.py", line 7 in <module>
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/runpy.py", line 85 in _run_code
File "/usr/local/share/anaconda3/envs/Tensorflow/lib/python3.6/runpy.py", line 193 in _run_module_as_main
from scalene.
Thanks for the report, @guanh01 ! :)
I tracked down the issue(s), and have successfully run both programs on Mac OS and Linux. You can get the latest version via pip install -U scalene
. (A note to you and @GammaPi - by default, scalene now runs with memory profiling -- you have to explicitly disable it with --cpu-only
. This is faster but of course does not give you memory usage info.)
The issues were as follows:
- There was a race in the heap, so I have locked the entire heap for now. I have plans to make the sampling mechanism scale, which is actually somewhat tricky, so I have not yet implemented that. For now, unfortunately, this will degrade the performance of third-party libraries that run with multiple threads.
- TensorFlow, at least, appears to be sending memory to be freed that wasn't actually allocated via the memory profiling library; I added some additional checks to discard such
free
calls. Unfortunately, this may leak memory (possibly avoidably).
from scalene.
Related Issues (20)
- Explore adopting `sys.monitoring` (from Python 3.12, PEP 669) to accelerate memory profiling
- GPU, Memory Usage, and Copy Column Not Displaying in Scalene Profiling Output HOT 4
- Handle browsers not in cpython's webbrowser.py HOT 4
- `--json` arg ignored without `--cli` HOT 2
- error when profiling pymediainfo
- how to compile and install this project from the source code HOT 1
- Error in program being profiled: Function Not Found, function 'nvmlDeviceGetComputeRunningProcesses_v2' not found HOT 2
- No such file or directory: '/tmp/tmp1pvg2dc5/tmpbf_w1ds6' HOT 1
- Is hybrid call stack supported? HOT 1
- How to print out the code of C and how long it takes?
- Provide a "rich" html when no browser is available HOT 2
- Scalene does not work out of the box with sage HOT 4
- [Homebrew] No module named scalene HOT 1
- Get the call stack trace(s) in the UI HOT 1
- Run scalene run_profile programmatically HOT 1
- No longer running on Python 3.8 HOT 2
- export profiling as http handler HOT 1
- is python memory profiling support python package written in c? HOT 1
- Provide more meaningful feedback when Scalene has a "null" profile HOT 4
- scalene memory profiling is slower then memray! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalene.