Skip to content

[UR][SYCL] Introduce UR api to set kernel args + launch in one call. #18764

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

Draft
wants to merge 21 commits into
base: sycl
Choose a base branch
from

Conversation

aarongreig
Copy link
Contributor

No description provided.

@@ -1036,6 +1037,77 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueCommandBufferExp(
return UR_RESULT_SUCCESS;
}

ur_result_t ur_queue_immediate_in_order_t::enqueueKernelLaunchWithArgsExp(
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to move most of the implementation to command_manager.cpp. If we do that, we can:

  1. avoid taking kernel->mutex twice (commandListLocked->appendKernelLaunch does that internally)
  2. avoid creating pending_allocations vector - this was only needed for urKernelSetArgMemObj where we need to delay calling zeKernelSetArgumentValue until actual kernel submission. Now, we can just call it directly.

I'm okay doing this myself, though, after this PR is merged. Just wanted to note it somewhere.

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 think I ended up doing this as part of a conflict resolution recently

@@ -2405,22 +2496,34 @@ static ur_result_t SetKernelParamsAndLaunch(
: Empty);
}

std::vector<ur_exp_kernel_arg_properties_t> UrArgs;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to keep this vector inside of the queue object so that we don't allocate it (potentially multiple times if there's a lot of arguments) for every kernel launch?
We have a similar mechanism in L0v2 adapter here:
https://github.com/oneapi-src/unified-runtime/blob/main/source/adapters/level_zero/v2/command_list_manager.hpp#L177

@aarongreig aarongreig force-pushed the aaron/enqueueKernelWithArgs branch from 76612c5 to 1554457 Compare June 4, 2025 15:52
@aarongreig aarongreig force-pushed the aaron/enqueueKernelWithArgs branch from 7a2f91c to 6123fa6 Compare June 6, 2025 11:16
@aarongreig aarongreig force-pushed the aaron/enqueueKernelWithArgs branch from 6123fa6 to cebad02 Compare June 6, 2025 16:22
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.

3 participants