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

Add Feature to Select Devices to Execute Kernels On #458

Closed
matinraayai opened this issue Feb 7, 2024 · 7 comments · Fixed by #554
Closed

Add Feature to Select Devices to Execute Kernels On #458

matinraayai opened this issue Feb 7, 2024 · 7 comments · Fixed by #554

Comments

@matinraayai
Copy link

It would be great in a multi-device system, the device id that will run a KA kernel could be set through a function call.
cc: @vchuravy

@vchuravy
Copy link
Member

vchuravy commented Feb 9, 2024

We can do this in a backwards compatible manor.

What function do we need?

  • device(::Backend)
  • device!(::Backend)
  • ?devices or ndevices

@matinraayai
Copy link
Author

Those, as well as synchronization functions on a single device.
I'll look into CUDA standards to see if there's something else I'm missing.

@vchuravy
Copy link
Member

Those, as well as synchronization functions on a single device.

Can you expand on that? We already have synchronize w.r.t to the current active device.

@matinraayai
Copy link
Author

Having a synchronize function that takes a device would have been nice, but if there's one w.r.t active device, I think it does the job just as well.

@luraess
Copy link
Contributor

luraess commented Feb 13, 2024

It may also depend if you need stream/queue or device sync. Currently, it implements stream/queue sync for GPU backends.

@miniskar
Copy link

How to configure CuStream / hipStream to backend?

@luraess
Copy link
Contributor

luraess commented Jan 13, 2025

How to configure CuStream / hipStream to backend?

As for now, kernels in KA will execute on default Stream. You can change priority using

priority!(::Backend, prio::Symbol)
. If you need to perform asynchronous kernel launch, you could spawn new Julia tasks to launch kernels as they would then get another Stream to execute on. As far as I know, there is no KA implementation (yet) of fine grained stream management functionality, to e.g. explicitly switch or select new (other) streams (as in https://amdgpu.juliagpu.org/stable/streams/ -- and CUDA's analog).

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 a pull request may close this issue.

4 participants