-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL] Add queue properties to select submission mode #9554
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ad42267
[SYCL] [L0] Add queue property to select submission mode.
rdeodhar 9890710
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar 950fd8d
Updated symbols and doc.
rdeodhar 2be518a
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar ebed42e
Changed queue property names.
rdeodhar 6403a94
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar 9b7c212
Updated linux symbol file.
rdeodhar b5c7d62
Fixes for internal submission mode selection.
rdeodhar 788d0e0
Updated windows symbol file.
rdeodhar af9aead
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar 9de70d1
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar d4f91f5
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar fd269cd
Adjust event scope management.
rdeodhar e0067ff
Changed extension to be intel-only.
rdeodhar 4f2e380
Changed name of property.
rdeodhar b28e485
Merge branch 'sycl' of https://github.com/intel/llvm into qprop
rdeodhar 7455f67
Changed name of property.
rdeodhar db89376
Updated documentation and changed macro name.
rdeodhar a3c473f
Updated doc.
rdeodhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
157 changes: 157 additions & 0 deletions
157
sycl/doc/extensions/supported/sycl_ext_intel_queue_immediate_command_list.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| = sycl_ext_intel_queue_immediate_command_list | ||
|
|
||
| :source-highlighter: coderay | ||
| :coderay-linenums-mode: table | ||
|
|
||
| // This section needs to be after the document title. | ||
| :doctype: book | ||
| :toc2: | ||
| :toc: left | ||
| :encoding: utf-8 | ||
| :lang: en | ||
| :dpcpp: pass:[DPC++] | ||
|
|
||
| // Set the default source code type in this document to C++, | ||
| // for syntax highlighting purposes. This is needed because | ||
| // docbook uses c++ and html5 uses cpp. | ||
| :language: {basebackend@docbook:c++:cpp} | ||
|
|
||
|
|
||
| == Notice | ||
|
|
||
| [%hardbreaks] | ||
| Copyright (C) 2023-2023 Intel Corporation. All rights reserved. | ||
|
|
||
| Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks | ||
| of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by | ||
| permission by Khronos. | ||
|
|
||
|
|
||
| == Contact | ||
|
|
||
| To report problems with this extension, please open a new issue at: | ||
|
|
||
| https://github.com/intel/llvm/issues | ||
|
|
||
|
|
||
| == Dependencies | ||
|
|
||
| This extension is written against the SYCL 2020 revision 7 specification. All | ||
| references below to the "core SYCL specification" or to section numbers in the | ||
| SYCL specification refer to that revision. | ||
|
|
||
|
|
||
| == Status | ||
|
|
||
| This extension is implemented and fully supported by {dpcpp}. | ||
|
|
||
| However, the immediate command list feature (which is exposed by this extension) | ||
| has been well-tested only on Intel (R) Data Center Max Series GPUs (aka PVC). | ||
| Use of this extension to specify immediate command lists is not recommended | ||
| for other Intel GPUs. | ||
|
|
||
|
|
||
| == Backend support status | ||
|
|
||
| The properties added by this extension are a hint, which all backends accept. | ||
| However, in the current {dpcpp} implementation, the hint is only meaningful | ||
| on the Level Zero backend. | ||
|
|
||
| == Overview | ||
|
|
||
| When commands are submitted to a SYCL queue that uses the Level Zero backend, | ||
| those commands can be submitted to the hardware in one of two ways: | ||
| either through an immediate command list or through a standard command queue. | ||
| Commands submitted through an immediate command list are immediately submitted | ||
| to the device while commands submitted through a standard command queue may be | ||
| batched with other commands before they are submitted. By default the | ||
| implementation chooses a method that works best for most workloads. | ||
|
|
||
| In most cases, applications should rely on the default behavior. | ||
| However, sometimes it is advantageous for the application to choose one method | ||
| or the other. This extension provides a way for applications to select either | ||
| of these two methods via a queue property. | ||
|
|
||
| For example, when kernel runtimes are very short, the submission time on the | ||
| host may be as long or longer than the actual runtime of the kernel. In this | ||
| case, doing batched submissions may be preferable so that the submission | ||
| overhead is amortized over a number of kernel executions. | ||
|
|
||
|
|
||
| == Specification | ||
|
|
||
| === Feature test macro | ||
|
|
||
| This extension provides a feature-test macro as described in the core SYCL | ||
| specification. An implementation supporting this extension must predefine the | ||
| macro `SYCL_EXT_INTEL_QUEUE_IMMEDIATE_COMMAND_LIST` to one of the values | ||
| defined in the table below. Applications can test for the existence of this | ||
| macro to determine if the implementation supports this feature, or | ||
| applications can test the macro's value to determine which of the | ||
| extension's features the implementation supports. | ||
|
|
||
| [%header,cols="1,5"] | ||
| |=== | ||
| |Value | ||
| |Description | ||
|
|
||
| |1 | ||
| |Initial version of this extension. | ||
| |=== | ||
|
|
||
| === New queue properties | ||
| This extension adds the following new properties that can be used when | ||
| constructing a queue object. | ||
|
|
||
| ```c++ | ||
| namespace sycl::ext::intel::property::queue { | ||
|
|
||
| struct immediate_command_list {}; | ||
| struct no_immediate_command_list {}; | ||
|
|
||
| } // namespace sycl::ext::intel::property::queue | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| Both properties are hints, which are ignored unless the backend is Level Zero. | ||
|
|
||
| The property `immediate_command_list` requests that the implementation use an | ||
| immediate command list when commands are submitted to this queue. As a result, | ||
| these commands are submitted immediately to the device. | ||
|
|
||
| The property `no_immediate_command_list` requests that the implementation use | ||
| a standard command queue instead of an immediate command list. As a result, | ||
| commands submitted to this queue may be batched with other commands before | ||
| being submitted to the device. | ||
|
|
||
| These two properties are mutually exclusive. Constructing a queue with both | ||
| properties causes the constructor to throw a synchronous exception with | ||
| the `errc::invalid` error code. | ||
|
|
||
rdeodhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| == Example | ||
| ```c++ | ||
| #include <sycl/sycl.hpp> | ||
|
|
||
| namespace syclintel = sycl::ext::intel; | ||
|
|
||
| int main() { | ||
| // Use immediate command lists | ||
| sycl::queue q1{syclintel::property::queue::immediate_command_list{}}; | ||
| ... | ||
|
|
||
| // Do not use immediate command lists | ||
| sycl::queue q2{syclintel::property::queue::no_immediate_command_list{}}; | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| == Interaction with the SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS environment variable | ||
|
|
||
| {dpcpp} supports an environment variable named | ||
| SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS which also controls | ||
| the use of immediate command lists in SYCL queues. When that | ||
| environment variable is used in conjunction with the properties in this | ||
| extension, the properties take precedence. The environment variable has | ||
| no effect on queues constructed with one of these properties, however it | ||
| still affects queues that were not constructed with either of these properties. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.