SINGA-236 memory pool (update from an old branch)#254
Open
liyuchenmike wants to merge 7 commits intoapache:masterfrom
Open
SINGA-236 memory pool (update from an old branch)#254liyuchenmike wants to merge 7 commits intoapache:masterfrom
liyuchenmike wants to merge 7 commits intoapache:masterfrom
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); |
Member
There was a problem hiding this comment.
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.
Member
There was a problem hiding this comment.
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.
Contributor
Author
|
Updated the memory pool structure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented the following features:
1.A memory pool facility to management Block data allocated by the memory pool.
2.Add relevant test cases