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

Support other GPU Backends #32

Open
avik-pal opened this issue Jul 19, 2024 · 2 comments
Open

Support other GPU Backends #32

avik-pal opened this issue Jul 19, 2024 · 2 comments

Comments

@avik-pal
Copy link

I am trying out the package in LuxLib.jl (backend for Lux.jl) to fuse GPU operations. But currently, it seems only CUDA is supported. (at least that's what I understand from this error https://buildkite.com/julialang/luxlib-dot-jl/builds/786#0190c951-2861-484d-b998-e7bf87b0732b/280-562)

How difficult would it be to support other backends? Maybe via KernelAbstractions

@charleskawczynski
Copy link
Member

Hi @avik-pal,

Yeah, we can certainly support other backends. The entire cuda support is here.

Regarding KernelAbstractions, that's an interesting question, I hadn't thought about how that would look, but I suppose it's possible.

I personally only have access to NVIDIA gpus, so I can't easily test on other hardware. Since the implementations are pretty easily extendable, I'm happy to review PRs if you'd like to take a shot at implementing one.

For the pieces needed to be implemented, we should probably rename GPU to CUDA here, and then we could define a KernelAbstractionsKernel type here. Then, we can catch dispatch like this, but for something like function fused_copyto!(fmb::MBF.FusedMultiBroadcast, ::MBF.KernelAbstractionsKernel), and then add an implementation based on what broadcast objects live in fmb (which can range from very simple/naive to highly sophisticated/complicated).

Perhaps @vchuravy may have a vision of how this might look?

@charleskawczynski
Copy link
Member

I suppose that we could just use KA by default for primary GPU support, that might even be the simplest route.

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