-
Notifications
You must be signed in to change notification settings - Fork 754
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
base: sycl
Are you sure you want to change the base?
Conversation
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.
604c599
to
3fc0d49
Compare
/// @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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
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.