-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Additional support for SYCL_DEVICE_ALLOWLIST #2483
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
Signed-off-by: Gail Lyons <[email protected]>
Added support for the case where multiple devices or platforms are listed in SYCL_DEVICE_ALLOWLIST. Also fixed a memory issue. Created a test case which tests both legal and illegal uses. Updated the documentation. Signed-off-by: Gail Lyons <[email protected]>
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.
doc changes ok
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 didn't take a look at the test yet. Though, I have some comments.
@glyons-intel |
Signed-off-by: Gail Lyons <[email protected]>
sycl/doc/EnvironmentVariables.md
Outdated
@@ -22,7 +22,7 @@ subject to change. Do not rely on these variables in production code. | |||
| SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP | Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. | | |||
| SYCL_THROW_ON_BLOCK | Any(\*) | Throw an exception on attempt to wait for a blocked command. | | |||
| SYCL_DEVICELIB_INHIBIT_NATIVE | String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. | | |||
| SYCL_DEVICE_ALLOWLIST | A list of devices and their minimum driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. | | |||
| SYCL_DEVICE_ALLOWLIST | A list of devices and their minimum driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Note that the device name, platform name and platform version are regular expressions. Special characters, such as parenthesis, must be escaped. The device driver version is treated as 4 regular expressions, separated by ".". More than one device can be specified using "|".| |
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.
The device driver version is treated as 4 regular expressions, separated by "."
does this mean '.' cannot be used in the regexp? Please add.
sycl/source/detail/platform_impl.cpp
Outdated
decDescs.emplace_back(); | ||
else if (',' != *str) | ||
throw sycl::runtime_error("Malformed device allowlist", PI_INVALID_VALUE); | ||
MatchState matchVersions(std::string Version1, std::string Version2) { |
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.
NIT: does it make sense to move matching-related code to a separate source, to avoid clutter?
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.
It does not look like this in the source. The diff makes it looks confusing. Between the pink and the green, getAllowListDesc() ends in the normal way, and there is the convertVersionString() function . Then we find matchVersions().
sycl/source/detail/platform_impl.cpp
Outdated
if (V1.size() != V2.size()) { | ||
return MatchState::NOMATCH; | ||
} |
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.
Oh, why is that?
Unspecified version elements may be set as zero. I.e. if user specifies major version only, then we can say that minor and patch version numbers are specified as zero so we still will match 3
and 3.1.10.4
.
@romanovvlad what do you think about it?
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.
Excellent point. We could be more flexible, and only worry about matching the fields that are listed. That had not occurred to me.
@romanovvlad, what do you think?
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.
Agreed to have an offline discussion.
Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
int count = 0; | ||
for (const auto &plt : platform::get_platforms()) { | ||
if (!plt.has(aspect::host)) { | ||
for (const auto &dev : plt.get_devices()) { |
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 may not have a machine with multiple GPUs in our testing infrastructure. Hence, there is a need to make sure that proper scenario is still produced.
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.
good point.
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 tested this, and it works fine.
Signed-off-by: Gail Lyons <[email protected]>
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.
RT and tests LGTM
/summary:run |
sycl/doc/EnvironmentVariables.md
Outdated
@@ -22,7 +22,7 @@ subject to change. Do not rely on these variables in production code. | |||
| SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP | Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. | | |||
| SYCL_THROW_ON_BLOCK | Any(\*) | Throw an exception on attempt to wait for a blocked command. | | |||
| SYCL_DEVICELIB_INHIBIT_NATIVE | String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. | | |||
| SYCL_DEVICE_ALLOWLIST | A list of devices and their minimum driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. | | |||
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "|".| |
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.
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "|".| | |
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "\|".| |
escape required for pipe to visualize properly
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.
Done. Thanks for catching this.
Signed-off-by: Gail Lyons <[email protected]>
/summary:run |
…_wrapper * upstream/sycl: (1021 commits) [SYCL] Enable async_work_group_copy for scalar and vector bool types (intel#2582) [SYCL] Fix element type in handler::copy (intel#2590) [NFC][SYCL] Remove unnecessary if condition (intel#2585) [SYCL][NFC] Fix SYCL lit test execution on a system w/o GPU (intel#2584) [SYCL] Add error handling for non-uniform work group size case (intel#2569) [SYCL][ESIMD] Preserve undef initializer for globals in ESIMDLowerVecArg pass (intel#2555) [SYCL] Make Level-Zero events visible on the host (intel#2576) [Driver][SYCL][NFC] Add help information for -Wno-sycl-strict (intel#2570) [SYCL] Relax test to work in Win32 environment. (intel#2580) [SYCL] Emit suppressed warnings from SYCL headers (intel#2575) [SYCL][NFC] Cover more classes with ABI tests (intel#2577) [SYCL][ESIMD] Update ESIMD tests and add raw send support. (intel#2482) [SYCL] Make ESIMD on-device tests require linux,gpu,opencl. (intel#2560) [SYCL] Release commands with no dependencies after they're enqueued (intel#2492) [SYCL] Add multi-device and multi-platform support for SYCL_DEVICE_ALLOWLIST (intel#2483) [SYCL] Try to enqueue host command depencies (intel#2561) [SYCL][ESIMD][NFC] Align namespace name with the spec guidelines (intel#2573) [SYCL][NFC] Add class layout ABI tests for memory objects (intel#2559) [SYCL] Change adress space for global variables (intel#2534) [NFC][SYCL] Fix comment. (intel#2541) ...
Update a test after llvm-project commit 379628d ("[RemoveDIs] Add flag to preserve the debug info format of input IR (#87379)", 2024-04-05). Original commit: KhronosGroup/SPIRV-LLVM-Translator@cf64d9a98402d8f
[SYCL] Additional support for SYCL_DEVICE_ALLOWLIST
Fixed a memory issue, where memory had not been allocated properly. This caused a seg fault.
Refactored from a C-style to a C++ style.
Created a test case which tests both legal and illegal uses.
Updated the documentation.