Repository navigation
Implement filter selector strings without the DPC++ extension - #2420
ndgrigorian wants to merge 6 commits into
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2420/index.html |
bd44ff9 to
24037ba
Compare
24037ba to
d737a4e
Compare
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
One comment on the tests below:
d737a4e to
08612c3
Compare
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
No more comments from my side
LGTM
Thank you @ndgrigorian !
08612c3 to
3582824
Compare
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
LGTM
Thank you @ndgrigorian!
…om DPCTL Implement SYCL filter selector strings with the SYCL 2020 callable device selector API, adapted from IntelPython/dpctl#2420, instead of the deprecated sycl::ext::oneapi::filter_selector extension, which fails the build with -Werror on newer ICX. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zachary Corio <zachary.corio@intel.com>
|
Copy-pastying a comment from the bot in sklearnex PR uxlfoundation/scikit-learn-intelex#3574 that copies this:
I haven't verified whether the comment is right or not. |
…sing from DPCTL (#3574) * Replace deprecated sycl filter_selector with filter string parsing from DPCTL Implement SYCL filter selector strings with the SYCL 2020 callable device selector API, adapted from IntelPython/dpctl#2420, instead of the deprecated sycl::ext::oneapi::filter_selector extension, which fails the build with -Werror on newer ICX. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zachary Corio <zachary.corio@intel.com> * Include charconv only in the data-parallel build, where it is available and used The filter selector code using these headers is compiled only under ONEDAL_DATA_PARALLEL; unconditional includes broke the host backend build with GCC versions that lack charconv. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zachary Corio <zachary.corio@intel.com> * Parse device numbers without std::from_chars The CI toolchain's libstdc++ predates charconv, so neither GCC nor ICX (which uses the system libstdc++ on Linux) can include it. A manual digit loop with an overflow guard has the same semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zachary Corio <zachary.corio@intel.com> --------- Signed-off-by: Zachary Corio <zachary.corio@intel.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3582824 to
a332822
Compare
It was correct but DPC++ did the same. I adjusted it to no longer work. |
DPC++ 2026.2 deprecates sycl::ext::oneapi::filter_selector. dpctl_filter_selector now parses filter strings and matches devices itself, keeping the extension's syntax and default_selector_v ranking. Device numbers are resolved once at construction, counted the same way as SyclDevice.filter_string. The selector is now stateless, so DPCTLDeviceSelector_Score gives correct results for numbered filters, and overlapping filters such as "0,1" select devices 0 and 1.
SyclDevice.filter_string and get_filter_string used to return "unknown" for backends and device types without a filter string spelling.
The filter selector accepts "custom", and filter_string of a custom device is "backend:custom:N".
Catches selectors whose scores depend on earlier calls, even with one device.
A filter made only of ":" separators, such as ":" or "gpu:0,:", matched any device, so a missing gpu:0 fell back to whatever else was available. Such filters are now malformed.
a332822 to
15bc7de
Compare
This PR proposes a dpctl implementation of filter selector strings, as
sycl::ext::oneapi::filter_selectoris deprecated in DPC++ 2026.2.dpctl_filter_selectornow parses filter strings and matches devices itself, keeping the syntax of the extension and ranking matches bydefault_selector_vDevice numbers are resolved when the selector is created, so
DPCTLDeviceSelector_Scoregives correct results for numbered filters, and a list of filters such as"0,1"now selects devices 0 and 1 (the extension selected devices 0 and 2)This PR also adds
customas a device type in filter strings, so thatSyclDevice(d.filter_string) == dholds for custom devices, and makesSyclDevice.filter_stringandSyclDevice.get_filter_stringraiseValueErrorfor backends and device types that can not be expressed in a filter string, instead of returning a string containingunknown