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

[Feature]: allow 0/NULL signal handles for wait operations to be no-op. #252

Open
benvanik opened this issue Oct 24, 2024 · 0 comments
Open
Assignees

Comments

@benvanik
Copy link
Contributor

Suggestion Description

HSA barrier-AND and barrier-OR packets have special handling for dependency signals that are 0/NULL.

In AND packets (2.9.8 in the spec):

If a dependent signaling pointer has the value NULL it is considered to be constant 0 in the dependency
condition evaluation.

In OR packets (2.9.9 in the spec):

If a dependent signaling pointer has the value NULL it is considered to be constant non-zero in the
dependency condition evaluation.

In both cases it effectively means that a dependent signal being 0/NULL will have that signal be ignored (in AND it will always be TRUE and in OR it will always be FALSE). The hsa_amd_signal_wait_any API and proposed hsa_amd_signal_wait_all (#250) behave differently by asserting if any signal provided is 0/NULL.

As a user of the API it'd be nice if the wait APIs behaved the same as AQL. This allows soft queues that route barrier packets to the host HSA APIs to work without the need to filter the signals from the packets and is more consistent with the HSA queue packet processing flow. Since the implementation of hsa_amd_signal_wait_any and hsa_amd_signal_wait_all are already filtering the signals it doesn't seem like it would add any additional overheads in the implementations whereas with the current behavior an application needs to filter the signals before passing them to HSA which then filters them again.

Operating System

No response

GPU

No response

ROCm Component

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants