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

Experiment with Core.Memory address space #181

Open
mofeing opened this issue Oct 16, 2024 · 0 comments
Open

Experiment with Core.Memory address space #181

mofeing opened this issue Oct 16, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@mofeing
Copy link
Collaborator

mofeing commented Oct 16, 2024

Julia 1.11 introduced Core.Memory and made Array a purely Julia type, which is nice for different optimization reasons. The interesting part for us is that GenericMemory has a parameter for kind and another for addrspace, which could potentially be exploited by us to store the memory managed by XLA.
This means that ConcreteRArrays could be managed by a simple Array instead, with the address space managed by Reactant.

Docs say the following:

addrspace can currently only be set to Core.CPU. It is designed to permit extension by other systems such as GPUs, which might define values such as:

module CUDA
const Generic = bitcast(Core.AddrSpace{CUDA}, 0)
const Global = bitcast(Core.AddrSpace{CUDA}, 1)
end

The exact semantics of these other addrspaces is defined by the specific backend, but will error if the user is attempting to access these on the CPU.

A lot of info is missing on how to customize this behavior but we should keep an eye on it.

@mofeing mofeing added the help wanted Extra attention is needed label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant