Skip to content

DArray: Remove the stage cache #472

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

Merged
merged 4 commits into from
Feb 22, 2024
Merged

DArray: Remove the stage cache #472

merged 4 commits into from
Feb 22, 2024

Conversation

jpsamaroo
Copy link
Member

In the past, the DArray defined various operators (like map, reduce, mul, etc.) to return lazy wrappers, which would then get "staged" later to actually materialize a new DArray. This was done to allow some optimizations across operations, but few were implemented, and that was removed to make writing DArray operations simpler.

A vestige of this old mechanism was the stage cache, which allowed for a DAG of DArray operations to exist, which would ensure that values referenced multiple times (such as when doing A = rand(Blocks(4,4), 16, 16); A * A) would only compute A once, and then reuse its result. It was fine for this to stick around, since it never had a chance to deduplicate such operations, as they're now immediately executed (which results in the same semantics anyway).

A problem with stage caching is that it uses a WeakKeyDict to reference submitted DArray operators, which is known to be slower to free referenced objects and can cause excessive GC pressure and OOM issues. This PR thus removes the stage cache to prevent this from happening anymore. Additionally, some changes are made to ensure that JuliaLang/julia#40626 does not bite us.

@jpsamaroo jpsamaroo merged commit 7364106 into master Feb 22, 2024
@jpsamaroo jpsamaroo deleted the jps/darray-no-cache branch February 22, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant