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

Cache to disk #492

Open
willow-ahrens opened this issue Apr 11, 2024 · 3 comments
Open

Cache to disk #492

willow-ahrens opened this issue Apr 11, 2024 · 3 comments
Assignees
Milestone

Comments

@willow-ahrens
Copy link
Collaborator

willow-ahrens commented Apr 11, 2024

Some notes:
We need to use PIDFiles with the stale_age set to a nonzero value otherwise we might run into issues with deadlocking when we control c.

@willow-ahrens willow-ahrens added the priority Do this first label Apr 22, 2024
@willow-ahrens willow-ahrens self-assigned this Apr 22, 2024
@willow-ahrens willow-ahrens removed the priority Do this first label Jun 12, 2024
@willow-ahrens willow-ahrens added this to the v1.0 milestone Jun 17, 2024
@vchuravy
Copy link

How dependent is Finch cache on the state of Julia functions? Julia 1.11 and upwards have some better support for provenance tracking for things like a code cache.

https://github.com/JuliaGPU/GPUCompiler.jl/blob/09b4708ba12e0b19e40f85c64e9105cf666c4d62/src/execution.jl#L63

@willow-ahrens
Copy link
Collaborator Author

That's awesome! Finch does depend on a few overloaded trait functions (the functions declare whether e.g. f is associative). It would be possible to instead store those traits in a struct that can be hashed (e.g. a list of mutable functions). However, I worry that modifications to Finch traits would not live past precompilation in that case. It would be easier if we could hash the state of the world somehow.

In these lines https://github.com/JuliaGPU/GPUCompiler.jl/blob/09b4708ba12e0b19e40f85c64e9105cf666c4d62/src/execution.jl#L139-L140, is it safe to use the world as a key? If I started a julia session at world age e.g. 42, then define foo, I get world age 43. If I start a different session and define bar, wouldn't I still get world age 43?

I'm curious if there's a simple interface to the provenance tracking (like a call/dependency graph). If not, I would probably design my own "rewriter state object"

@willow-ahrens willow-ahrens modified the milestones: v1.0, v1.1 Nov 28, 2024
@vchuravy
Copy link

is it safe to use the world as a key?

Within a session, it is safe to use world as a key, across sessions it is not. (Worlds get truncated during precompilation)
Compilation results are also valid across a range of worlds, so the use there is more an "optimistic" cache lookup
before doing the more complicated one that considers world-ranges.

Note that the hash calculcation in https://github.com/JuliaGPU/GPUCompiler.jl/blob/09b4708ba12e0b19e40f85c64e9105cf666c4d62/src/execution.jl#L160 doesn't use world.

I'm curious if there's a simple interface to the provenance tracking

Yeah, https://github.com/JuliaGPU/GPUCompiler.jl/blob/09b4708ba12e0b19e40f85c64e9105cf666c4d62/src/execution.jl#L162
is meant to capture the provenance of an object, but the object needs to be serialized into a precompilation cache.

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

No branches or pull requests

2 participants