-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Implement new env var SYCL_DEVICE_FILTER #2239
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
Conversation
This new env var takes a list of triples {device_type, backend, device_num} 1. This list means SYCL_RT will only use those specified devices. 2. This list also limits related plugins to be loaded by SYCL RT. This PR only implemented new env var and selective plugin loading (intel#2) Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
I'm not a big fan of the syntax. I think the name of the environment variable should at least be changed to |
OK, so it is completely unrelated with the obvious https://llvm.org/doxygen/classllvm_1_1Triple.html |
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Co-authored-by: Romanov Vlad <[email protected]>
Co-authored-by: Romanov Vlad <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
…into sycl-device-triple
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Co-authored-by: vladimirlaz <[email protected]>
Co-authored-by: vladimirlaz <[email protected]>
Co-authored-by: vladimirlaz <[email protected]>
Co-authored-by: vladimirlaz <[email protected]>
Hi @vladimirlaz, Did I address all your feedback? |
Co-authored-by: vladimirlaz <[email protected]>
Co-authored-by: Vyacheslav Klochkov <[email protected]>
f3c6387
Signed-off-by: Byoungro So <[email protected]>
Changes look good to me. |
I am still looking at the failure. Somehow, after I commit your suggested code change, it does not work. |
Signed-off-by: Byoungro So <[email protected]>
Sorry, the lastest code change cancelled your approvals. |
* upstream/sycl: (405 commits) [SYCL] Implement new env var SYCL_DEVICE_FILTER (intel#2239) [Driver][SYCL] Make /MD the default for -fsycl (intel#2478) [SYCL]: basic support of contexts with multiple devices in Level-Zero (intel#2440) [SYCL] Fix LIT regression after 9dd18ca (intel#2481) [SYCL][L0] Kernel Destroy in piKernelRelease (intel#2475) [SYCL] Emit an aliased function only if it is used (intel#2430) [Driver][SYCL] Add defaultlib directive for sycl lib (intel#2464) [Driver][SYCL] Improve situations where .exe is added for AOT tools (intel#2467) [SYCL][L0]: Check Queue refcnt prior to using members in event wait/release (intel#2471) [SYCL] Unroll several loops in __init method accessor class (intel#2449) [SYCL][Doc] Add link to use pinned memory spec (intel#2463) [SYCL] Link SYCL device libraries by default. (intel#2400) Revert "[SYCL] XFAIL test blcoking pulldown" Avoid usage of deprecated "VectorType::getNumElements" (intel#737) Fix nullptr dereference (intel#741) Do not translate arbitrary precision operations without corresponding extensions (intel#714) Add Constrained Floating-Point Intrinsics support [SYCL] Take into account auxiliary cmake options for Level Zero loader [InstCombine] improve fold of pointer differences [InstCombine] add ptr difference tests; NFC ...
…e extension doc (#2239) Original commit: KhronosGroup/SPIRV-LLVM-Translator@55966ee
Add guards to InvalidNullPointerPlatform
This PR implemented the new env var SYCL_DEVICE_FILTER to allow users to specify which specific device they want to use in all different device selectors. (not the scope of this PR, implemented in #2241)
This env var is also used to load only related plugins in SYCL RT. (This PR implemented only this)
SYCL_DEVICE_FILTER=backend:device_type:device#, where device_type={host,cpu,gpu,acc,*}, backend={opencl,level_zero,cuda,*}, device#={int}
All three fields are optional, but at least one entry should be present.
Device# field is a relative index in the devices returned from platform::get_device() call. Users can use a utility tool "sycl-ls" to find the relative index, too. Once Device# is specified, the program behavior may not be the same in different systems since the relative index varies in different system.
It can list any number of triples separated by commas(,). For example, SYCL_DEVICE_FILTER=cpu,level_zero:gpu,cuda:gpu:0
For convenience, we also support ‘*’ to indicate all possible options of the triple field.
For example, “SYCL_DEVICE_FILTER=opencl:*” indicates that all different device_types that supports opencl.
To request level_zero GPU + opencl CPU, “SYCL_DEVICE_FILTER=opencl:cpu,level_zero:gpu” can be used.
HOST device is always available by default no matter how SYCL_DEVICE_FILTER is set.
This env var will affect all known device selectors since this env var will limit loading only specified plugins into the SYCL RT. For example, SYCL_DEVICE_FILTER=level_zero and cpu_selector will throw an error because the CPU device is not supported by the level_zero backend. To use both CPU device and Level_Zero GPU, one can use SYCL_DEVICE_FILTER=cpu,level_zero.