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

Allow Dispatchers to be cached #6373

Merged
merged 7 commits into from
Nov 6, 2020
Merged

Conversation

eric-wieser
Copy link
Contributor

This allows functions which take callable arguments to be cached

Closes #6251

This allows functions which take callable arguments to be cached
@esc
Copy link
Member

esc commented Oct 15, 2020

@eric-wieser thanks for submitting this, I have queued it for review.

@stuartarchibald stuartarchibald added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Oct 21, 2020
@stuartarchibald stuartarchibald added this to the Numba 0.53 RC milestone Oct 21, 2020
@stuartarchibald stuartarchibald added 3 - Ready for Review and removed 4 - Waiting on author Waiting for author to respond to review labels Oct 21, 2020
@richardsheridan
Copy link

richardsheridan commented Nov 4, 2020

I just tried this patch on some of my higher-order functions and it doesn't crash 👍 but I was noticing a hiccup remaining on my first call to the cached functions. I looked into my __pycache__ folder and it looks like the cache is missing once each new process for the higher-order functions only. Possibly the cache is missing because the dispatcher hashes are not stable across startups for some reason?

@stuartarchibald
Copy link
Contributor

I just tried this patch on some of my higher-order functions and it doesn't crash +1 but I was noticing a hiccup remaining on my first call to the cached functions. I looked into my __pycache__ folder and it looks like the cache is missing once each new process for the higher-order functions only. Possibly the cache is missing because the dispatcher hashes are not stable across startups for some reason?

Thanks for testing this. xref: #6284 is probably also needed.

@eric-wieser
Copy link
Contributor Author

Is the plan to wait until @6284 is sorted before putting this in, or are they fine to go in indepedently?

Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for debugging and fixing this, one minor stylistic thing to resolve else good to go.

numba/tests/test_dispatcher.py Outdated Show resolved Hide resolved
@stuartarchibald
Copy link
Contributor

Is the plan to wait until @6284 is sorted before putting this in, or are they fine to go in indepedently?

Think they can go in independently, but we may need to update tests.

@stuartarchibald stuartarchibald added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Nov 6, 2020
Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix-ups!

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on author Waiting for author to respond to review labels Nov 6, 2020
@sklam sklam merged commit 8ff4314 into numba:master Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot cache functions with callable arguments
5 participants