Skip to content

[UR][CUDA] Add opportunistic queue serialize prop, impl for cuda #18443

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

Open
wants to merge 3 commits into
base: sycl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions unified-runtime/include/ur_print.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions unified-runtime/scripts/core/exp-launch-properties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ etors:
desc: "work-group cluster dimensions"
- name: WORK_GROUP_MEMORY
desc: "Implicit work group memory allocation"
- name: OPPORTUNISTIC_QUEUE_SERIALIZE
desc: "Whether to opportunistically execute kernel launches serially on a native queue"
--- #--------------------------------------------------------------------------
type: union
desc: "Specifies a launch property value"
Expand All @@ -56,6 +58,10 @@ members:
name: workgroup_mem_size
desc: "[in] non-zero value indicates the amount of work group memory to allocate in bytes"
tag: $X_EXP_LAUNCH_PROPERTY_ID_WORK_GROUP_MEMORY
- type: int
name: opportunistic_queue_serialize
desc: "[in] non-zero value indicates a opportunistic native queue serialized kernel"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
desc: "[in] non-zero value indicates a opportunistic native queue serialized kernel"
desc: "[in] non-zero value indicates an opportunistic native queue serialized kernel"

tag: $X_EXP_LAUNCH_PROPERTY_ID_OPPORTUNISTIC_QUEUE_SERIALIZE
--- #--------------------------------------------------------------------------
type: struct
desc: "Kernel launch property"
Expand Down
7 changes: 7 additions & 0 deletions unified-runtime/source/adapters/cuda/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp(
attr.value.cooperative = launchPropList[i].value.cooperative;
break;
}
case UR_EXP_LAUNCH_PROPERTY_ID_OPPORTUNISTIC_QUEUE_SERIALIZE: {
auto &attr = launch_attribute.emplace_back();
attr.id = CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION;
attr.value.programmaticStreamSerializationAllowed =
launchPropList[i].value.opportunistic_queue_serialize;
break;
}
case UR_EXP_LAUNCH_PROPERTY_ID_WORK_GROUP_MEMORY: {
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ TEST_P(urEnqueueKernelLaunchCustomTest, Success) {
props.push_back(coop_prop);
}

if (compute_capability >= 9.0) {
ur_exp_launch_property_t opportunistic_queue_serialize_prop;
opportunistic_queue_serialize_prop.id =
UR_EXP_LAUNCH_PROPERTY_ID_OPPORTUNISTIC_QUEUE_SERIALIZE;
opportunistic_queue_serialize_prop.value.opportunistic_queue_serialize =
1;
props.push_back(opportunistic_queue_serialize_prop);
}

ur_bool_t cluster_launch_supported = false;
ASSERT_SUCCESS(
urDeviceGetInfo(device, UR_DEVICE_INFO_CLUSTER_LAUNCH_SUPPORT_EXP,
Expand Down
Loading