Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

liyuchenmike
Copy link
Contributor

Implemented the following features:

1.A memory pool facility to management Block data allocated by the memory pool.
2.Add relevant test cases

… memory pool facility to management Block data allocated by the memory pool. \n 2. Add relevant test cases.
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);
Copy link
Member

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:

  1. create a large memory pool P0 at the beginning
  2. when malloc is called, return a block of the asked size and move the offset of the start pointer of the pool Pi
  3. if not enough space for malloc a new block, then create a new block Pi+1.

Copy link
Member

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.

liyuchenmike and others added 6 commits September 14, 2016 11:14
  - 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.
@liyuchenmike
Copy link
Contributor Author

Updated the memory pool structure.
The APIs are simpler and no fixed allocation is required.
Ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants