Intent to Ship: WebGPU f16 support

314 views
Skip to first unread message

Ryan Harrison

unread,
Oct 5, 2023, 4:17:23 PM10/5/23
to blin...@chromium.org, Corentin Wallez
+cc cwallez, since he is the WebGPU lead, and can respond authoritatively if I am OOO

Contact emails

rhar...@chromium.org

Explainer

None

Specification

https://www.w3.org/TR/webgpu/#shader-f16

Summary

Allows for the use of the half-precision floating-point type f16 in WebGPU shaders (WGSL). Developers can use the 'shader-f16' feature from the WebGPU spec and the 'f16' extension from the WGSL spec to access 16-bit floating point variables and APIs in their shaders.



Blink component

Internals>GPU>Dawn

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: Positive Mozilla has already implemented this feature.

WebKit: Positive (https://bugs.webkit.org/show_bug.cgi?id=254668)

Web developers: Positive f16 support in general has been requested feature in multiple different web runtimes/frameworks, e.g. https://github.com/microsoft/onnxruntime/issues/9758 and http://tc39.es/proposal-float16array/ From the initial proposal, https://github.com/gpuweb/gpuweb/issues/658, there were multiple benchmarks/demoes that indicate a substantial performance benefit shown in demos/tests, ~25% if ALU bound, and upto 50% if memory bound. TF.js has been investigating using f16 in WebGPU, https://github.com/gpuweb/gpuweb/issues/658#issuecomment-606492757 and already has it available in the WebGL implementation TF.js has significant improvements from forcing using Half Float (the GL equivalent feature), https://github.com/tensorflow/tfjs/issues/1047 The Dawn team has interacted with multiple internal and external partners that have indicated that f16 support is an important feature for them to get the performance needed to adopt WebGPU

Other signals: Intel has dedicated significant resources to help implement f16 in Dawn/Tint, and write proper testing coverage in the CTS.

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None at the moment, WebGPU currently does not ship on Android WebView. Parallel work is occuring to launch WebGPU on Android.



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

No

All platforms will eventually have support. Will immediately be available on Mac and Chrome OS, since those are platforms already support WebGPU. Windows support depends on internal changes to use DXC, which are in progress, so f16 will become availabe once that is finished. Linux and Android are planned to have WebGPU support in the future, so feature will become available when WebGPU does.



Is this feature fully tested by web-platform-tests?

No

WebGPU/WGSL have a conformance test suite (https://github.com/gpuweb/cts) that is regularly pulled into Chromium and part of the testing of Dawn/Tint in Chromium. Test coverage for execution of f16 operations has been implemented, https://github.com/gpuweb/cts/issues/1248. Additional testing is in development.



Flag name on chrome://flags

None

Finch feature name

WebGPUExposeShader16

Requires code in //chrome?

False

Availability expectation

Feature is available only in Chromium browsers for the near future, on the order of months. Other browsers intend to ship WebGPU and f16 support, but don't have specified timelines.

Adoption expectation

Feature is used by specific partner(s) to provide functionality within 12 months of launch in Chrome.

Adoption plan

Multiple partners are actively developing products/features that will use f16 in WebGPU.

Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?

No

Estimated milestones

Shipping on desktop120


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None, f16 has been landed in the WebGPU and WGSL specs https://github.com/gpuweb/gpuweb/pull/2696 (There is some discussion about whether or not explicit enabling of extensions should be required. Currently it is, so If this changes existing shaders would be fine because the desire is to make enabling optional, not removing the mechanism entirely).

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5180552617656320

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Oct 11, 2023, 10:52:51 AM10/11/23
to Ryan Harrison, blin...@chromium.org, Corentin Wallez
Please fill out the 5 other review categories (security, privacy, etc) in chromestatus. Those will need to be started before the API owners can review.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM4DYDaCcxwhdQb%2B%3DoZcAyd1-o3tU3qNu2Rbv5p0V95nGMeKQg%40mail.gmail.com.

Corentin Wallez

unread,
Oct 11, 2023, 2:10:44 PM10/11/23
to Chris Harrelson, Ryan Harrison, blin...@chromium.org
You mention 5 reviews, there's Security / Privacy / TAG but I'm not sure what the others are. We believe that the three reviews we know of are not applicable both because this feature doesn't impact them, and because any review would be a rehash of parts of the reviews for the original WebGPU release. Is there a way to mark this in the status entry?

Chris Harrelson

unread,
Oct 11, 2023, 2:20:30 PM10/11/23
to Corentin Wallez, Ryan Harrison, blin...@chromium.org
Hi Corentin,

The reviews I'm talking about are the "chips" UI in your chromestatus entry. Screenshot below. Once the reviews have begun the gray chips will turn blue or green. This is a recent change to chromestatus, see here for more context. If a review category is not applicable there is a way to mark it as such in the chromestatus review flow for your feature.


image.png

Corentin Wallez

unread,
Oct 11, 2023, 2:44:47 PM10/11/23
to Chris Harrelson, Ryan Harrison, blin...@chromium.org
Thank you for the guidance. I commented on each of these, but unfortunately don't have edit rights on the feature status so I can't mark the reviews as started.

Ken Russell

unread,
Oct 11, 2023, 4:42:44 PM10/11/23
to Corentin Wallez, Chris Harrelson, Ryan Harrison, blin...@chromium.org
Chris, is there any way to grant Corentin edit access to the Chromestatus entry? Ryan's OOO the rest of this week and we'd like to progress this before then. Thanks.


chrishtr via Chromestatus

unread,
Oct 13, 2023, 1:40:08 PM10/13/23
to blin...@chromium.org
LGTM1

Ryan Harrison

unread,
Oct 16, 2023, 11:31:52 AM10/16/23
to Ken Russell, Corentin Wallez, Chris Harrelson, Ryan Harrison, blin...@chromium.org
I cannot figure out how in the chromestatus entry how to set these reviews (privacy & security) as being 'N/A'. The only entries related to these that appear in 'Edit All Fields' are up in the dev trial section, and changing those values, don't appear to affect the chips.

Clicking on the chips for me just brings up the comments/review dialogue on the side. I am unsure if the issue is that the review has already started, so I cannot change the status to N/A now, or if that is something that can only be done by a reviewer.

(cwallez @google and @chromium are both on the editors list already, I have added cwa...@chromium.org to the owners list incase that was needed)

Ken Russell

unread,
Oct 16, 2023, 7:40:08 PM10/16/23
to Ryan Harrison, Corentin Wallez, Chris Harrelson, blin...@chromium.org
Blink API owners, could you please guide Ryan and Corentin on how to move this feature forward?

Perhaps it's best to just have the privacy team sign off on it - this should be easy because there is no privacy concern for this feature.

Again, while this is a medium-sized WebGPU shading language feature, it's well understood and multiple customers are eager for it to become generally available so they can speed up their machine learning workloads running on WebGPU.

Thanks,

-Ken


Chris Harrelson

unread,
Oct 16, 2023, 7:54:52 PM10/16/23
to Ken Russell, Ryan Harrison, Corentin Wallez, blin...@chromium.org
Hi,

I don't think you need to do anything else. We'll re-review this intent at our next meeting Wednesday morning PDT.

The security review is already done and the other one is in progress. The API owners won't block on both finishing, we just wanted to make sure they were started before finishing our review.


Ken Russell

unread,
Oct 16, 2023, 7:56:53 PM10/16/23
to Chris Harrelson, Ryan Harrison, Corentin Wallez, blin...@chromium.org
Got it - thanks Chris.

Yoav Weiss

unread,
Oct 17, 2023, 7:31:54 AM10/17/23
to Ken Russell, Chris Harrelson, Ryan Harrison, Corentin Wallez, blin...@chromium.org

Ryan Harrison

unread,
Oct 17, 2023, 9:32:30 AM10/17/23
to Yoav Weiss, Ken Russell, Chris Harrelson, Ryan Harrison, Corentin Wallez, blin...@chromium.org
I received an email from the tool after the most recent approval stating the next step is:
'Check existing Lighthouse audits for correctness.`

I am not particularly familiar with Lighthouse, so not sure if this is something actually actionable by me or just a no-op for this feature. Please advise.
-Ryan Harrison

Sangwhan Moon

unread,
Oct 17, 2023, 1:19:47 PM10/17/23
to Ryan Harrison, Yoav Weiss, Ken Russell, Chris Harrelson, Corentin Wallez, blin...@chromium.org
Just to be on record, this is small enough of change that it won't require a TAG review. I'll double check with the group and get back to you if they want one.

Sangwhan

On Oct 17, 2023, at 22:32, Ryan Harrison <rhar...@chromium.org> wrote:


LGTM2

<image.png>

Alex Russell

unread,
Oct 17, 2023, 1:41:26 PM10/17/23
to Sangwhan Moon, Ryan Harrison, Yoav Weiss, Ken Russell, Chris Harrelson, Corentin Wallez, blink-dev
Thanks Sangwhan.

Provisional LGTM3, pending an update on TAG discussion. If TAG wants to discuss, we can leave flipped on for Beta while it resolves.

Best,

Alex

Reply all
Reply to author
Forward
0 new messages