Skip to content

Conversation

@vraspar
Copy link
Contributor

@vraspar vraspar commented Jul 9, 2025

Motivation and Context

Android devices (like S24) doesn't seem to allow fp16 in uniforms so the WebGPU EP has to manually handle passing an fp32 in the uniform and converting to fp16 before using.

@fs-eire
Copy link
Contributor

fs-eire commented Jul 9, 2025

Is there any existing f16 access to uniform buffer?

@fs-eire
Copy link
Contributor

fs-eire commented Jul 9, 2025

I think the patch should just work for all builds, including Linux, right? If it's already working with f16 in the old code, it should not be affected with the patched code.

@vraspar
Copy link
Contributor Author

vraspar commented Jul 15, 2025

I think the patch should just work for all builds, including Linux, right? If it's already working with f16 in the old code, it should not be affected with the patched code.

Sorry if I am misunderstanding the question, but the patch should only impact Android. I believe it should work on Linux theoretically, but wanted to minimize the impact so I limited to android

@vraspar vraspar marked this pull request as ready for review July 16, 2025 00:01
@vraspar vraspar requested a review from fs-eire July 16, 2025 00:02
@guschmue guschmue added the ep:WebGPU ort-web webgpu provider label Jul 16, 2025
@jywu-msft
Copy link
Member

@fs-eire, @vraspar since #25391 is now marked for 1.23.1 , should this one be as well?

fs-eire added a commit that referenced this pull request Jul 30, 2025
### Description

For f16 uniform variables, use u32 to bit-wise represent them.

### Motivation and Context

Some devices supports f16 in shader/storage buffer, but not in uniform
buffers. Dawn will set the f16_support to false for them. However, we
don't necessarily have to use f16 in uniform.

This change together with #25349 will enable using f16 models on some
Android devices.
@vraspar vraspar requested a review from fs-eire August 1, 2025 20:23
@fs-eire fs-eire merged commit 7b31a10 into main Aug 4, 2025
134 of 141 checks passed
@fs-eire fs-eire deleted the vraspar/android_webgpu_fp16_patch branch August 4, 2025 21:21
adrianlizarraga pushed a commit that referenced this pull request Aug 8, 2025
### Description

For f16 uniform variables, use u32 to bit-wise represent them.

### Motivation and Context

Some devices supports f16 in shader/storage buffer, but not in uniform
buffers. Dawn will set the f16_support to false for them. However, we
don't necessarily have to use f16 in uniform.

This change together with #25349 will enable using f16 models on some
Android devices.
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
### Description

For f16 uniform variables, use u32 to bit-wise represent them.

### Motivation and Context

Some devices supports f16 in shader/storage buffer, but not in uniform
buffers. Dawn will set the f16_support to false for them. However, we
don't necessarily have to use f16 in uniform.

This change together with microsoft#25349 will enable using f16 models on some
Android devices.
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…#25349)

### Motivation and Context
Android devices (like S24) doesn't seem to allow fp16 in uniforms so the
WebGPU EP has to manually handle passing an fp32 in the uniform and
converting to fp16 before using.
gedoensmax pushed a commit to gedoensmax/onnxruntime that referenced this pull request Sep 2, 2025
…#25349)

### Motivation and Context
Android devices (like S24) doesn't seem to allow fp16 in uniforms so the
WebGPU EP has to manually handle passing an fp32 in the uniform and
converting to fp16 before using.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:WebGPU ort-web webgpu provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants