Skip to content

[SYCL][Graph] Introduce native recording mode feature#21626

Open
adamfidel wants to merge 61 commits intointel:syclfrom
adamfidel:pablo/graph-native-recording-prototype-v2-rebase
Open

[SYCL][Graph] Introduce native recording mode feature#21626
adamfidel wants to merge 61 commits intointel:syclfrom
adamfidel:pablo/graph-native-recording-prototype-v2-rebase

Conversation

@adamfidel
Copy link
Member

Native recording enables SYCL Graph to directly leverage the new Unified Runtime graph API (and thus the native backend graph API, e.g. level zero graph) during record-and-replay, rather than going through Unified Runtime’s Command-Buffer abstraction. When native recording is enabled, all commands, whether submitted via SYCL or directly via a backend such as level zero, are captured by the backend and finalized into an executable native graph.

It is enabled with a new enable_native_recording property being passed to the property list.

exp_ext::command_graph graph{
    queue.get_context(), queue.get_device(),
    {exp_ext::property::graph::enable_native_recording{}}};

There are some functional limitations of the native mode, which are outlined in the changes to the SYCL Graph spec in PR #21616.

Related PRs:

@adamfidel adamfidel requested review from a team as code owners March 25, 2026 14:20
Pablo Reble and others added 27 commits March 25, 2026 14:26
* add empty method on graph

* applied review comments

* windows ABI update

* Linux ABI change
* Add native recording print graph functionality

* Update doxygen comment for print graph

Co-authored-by: Adam Fidel <adam.fidel@intel.com>

---------

Co-authored-by: Adam Fidel <adam.fidel@intel.com>
Co-authored-by: Adam Fidel <adam.fidel@intel.com>
@adamfidel adamfidel force-pushed the pablo/graph-native-recording-prototype-v2-rebase branch from bf2fe13 to 23784d7 Compare March 25, 2026 21:31
DeviceImpl.getHandleRef(),
UR_DEVICE_INFO_GRAPH_RECORD_AND_REPLAY_SUPPORT_EXP,
sizeof(ur_bool_t), &SupportsGraphRecordReplay, nullptr);
if (Result == UR_RESULT_SUCCESS && !SupportsGraphRecordReplay) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to handle an error here?

};

/// Get whether native recording is enabled for this graph.
/// @return True if native recording is enabled, false otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing param description.

Comment on lines 53 to 58
if (queueType == QUEUE_IMMEDIATE) {
zeFlags |= ZEX_COUNTER_BASED_EVENT_FLAG_IMMEDIATE;
} else {
zeFlags |= ZEX_COUNTER_BASED_EVENT_FLAG_NON_IMMEDIATE;
}
// Always set non immediate flag for compatibility with graph record & replay
zeFlags |= ZEX_COUNTER_BASED_EVENT_FLAG_NON_IMMEDIATE;

Copy link
Contributor

Choose a reason for hiding this comment

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

We should check if this doesn't have performance implications for the eager path. I suggest creating a draft PR with just this change and running perf CI.

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