Repository navigation
[webgpu] support bool for binary operators - #25674
Merged
Yulong Wang (fs-eire) merged 1 commit intoAug 8, 2025
Merged
Conversation
Contributor
|
Yulong Wang (@fs-eire) I had integrated and tested the cases on my side, the PR worked well, thanks. |
Guenther Schmuelling (guschmue)
approved these changes
Aug 8, 2025
Yulong Wang (fs-eire)
deleted the
fs-eire/support-bool-webgpu-binary-ops
branch
August 8, 2025 01:12
Sanket Kale (sanketkaleoss)
pushed a commit
to sanketkaleoss/onnxruntime
that referenced
this pull request
Aug 11, 2025
### Description Currently boolean types are not supported as inputs of binary operators in WebGPU. This change adds the support. ### Motivation and Context In WebGPU, `bool` is not a valid type for storage. To make it work with a storage buffer, we have to store a `u32` value representing 4 bool values. To make it work with the existing WebGPU framework, we need to ensure all modes of the binary operator program always use components == 4 for bool.
Maximilian Müller (gedoensmax)
pushed a commit
to gedoensmax/onnxruntime
that referenced
this pull request
Sep 2, 2025
### Description Currently boolean types are not supported as inputs of binary operators in WebGPU. This change adds the support. ### Motivation and Context In WebGPU, `bool` is not a valid type for storage. To make it work with a storage buffer, we have to store a `u32` value representing 4 bool values. To make it work with the existing WebGPU framework, we need to ensure all modes of the binary operator program always use components == 4 for bool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently boolean types are not supported as inputs of binary operators in WebGPU.
This change adds the support.
Motivation and Context
In WebGPU,
boolis not a valid type for storage. To make it work with a storage buffer, we have to store au32value representing 4 bool values.To make it work with the existing WebGPU framework, we need to ensure all modes of the binary operator program always use components == 4 for bool.