Skip to content

Conversation

@rdeodhar
Copy link
Contributor

@rdeodhar rdeodhar commented May 22, 2023

This change adds the queue properties immediate_command_list and no_immediate_command_list to enable overriding the queue submission defaults.

@rdeodhar rdeodhar temporarily deployed to aws May 23, 2023 00:02 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws May 23, 2023 06:35 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws May 23, 2023 07:07 — with GitHub Actions Inactive
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_LOW = (1 << 5);
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_PRIORITY_HIGH = (1 << 6);
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_BATCHED_SUBMISSION = (1 << 7);
constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_FLAG_IMMEDIATE_SUBMISSION = (1 << 8);
Copy link
Contributor

@alycm alycm May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this PR changes pi.h then it will require UR changes to match this.

As stated in a comment on another PR, documentation on how to add experimental features is being written here oneapi-src/unified-runtime#546

But this change may be small enough and concrete enough to skip experimental and we just add it to UR directly?

You can ask us (@alycm, @jandres742, @kbenzie) any questions and we'll help you out.

@jbrodman
Copy link
Contributor

How is this supposed to work on non-Intel GPUs?

@rdeodhar
Copy link
Contributor Author

The queue properties are intended to be a hint to the implementation. On L0, where we have different submission modes, it is clear what to do. On other platforms the implementation may ignore these hints if they cannot be mapped to something useful.

@rdeodhar rdeodhar temporarily deployed to aws June 27, 2023 23:01 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws June 27, 2023 23:42 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws June 28, 2023 00:11 — with GitHub Actions Inactive
else if (isImmediateSubmission())
UsingImmCmdLists = true;
else
UsingImmCmdLists = Device->useImmediateCommandLists();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the environment variable should have priority over the flags, because that way, the user can force one or the other behavior w/o having to change the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the code, if it uses an explicit queue property, should win. Only if the queue property is not used should we rely on env vars.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdeodhar : but let's say you have the binary for a customer application taht uses batched submission, and you want to see if a functional or performance bug is gone if you used immediate submission? by having the environment variable always taking priority, you can change the behavior and debug the issue w/o needing a new binary.

same from point of view of user: Imagine the user has a very large codebase, where immediate submission is used, and they want just to see what would happen if batched submission were used. They could go and change all the codebase, but that would mean time refactoring, compiling and executing, while with the environment variable, they can test and see any benefits or problems before investing time changing the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your reasoning but when something is explicitly (hard) coded in the program it should not be subject to over-ride through env vars. Do you know of any other SYCL properties that are subject to over-ride through env vars?
A secondary question is whether the env var has been explicitly set or default. Should even a default setting of the env var over-ride the code? What about explicit setting to what was already the default setting? Should that be considered an explicit setting and over-ride what is in the code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdeodhar for the second question, we would need to have a default value of -1 for the environment variable, so something like this:

if (environment variable != -1) {
   set queue mode to value set by environment variable;
} else if (batched mode selected by application) {
   set batched mode
} else if (immediate mode selected by application) {
   set immediate mode
} else {
   set defaults // which currently is for instance immediate mode for PVC and batched for others
}

so again, this is mostly about helping with the debug and programmability. but it is not a hard blocker. If you think it is better to have priority in the setting from application, it is good too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler convention is to honor explicit coding and allow env var control over other behavior. So we'll stick with the way its done now.

@rdeodhar rdeodhar temporarily deployed to aws June 28, 2023 00:52 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws June 29, 2023 18:56 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws June 29, 2023 21:28 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws June 30, 2023 23:54 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 1, 2023 01:13 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 4, 2023 19:41 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 4, 2023 23:44 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 5, 2023 00:22 — with GitHub Actions Inactive
@rdeodhar rdeodhar requested review from a team as code owners July 10, 2023 21:55
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

bool SubmissionSeen = false;
if (PropList
.has_property<ext::oneapi::property::queue::batched_submission>()) {
if (SubmissionSeen) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be redundant here. it is the first place Submission seen could be set to true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. Removed unneeded code.

@rdeodhar rdeodhar temporarily deployed to aws July 11, 2023 20:34 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 11, 2023 21:22 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 17:27 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 18:27 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 19:20 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 20:46 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 21:26 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 21:32 — with GitHub Actions Inactive
@rdeodhar rdeodhar requested a review from gmlueck July 12, 2023 23:24
@rdeodhar rdeodhar temporarily deployed to aws July 12, 2023 23:37 — with GitHub Actions Inactive
@rdeodhar rdeodhar temporarily deployed to aws July 13, 2023 00:23 — with GitHub Actions Inactive
@rdeodhar rdeodhar requested a review from gmlueck July 13, 2023 15:32
@rdeodhar rdeodhar temporarily deployed to aws July 13, 2023 16:17 — with GitHub Actions Inactive
Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extension spec LGTM.

@rdeodhar rdeodhar temporarily deployed to aws July 13, 2023 17:15 — with GitHub Actions Inactive
@againull againull merged commit 2f2560f into intel:sycl Jul 13, 2023
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
This change adds the queue properties immediate_command_list and
no_immediate_command_list to enable overriding the queue submission
defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants