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

Rework cache to use inline cache #586

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Rework cache to use inline cache #586

wants to merge 1 commit into from

Conversation

vchuravy
Copy link
Member

We currently put entries into the cache under two different keys.

  • objectid(src), tls_world, cfg
  • ci, cfg

The first is meant as a fast hit in scenarios where the current world-age is not changing.
If we follow Julia Base, we could instead replace the first with a linear search over a small
number of entries.

By storing the ci as a field in the cache struct we quickly check if the cache is still valid,
currently when the tls_world changes we fall-back to the slower cache check.

I was thinking of adding something similar to Enzyme.
This is an API breakage though. So I am not convinced it is worth it right now.

@@ -80,65 +110,56 @@ session-dependent objects (e.g., a `CuModule`).
function cached_compilation(cache::AbstractDict{<:Any,V},
Copy link
Member Author

Choose a reason for hiding this comment

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

This would be the API breakage. We need to change this to AbstractDict{<:Any, CacheEntry}{V}} or take V as a separate parameter.

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.

1 participant