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

Adding simplified HAL dispatch methods. #18189

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

benvanik
Copy link
Collaborator

@benvanik benvanik commented Aug 10, 2024

These combine push constants and push descriptor sets into the dispatch calls as in practice we have a near 1:1 relationship anyway. Pipeline layouts are still used in HAL interfaces to allow the compiler to map the information but are otherwise not used by the new ops.

The --iree-hal-experimental-dispatch2 flag enables emitting the new ops. Since executables no longer require pipeline layouts in this simplified model the --iree-hal-experimental-executable-create2 flag can be used to stop passing them; targets that support dispatch2 will ignore them if provided. Future changes will start to add support on targets for the simplified bindings and then remove the existing pipeline layout-based binding model as a breaking ABI change.

Current target status:

  • Local/CPU: executable-create2 and executable-dispatch2 supported (backward compat)
  • CUDA: executable-dispatch2 supported (backward compat)
  • HIP: executable-dispatch2 supported (backward compat)
  • Metal: executable-dispatch2 supported (backward compat)
  • Vulkan: executable-dispatch2 supported (backward compat)
  • WebGPU: executable-dispatch2 supported (backward compat)

Reworking the CUDA/HIP/Metal/Vulkan/WebGPU flatbuffers to support executable-create2 will be done in a follow-up.

Progress on #18154.

@benvanik benvanik added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) hal/api IREE's public C hardware abstraction layer API labels Aug 10, 2024
@benvanik benvanik requested a review from ScottTodd August 10, 2024 00:55
@benvanik benvanik force-pushed the users/benvanik/dispatch2 branch 14 times, most recently from 973eefd to d1d77f9 Compare August 12, 2024 17:25
These combine push constants and push descriptor sets into the dispatch
calls as in practice we have a near 1:1 relationship anyway. Pipeline
layouts are still used in HAL interfaces to allow the compiler to map
the information but are otherwise not used by the new ops.

The `--iree-hal-experimental-dispatch2` flag enables emitting the new ops
though no targets currently implement them. Since executables no longer
require pipeline layouts in this simplified model the
`--iree-hal-experimental-executable-create2` flag can be used to stop
passing them.

Progress on #18154.

Signed-off-by: Ben Vanik <[email protected]>
@benvanik benvanik force-pushed the users/benvanik/dispatch2 branch from d1d77f9 to 59bf417 Compare August 12, 2024 18:32
@benvanik benvanik marked this pull request as ready for review August 12, 2024 18:50
@benvanik benvanik merged commit 8dc6820 into main Aug 12, 2024
48 checks passed
@benvanik benvanik deleted the users/benvanik/dispatch2 branch August 12, 2024 20:36
rohan-tan-bhowmik pushed a commit to rohan-tan-bhowmik/iree that referenced this pull request Sep 4, 2024
These combine push constants and push descriptor sets into the dispatch
calls as in practice we have a near 1:1 relationship anyway. Pipeline
layouts are still used in HAL interfaces to allow the compiler to map
the information but are otherwise not used by the new ops.

The `--iree-hal-experimental-dispatch2` flag enables emitting the new
ops. Since executables no longer require pipeline layouts in this
simplified model the `--iree-hal-experimental-executable-create2` flag
can be used to stop passing them; targets that support dispatch2 will
ignore them if provided. Future changes will start to add support on
targets for the simplified bindings and then remove the existing
pipeline layout-based binding model as a breaking ABI change.

Current target status:
* [x] Local/CPU: executable-create2 and executable-dispatch2 supported
(backward compat)
* [x] CUDA: executable-dispatch2 supported (backward compat)
* [x] HIP: executable-dispatch2 supported (backward compat)
* [x] Metal: executable-dispatch2 supported (backward compat)
* [x] Vulkan: executable-dispatch2 supported (backward compat)
* [x] WebGPU: executable-dispatch2 supported (backward compat)

Reworking the CUDA/HIP/Metal/Vulkan/WebGPU flatbuffers to support
executable-create2 will be done in a follow-up.

Progress on iree-org#18154.
rohan-tan-bhowmik pushed a commit to rohan-tan-bhowmik/iree that referenced this pull request Sep 4, 2024
These combine push constants and push descriptor sets into the dispatch
calls as in practice we have a near 1:1 relationship anyway. Pipeline
layouts are still used in HAL interfaces to allow the compiler to map
the information but are otherwise not used by the new ops.

The `--iree-hal-experimental-dispatch2` flag enables emitting the new
ops. Since executables no longer require pipeline layouts in this
simplified model the `--iree-hal-experimental-executable-create2` flag
can be used to stop passing them; targets that support dispatch2 will
ignore them if provided. Future changes will start to add support on
targets for the simplified bindings and then remove the existing
pipeline layout-based binding model as a breaking ABI change.

Current target status:
* [x] Local/CPU: executable-create2 and executable-dispatch2 supported
(backward compat)
* [x] CUDA: executable-dispatch2 supported (backward compat)
* [x] HIP: executable-dispatch2 supported (backward compat)
* [x] Metal: executable-dispatch2 supported (backward compat)
* [x] Vulkan: executable-dispatch2 supported (backward compat)
* [x] WebGPU: executable-dispatch2 supported (backward compat)

Reworking the CUDA/HIP/Metal/Vulkan/WebGPU flatbuffers to support
executable-create2 will be done in a follow-up.

Progress on iree-org#18154.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) hal/api IREE's public C hardware abstraction layer API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants