Giter Club home page Giter Club logo

Comments (3)

GammaPi avatar GammaPi commented on May 18, 2024

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)
Screenshot from 2020-07-12 16-58-42

from scalene.

GammaPi avatar GammaPi commented on May 18, 2024

PyTorch script fails though

Screenshot from 2020-07-12 17-07-14

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.

emeryberger avatar emeryberger commented on May 18, 2024

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:

  1. 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.
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.