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

Improve specification of command-buffer update errors #2462

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

EwanC
Copy link
Contributor

@EwanC EwanC commented Dec 13, 2024

The UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP query no longer exists, so error defined for trying to make an updatable command-buffer when a device doesn't support it needs reworded to say if no capabilities are supported.

Additionally, for each individual update capability, specify that an error is thrown if update is attempted using that characteristic.

UR CTS added to verify the above clarifications.

DPC++ PR intel/llvm#16383

@github-actions github-actions bot added loader Loader related feature/bug conformance Conformance test suite issues. specification Changes or additions to the specification experimental Experimental feature additions/changes/specification opencl OpenCL adapter specific issues command-buffer Command Buffer feature addition/changes/specification labels Dec 13, 2024
@EwanC EwanC force-pushed the cmd-buf_update_errors branch from 664febd to c166e74 Compare December 16, 2024 11:27
@EwanC EwanC changed the title Improve command-buffer update error code wording Improve specification of command-buffer update errors Dec 16, 2024
@EwanC EwanC force-pushed the cmd-buf_update_errors branch from c166e74 to 00ca890 Compare December 16, 2024 17:11
EwanC added a commit to reble/llvm that referenced this pull request Dec 16, 2024
Bump UR tag to
[Improve specification of command-buffer update errors](oneapi-src/unified-runtime#2462)
@EwanC EwanC marked this pull request as ready for review December 17, 2024 16:34
@EwanC EwanC requested review from a team as code owners December 17, 2024 16:34
@EwanC EwanC requested a review from Bensuo December 17, 2024 16:34
@@ -1203,11 +1204,15 @@ params:
desc: "[in] Struct defining how the kernel command is to be updated."
returns:
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "If update functionality is not supported by the device."
- "If $X_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_KERNEL_ARGUMENTS is not supported by the device, but any of `pUpdateKernelLaunch->numNewMemObjArgs`, `pUpdateKernelLaunch->numNewPointerArgs`, or `pUpdateKernelLaunch->numNewValueArgs` are not zero."
- "If $X_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_LOCAL_WORK_SIZE is not supported by the device but `pUpdateKernelLaunch->pNewLocalWorkSize` is not nullptr."
Copy link
Contributor

Choose a reason for hiding this comment

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

In the update descriptor wording we have the following:

If pNewGlobalWorkSize is set and pNewLocalWorkSize is nullptr,
then the runtime implementation will choose the local work size.

If the device doesn't support UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_LOCAL_WORK_SIZE are we just assuming that the implementation won't generate a new local work size here (which may be different from the previous value) or that it would do that but throw an error because updating the local size is not possible?

If the former we should probably change that quoted wording to reflect that it is not guaranteed to generate a new local size if not supported, or document the latter error here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good shout, I went with an error because the old local size might not be compatable with the new global size if we can't update it under the hood.

The `UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP` query no longer
exists, so error defined for trying to make an updatable command-buffer
when a device doesn't support it needs reworded to say if no
capabilities are supported.

Additionally, for each individual update capability, specify that
an error is thrown if update is attempted using that characteristic.

UR CTS added to verify this.
Return unsupported when a device doesn't support local memory update
but attempts the following usage

> If pNewGlobalWorkSize is set and pNewLocalWorkSize is nullptr,
then the runtime implementation will choose the local work size.
@EwanC EwanC force-pushed the cmd-buf_update_errors branch from 00ca890 to 7d4d09c Compare December 20, 2024 15:56
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Putting back into draft because I think we need more granular checking in this adapter for the unsupported cases in update()

@EwanC EwanC marked this pull request as draft December 20, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-buffer Command Buffer feature addition/changes/specification conformance Conformance test suite issues. experimental Experimental feature additions/changes/specification loader Loader related feature/bug opencl OpenCL adapter specific issues specification Changes or additions to the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants