-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Change priority of devices in default_selector #1264
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also want approval by @bader
This change breaks LIT tests. We need some way to use FPGA "intentionally". |
queue(accelerator_selector{}); |
SGTM, if you are willing to update the tests, so we can avoid LIT placeholders. |
Working on it. |
So, you think we should not be able to configure default selector though environment variable. Right? |
Which would you and Mike prefer? No Accel in default (and therefore no ENV override for ACC) or Accel after GPU/CPU but before host? Hmm... if accel is after host, would the override still pick ACC? That might be the best path. |
That seems to work quite well, actually. |
Accel after (lower priority than) host device makes sense to me. |
Hey, you removed the secret backdoor used to sell more FPGA in the datacenters! ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does an accelerator have lower priority than host device? According to your changes, any accelerator device won't be available at all while using default_selector since host is always presented.
IMHO, host device should be the least desired option and this should be reflected in default_selector.
Wouldn't it be better to swap priority of cpu and accelerator instead?
B/c it's unlikely that people want to accidentally stumble on an "accel" device. Putting it after host should still allow it to appear when SYCL_DEVICE_TYPE=ACC is set, right? |
968039e
to
61bfe30
Compare
Yes, it'll appear but it'll never be chosen by What about something like this:
I've just come up with this, and it can solve several issues:
|
@KarachunIvan how 'bout that? Override always wins. |
With that, it probably makes sense to just remove the if(dev.is_accelerator()) part. |
@@ -54,18 +55,22 @@ int default_selector::operator()(const device &dev) const { | |||
} | |||
} | |||
|
|||
// override always wins | |||
if (dev.get_info<info::device::device_type>() == detail::get_forced_type()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when the device type is forced we only return devices of the forced type. Thus, this is redundant. Can someone who knows the device internals better confirm that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually do that apparently. We will limit the devices enumerated to that type plus the host device since the host device must always be available. In that case, the fact that the host device is available with higher priority means it gets selected.
I agree with removing that part. |
sycl/source/device_selector.cpp
Outdated
if (dev.is_accelerator()) | ||
return 50; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unreachable code
@jbrodman @KarachunIvan ping |
@jbrodman ping |
…o accidentally stumble upon a fpga. Signed-off-by: James Brodman <james.brodman@intel.com>
Signed-off-by: James Brodman <james.brodman@intel.com>
Signed-off-by: James Brodman <james.brodman@intel.com>
Signed-off-by: James Brodman <james.brodman@intel.com>
d0fa3bb
to
e8f6a0f
Compare
Sorry, fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…_private_api * origin/sycl: (614 commits) [SYCL][Doc] Update prerequisites in GetStartedGuide (intel#1466) [SYCL][USM] Remove vestigial dead code (intel#1474) [SYCL-PTX] Fix __spirv_GroupAsyncCopy stride computation (intel#1451) [Driver][SYCL] Emit an error if c compilation is forced (intel#1438) [SYCL] Fix sycl-post-link when no split and symbols are requested. (intel#1454) [SYCL] Change priority of devices in default_selector (intel#1264) [CI] Update CODEOWNERS matching rules order (intel#1468) [SYCL] Share PFWG lambda object through shared memory (intel#1455) [CI] Fix CODEOWNERS file syntax (intel#1464) [SYCL][CUDA] Fix active context when creating base event (intel#1447) [SYCL] Diagnose implicit declaration of kernel function type (intel#1450) [BuildBot] Modify configure script (intel#1421) [SYCL] Resolve min/max conflict (intel#1339) [CI][BuildBot] Fix configure parameter to turn on/off assertions (intel#1449) [SYCL] XFAIL LIT test due to duplicate diagnostic [SYCL] Remove explicit sycl_device attribute requirement Apply more suggestions Apply suggestions Translate new set of Intel FPGA Loop Controls Translate Intel FPGA force_pow2_depth memory attribute ...
…c_abi_checks * origin/sycl: (625 commits) [SYCL][Test] Disable spec_const_redefine.cpp on all devices but HOST (intel#1488) [SYCL] Only export public API (intel#1456) [SYCL][CUDA] Fix selected_binary argument in piextDeviceSelectBinary (intel#1475) [SYCL] Enable LIT testing with CUDA BE (intel#1458) [SYCL] Fix float to half-type conversion (intel#1395) [NFC] Cleanup unneded macro from builtins implementation (intel#1445) Enable cfg-printer LLVM lit tests only if LLVM linked statically (intel#1479) [SYCL][NFC] Reflect the "allowlist" renaming in the code (intel#1480) [SYCL][Doc] Update prerequisites in GetStartedGuide (intel#1466) [SYCL][USM] Remove vestigial dead code (intel#1474) [SYCL-PTX] Fix __spirv_GroupAsyncCopy stride computation (intel#1451) [Driver][SYCL] Emit an error if c compilation is forced (intel#1438) [SYCL] Fix sycl-post-link when no split and symbols are requested. (intel#1454) [SYCL] Change priority of devices in default_selector (intel#1264) [CI] Update CODEOWNERS matching rules order (intel#1468) [SYCL] Share PFWG lambda object through shared memory (intel#1455) [CI] Fix CODEOWNERS file syntax (intel#1464) [SYCL][CUDA] Fix active context when creating base event (intel#1447) [SYCL] Diagnose implicit declaration of kernel function type (intel#1450) [BuildBot] Modify configure script (intel#1421) ...
People are unlikely to want to accidentally stumble onto the fpga.
Signed-off-by: James Brodman james.brodman@intel.com