Skip to content

Unified memory allocations #630

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

christiangnrd
Copy link
Member

@christiangnrd christiangnrd commented Jul 20, 2025

Close #601

@vchuravy The idea is that you request unified if you want to uallocate some memory with unified memory to speed up operations that necessitate CPU access (like 1d reduce result or the indices container in findall). Otherwise just use the default storage type. Backends would have to add support for the unified kwarg.

Copy link
Contributor

github-actions bot commented Jul 20, 2025

Your PR no longer requires formatting changes. Thank you for your contribution!

@vchuravy
Copy link
Member

Perhaps we can make this backwards portable and add it to 0.9 first?

@vchuravy vchuravy added this to the 0.10.0 milestone Jul 22, 2025
@vchuravy
Copy link
Member

Thanks once we have it merged in 0.9, please update this PR so that the implementations match.

@christiangnrd christiangnrd changed the title Proof-of-concept unified memory allocations Unified memory allocations Jul 22, 2025
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 51.24%. Comparing base (1ac546f) to head (98ba890).

Files with missing lines Patch % Lines
src/KernelAbstractions.jl 71.42% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #630      +/-   ##
==========================================
+ Coverage   47.54%   51.24%   +3.70%     
==========================================
  Files          22       21       -1     
  Lines        1729     1610     -119     
==========================================
+ Hits          822      825       +3     
+ Misses        907      785     -122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vchuravy
Copy link
Member

ready to merge?

Returns whether unified memory arrays are supported by the backend.

!!! note
Backend implementations **must** implement this function
Copy link
Member Author

Choose a reason for hiding this comment

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

@vchuravy Yes ready to merge. Only thing I want to make sure you didn't miss is that contrary to the 0.9 PR, this has supports_unified as "must". I you would rather it still say "should" commit the suggestion. Either way merge away!

Suggested change
Backend implementations **must** implement this function
Backend implementations **should** implement this function

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.

Unified memory interface?
2 participants