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 |
…=ZuseZ4 Offload expose device selection get amount of available devices with `omp_get_num_devices` and add arg to the intrinsic for device selection r? @ZuseZ4
…=ZuseZ4 Offload expose device selection get amount of available devices with `omp_get_num_devices` and add arg to the intrinsic for device selection r? @ZuseZ4
…=ZuseZ4 Offload expose device selection get amount of available devices with `omp_get_num_devices` and add arg to the intrinsic for device selection r? @ZuseZ4
…=ZuseZ4 Offload expose device selection get amount of available devices with `omp_get_num_devices` and add arg to the intrinsic for device selection r? @ZuseZ4
…uwer Rollup of 20 pull requests Successful merges: - #152617 (std: implement `sleep_until` for Fuchsia) - #158934 (diagnostics: fix `let x: vec![]` suggestion pointing into stdlib) - #161277 (bootstrap: Move all non-module items out of the crate root) - #161295 (std: don't panic on long-elapsed deadlines for `sleep_until`) - #161368 (Double-word align `_Unwind_Exception`) - #161370 (Uplift rustfmt macro formatting fix) - #161378 (`FlowSensitiveAnalysis` cleanups) - #158032 (Offload expose device selection) - #158855 (Add `desktop` method to `CommandExt`) - #161199 (Add regression test for non lifetime binders) - #161302 (Add regression test for inconsistent import resolution from issue 147208) - #161329 (Add regression tests for a few fixed issues with E-needs-test) - #161330 (Add regression test for nested RPIT not an iterator ICE) - #161351 (Cleanup: Move impl of `#[rustc_dump_object_lifetime_defaults]`) - #161355 (Add file path to some archive build errors) - #161373 (Allow running EC2 jobs locally) - #161393 (Configure LLM policy URL for triagebot) - #161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - #161410 (Fix rustdoc remapping `documentation` scope documentation) - #161415 (Update expect messages in path docs to better follow guidelines)
Rollup of 25 pull requests Successful merges: - #152617 (std: implement `sleep_until` for Fuchsia) - #158934 (diagnostics: fix `let x: vec![]` suggestion pointing into stdlib) - #160995 (Tiny readability cleanups for initialization dataflow analyses) - #161277 (bootstrap: Move all non-module items out of the crate root) - #161295 (std: don't panic on long-elapsed deadlines for `sleep_until`) - #161368 (Double-word align `_Unwind_Exception`) - #161370 (Uplift rustfmt macro formatting fix) - #161378 (`FlowSensitiveAnalysis` cleanups) - #161420 (Bump wasm-component-ld to 0.5.30) - #161429 (Tighten allocator `Send`/`Sync` requirements for `Arc` in preparation for refactor) - #158032 (Offload expose device selection) - #158855 (Add `desktop` method to `CommandExt`) - #160299 (Stabilize `bool::toggle`) - #160842 (Apply `&[T]` visualizer to `*const [T]`, `*mut [T]` and `Box<[T]>`) - #160981 (Partially support building and locating wasm proc-macros) - #161199 (Add regression test for non lifetime binders) - #161212 (rust-installer/install-template.sh: catch cp(1) error when installing…) - #161302 (Add regression test for inconsistent import resolution from issue 147208) - #161329 (Add regression tests for a few fixed issues with E-needs-test) - #161330 (Add regression test for nested RPIT not an iterator ICE) - #161331 (Bitset simplifications) - #161340 (rustdoc: enable scrolling only on table/code) - #161351 (Cleanup: Move impl of `#[rustc_dump_object_lifetime_defaults]`) - #161355 (Add file path to some archive build errors) - #161373 (Allow running EC2 jobs locally)
Rollup of 25 pull requests Successful merges: - #152617 (std: implement `sleep_until` for Fuchsia) - #158934 (diagnostics: fix `let x: vec![]` suggestion pointing into stdlib) - #160995 (Tiny readability cleanups for initialization dataflow analyses) - #161277 (bootstrap: Move all non-module items out of the crate root) - #161295 (std: don't panic on long-elapsed deadlines for `sleep_until`) - #161368 (Double-word align `_Unwind_Exception`) - #161370 (Uplift rustfmt macro formatting fix) - #161378 (`FlowSensitiveAnalysis` cleanups) - #161420 (Bump wasm-component-ld to 0.5.30) - #161429 (Tighten allocator `Send`/`Sync` requirements for `Arc` in preparation for refactor) - #158032 (Offload expose device selection) - #158855 (Add `desktop` method to `CommandExt`) - #160299 (Stabilize `bool::toggle`) - #160842 (Apply `&[T]` visualizer to `*const [T]`, `*mut [T]` and `Box<[T]>`) - #160981 (Partially support building and locating wasm proc-macros) - #161199 (Add regression test for non lifetime binders) - #161212 (rust-installer/install-template.sh: catch cp(1) error when installing…) - #161302 (Add regression test for inconsistent import resolution from issue 147208) - #161329 (Add regression tests for a few fixed issues with E-needs-test) - #161330 (Add regression test for nested RPIT not an iterator ICE) - #161331 (Bitset simplifications) - #161340 (rustdoc: enable scrolling only on table/code) - #161351 (Cleanup: Move impl of `#[rustc_dump_object_lifetime_defaults]`) - #161355 (Add file path to some archive build errors) - #161373 (Allow running EC2 jobs locally)
get amount of available devices with
omp_get_num_devicesand add arg to the intrinsic for device selectionr? @ZuseZ4