-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SINGA-236 memory pool (update from an old branch) #254
base: master
Are you sure you want to change the base?
Conversation
… memory pool facility to management Block data allocated by the memory pool. \n 2. Add relevant test cases.
include/singa/core/memory.h
Outdated
class CppMemPool { | ||
public: | ||
// initial pool size (MB), and the size of each memory uint in the memory pool (KB) | ||
CppMemPool(size_t init_size_mb = 256, size_t uint_size_kb = 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all memory units of the same size?
Can we do it in this way:
- create a large memory pool P0 at the beginning
- when malloc is called, return a block of the asked size and move the offset of the start pointer of the pool Pi
- if not enough space for malloc a new block, then create a new block Pi+1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optimizations could be added later, e.g.
OptimizeMemPool(): re-compute the total size blocks in use, and move them into contiguous memory space.
- move swig interface files to src/api - move python to root folder - move python related cmake functions to python cmake files - use add_library OBJECT command to build singa_objects, then be used by singa shared library and python wraper library, avoiding build twice - todo, add java binding
- add java binding cmake files - todo: add test code
…bject Add reverse add/sub/mult/div for float-tensor operations. add unit tests in test_tensor.py
Remove dependencies on copy_protobuf target.
Updated the memory pool structure. |
Implemented the following features:
1.A memory pool facility to management Block data allocated by the memory pool.
2.Add relevant test cases