Skip to content

[webgpu] support bool for binary operators - #25674

Merged
Yulong Wang (fs-eire) merged 1 commit into
mainfrom
fs-eire/support-bool-webgpu-binary-ops
Aug 8, 2025
Merged

Yulong Wang (fs-eire) merged 1 commit into
mainfrom
fs-eire/support-bool-webgpu-binary-ops

Conversation

@fs-eire

Copy link
Copy Markdown
Contributor

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.

@xhcao

xhcao commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

Yulong Wang (@fs-eire) I had integrated and tested the cases on my side, the PR worked well, thanks.

@fs-eire
Yulong Wang (fs-eire) merged commit 6e2a287 into main Aug 8, 2025
@fs-eire
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants