Skip to content

A library that statically maps all array dependencies of an algorithm between memory blocks that can/cannot be shared, as a tree. Can significantly improve algorithm performance.

License

Notifications You must be signed in to change notification settings

CircuitCM/numpy-buffermap

Repository files navigation

Numpy Buffer Map

A way to define arrays of an algorithm through a dependency tree, and model them by arrays that can and cannot share the same memory.

This library can:

  • Reduce the total memory requirements of a procedure.
  • Drastically improve the performance of compiled python, including but not limited to: Numba, Cython, Taichi.
  • Express a unified outline of memory dependencies, useful for spotting issues or finding improvements in a complex procedure.

distinct

After defining a tree, the total buffer size is calculated, allocated, and arrays are initialized at the offsets corresponding to the shared and distinct nodes.

See the demo for use and applications.
See extensions for future potential development directions.

In a sense bmap does a portion of JAX's automatic memory management. Only bmap is still an external tool and can be used for any array compatible language.

About

A library that statically maps all array dependencies of an algorithm between memory blocks that can/cannot be shared, as a tree. Can significantly improve algorithm performance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published