pymc-devs / pymc-devs/pytensor

Cache output of numba_funcify where possible

Open
#180 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compilation help wanted numba
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

We could add cache_by_op or cache_by_op_and_sig decorators for numba_funcitfy functions, that internally use a LRU cache to keep track of previous njit functions. Each funcify function can then choose to reuse results in a way that is appropriate.
Most funcify functions only use the op, and don't even look at the node at all.
See also #179 for context.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the numba_funcify functions and issue #179 for context. Determine which functions can reuse results by operation or by operation and signature, then verify that repeated funcification reuses cached njit functions without applying the wrong cache key.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.