Skip to content

[UR][L0v2] Add graph support for batched queue#21324

Open
KFilipek wants to merge 17 commits into
intel:syclfrom
KFilipek:07-graph_for_batched
Open

[UR][L0v2] Add graph support for batched queue#21324
KFilipek wants to merge 17 commits into
intel:syclfrom
KFilipek:07-graph_for_batched

Conversation

@KFilipek
Copy link
Copy Markdown
Contributor

This PR adds support for graph capture and execution in the Level Zero v2 batched queue implementation.

Changes:

  • Add command list determination mechanism that switches between immediate and regular command lists based on graph
    capture state
  • Implement previously unsupported graph API methods:
    • queueBeginGraphCapteExp() - begin graph capture
    • queueBeginCapteIntoGraphExp() - begin capture into existing graph
    • queueEndGraphCapteExp() - end graph capture
    • queueIsGraphCapteEnabledExp() - check capture status
    • enqueueGraphExp() - execute captured graph
  • Update operations to use appropriate command list and event pool during graph capture

@KFilipek KFilipek requested a review from a team as a code owner February 19, 2026 13:07
@KFilipek KFilipek marked this pull request as draft February 19, 2026 13:07
@KFilipek KFilipek self-assigned this Feb 19, 2026
@KFilipek KFilipek force-pushed the 07-graph_for_batched branch from 560edb4 to 7c9779b Compare February 19, 2026 13:12
@KFilipek KFilipek force-pushed the 07-graph_for_batched branch from 09eaf7d to 2200aa5 Compare February 20, 2026 10:43
@KFilipek KFilipek force-pushed the 07-graph_for_batched branch from 2200aa5 to 3f6298f Compare February 20, 2026 10:53
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.hpp
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.hpp
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.hpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.hpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/v2/queue_batched.hpp Outdated
@KFilipek KFilipek force-pushed the 07-graph_for_batched branch 5 times, most recently from f017edc to 2a928d5 Compare April 27, 2026 07:54
@KFilipek KFilipek marked this pull request as ready for review April 27, 2026 08:37
@KFilipek
Copy link
Copy Markdown
Contributor Author

There is the same error on sycl branch: https://github.com/intel/llvm/actions/workflows/sycl-post-commit.yml

@KFilipek KFilipek force-pushed the 07-graph_for_batched branch 2 times, most recently from c851cd3 to 91ef91a Compare April 29, 2026 09:39
@EuphoricThinking
Copy link
Copy Markdown
Contributor

Regarding this comment, I see that the other queues, the immediate and out of order, do not handle the situation when queueFinish is called with the graph capture being active. Could you address this issue in future PRs?

KFilipek added 14 commits May 5, 2026 11:54
During graph capture, commands are appended to an immediate command list
instead of the regular batch.
Before beginning graph capture, enqueue the current batch (regular command
list) to preserve operation order. This ensures the queue is empty before
switching to immediate list mode for graph capture, similar to command
buffer handling.

Apply to both queueBeginGraphCapteExp and queueBeginCapteIntoGraphExp.
During graph capture, operations are recorded to the immediate command
list. Synchronization and flushing operations don't apply to graph
recording, so return early when graph capture is active.

Also added a clarifying comment in queueIsGraphCapteEnabledExp about
the returned command list.
This ensures consistency with other enqueue methods and provides proper
context for event handling during graph capture.
@KFilipek KFilipek force-pushed the 07-graph_for_batched branch from 91ef91a to e2d1afb Compare May 5, 2026 09:55
@KFilipek
Copy link
Copy Markdown
Contributor Author

Regarding this comment, I see that the other queues, the immediate and out of order, do not handle the situation when queueFinish is called with the graph capture being active. Could you address this issue in future PRs?

Sure, I can handle it.

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.

6 participants