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

[UR] Update spec to make kernel argument validation in urEnqueueKernelLaunch optional #17068

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

RossBrunton
Copy link
Contributor

Migrated from oneapi-src/unified-runtime#2564

Several adapters don't support validating kernel signatures when
enqueued. To handle this, we now allow urEnqueueKernelLaunch to return
SUCCESS even when parameters are invalid.

Several adapters don't support validating kernel signatures when
enqueued. To handle this, we now allow urEnqueueKernelLaunch to return
`SUCCESS` even when parameters are invalid.

Some tests have also been updated. The CUDA adapter has also been
updated to handle invalid arguments.
@RossBrunton RossBrunton changed the title [UR] Update spec to make kernel validation optional [UR] Update spec to make kernel argument validation in urEnqueueKernelLaunch optional Feb 24, 2025
/// @details
/// - Adapters may perform validation on the number of arguments set to the
/// kernel, but are not required to do so and may return
/// `::UR_RESULT_SUCCESS` even for invalid invocations.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should just say that passing incorrect kernel arguments is "undefined behavior" or something like that.

As shown in the test, if an adapter is unable to validate the arguments it's unlikely to be able to gracefully return success as well.

If we want to keep some level of argument validation, maybe it could be guarded behind a device property?

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'm not sure the benefits of marking it as UB are worthwhile, especially since I don't think we have (explicit) UB anywhere else in UR. Cuda seems to be the only target with major issues with invalid arguments, do you see that resulting in UB?

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