Offload expose device selection - #158032
Conversation
This comment has been minimized.
This comment has been minimized.
|
Does it actually need to be a rust intrinsic? Does LLVM give |
|
@bjorn3 Yes, you could call all of our openmp/offload libraries directly, especially here it's easy enough. Some of the other ones we use for data transfer and kernel launches are just a bit more involved to set up, so we do it in the compiler. The two problems of exposing it are that you'd need to link in the GCC or LLVM libraries yourself, if you build and use the Offload setup, we do it for users. Also cranelift doesn't provide it, with an intrinsic we could have better fallback behaviour. |
abcdd8e to
d806053
Compare
This comment has been minimized.
This comment has been minimized.
d806053 to
9a535b4
Compare
This comment has been minimized.
This comment has been minimized.
9a535b4 to
c3e2e4c
Compare
|
c3e2e4c to
2b57373
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
The code should work on the technical side, but I feel like exposing the -1 as "any device" to the frontend is a little too low-level. Also, could you add a check to make sure that if we select GPU X, that this GPU is also available? Right now I often forget to load rocm on a server, run the binary, and have it fail with some obscure llvm error since offload fails (no gpu available) but we prohibit falling back to the CPU. It would be nice to get a more meaningfull error message on the Rust side already. |
|
Left just a nit, other than that, can you add the later cleanup commits into the first three? Otherwise names seem also good now, so lgtm. |
6f14972 to
9f09134
Compare
9f09134 to
3777642
Compare
|
We should later add a way to give users information about the different GPU devices. Servers just have 4/8x identical GPUs, but the majority of end-users will probably have a tiny igpu and a large dgpu. @bors r+ rollup |
get amount of available devices with
omp_get_num_devicesand add arg to the intrinsic for device selectionr? @ZuseZ4