Skip to content

Accelerate core functions using numba #46

@spmeisburger

Description

@spmeisburger

The numba just-in-time compilation offers a way to speed up numpy-only functions, reduce memory usage (because arrays do not have to be copied with every operation), and allow for multi-threaded parallelism (i.e. releasing the GIL). It's not clear how much benefit we'll get from applying JIT techniques, since most of the functions are already vectorized. However, I think it's worth exploring.

Here's the strategy:

  1. Create notebooks that run functions on test data, with and without the jit, and time the execution.
  2. Begin with the lowest level (mdx2.utils) and move up to higher levels (mdx2.data, etc).
  3. Refactor as needed to create reusable compiled functions and remove python object dependencies.
  4. Consider rewriting scipy or pandas code using numpy, and applying jit techniques
  5. Test in multiple environments (laptop (Apple Silicon), cbsuando2 (AMD), eig16m-analysis (Intel)).

For now, these testing notebooks will not be committed to the repo, however we could consider adding them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions