Skip to content
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

Introduce in-order queues #193

Open
wdamon-intel opened this issue Aug 11, 2023 · 3 comments
Open

Introduce in-order queues #193

wdamon-intel opened this issue Aug 11, 2023 · 3 comments
Labels

Comments

@wdamon-intel
Copy link
Contributor

Today, Level Zero supports in-order command lists, in which appended commands are guaranteed to execute in order with respect to previously appended commands. For example,

ze_command_list_handle_t inOrderCommandList;

zeAppendKernel(inOrderCommandList);

// This copy will execute after the kernel appended above has completed.
// Consequently, there is no need for the application to add events to enforce
// any kind of dependencies.
zeAppendCopy(inOrderCommandList);

Now, say we have 2 in-order command lists, list0 and list1, each with its own set of commands, submitted to the same queue.

zeAppendKernel(list0)
zeAppendCopy(list0)
zeClosed(list0)

zeAppendKernel(list1)
zeAppendCopy(list1)
zeClosed(list1)

zeCommandQueueExecuteCommandLists(queue0, 2, {list0, list1}

or

zeCommandQueueExecuteCommandLists(queue0, 1, list0)
zeCommandQueueExecuteCommandLists(queue0, 1, list1)

In either submission scenario, the spec has no guarantee that list1 will execute in-order relative to list0. In some implementations, that may be the case, but from the point of view of spec there is no guaranteed ordering of list0 executing prior to list1. That kind of dependency must be enforced by the user.

This issue proposes that an in-order queue be added to Level Zero to compliment in-order lists. Command lists executed on an in-order queue would be guaranteed to execute in submission order without the need for user-enforced dependencies.

@wdamon-intel wdamon-intel added enhancement New feature or request API: Core labels Aug 11, 2023
@pboudier09
Copy link

when using "in order" submission queue, the "least-surprise" expectation is that everything is in order.
To achieve parallelism, the application would just use a different queue as an explicit step, instead of relying on across list parallelism in the same queue, which would have head of line blocking issues.

@MichalMrozek
Copy link

While changing the spec please ensure that in-order is kept within a queue, not within physical hardware engine.
Right now Level Zero maps multiple queues to single physical engine, which requires to submit just one barrier to make sure that everything before on a given engine is done.
We really need to allow multiple in order queues to execute concurrently on the same engine, so spec shouldn't prohibit this scenario.

@wdamon-intel
Copy link
Contributor Author

Relates to #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants