Intent to Implement and Ship

271 views
Skip to first unread message

Deepti Gandluri

unread,
Mar 8, 2023, 7:11:51 PM3/8/23
to blin...@chromium.org, Lutz Vahl, Zhi An Ng, Thibaud Michaud

Contact emails

gde...@chromium.orgzh...@chromium.orgthib...@chromium.org

Explainer

https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md

Specification

https://github.com/WebAssembly/relaxed-simd/tree/main/document

Summary

Relaxed SIMD extends the existing SIMD proposal to introduce vector instructions that relax the strict determinism constraints of portable SIMD to take better advantage of the underlying hardware. The operations introduced in this proposal take advantage of widely available instruction sets to accelerate compute workloads.


Blink component

Blink>JavaScript>WebAssembly

TAG review

Not required as per: https://v8.dev/docs/feature-launch-process. This introduces an additional set of vector operations to WebAssembly, and makes no API changes.


Risks



Interoperability and Compatibility


Gecko: In development, enabled in nightly

WebKit: No signal as per request for position: mail-archive.com/webki...@lists.webkit.org/msg30574.html

Web developers: Strongly positive, Proposal in Phase 3 in the WebAssembly CG the proposal was incubated to address some of the developer/user requests from the previous SIMD proposal.

Other signals: Proposal voted to a provisional phase 4 as per meeting notes in the February 14th CG meeting (notes: https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-02-14.md). The feature has consensus in the CG, but the vote is provisional till the formal spec is up to date (Tracking issue: https://github.com/WebAssembly/relaxed-simd/issues/134, PRs also in flight).

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? No



Debuggability

Supported instructions are enabled in Liftoff, and are visible to DevTools for debuggability.



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

Yes

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

Not applicable, tested by WebAssembly spec tests

Flag name

V8: --wasm-relaxed-simd

Chrome: Features::kWebAssemblyRelaxedSimd

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=12284

Estimated milestones

114


Anticipated spec changes

No anticipated spec changes, but some potential for compat issues based on hardware, more details in this Entropy.md, and the linked issues.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5082417973952512

Deepti Gandluri

unread,
Mar 9, 2023, 3:43:01 PM3/9/23
to blin...@chromium.org, Lutz Vahl, Zhi An Ng, Thibaud Michaud
Quick note that I realized my title was accidentally cropped, it should be: 

"Intent to Implement and Ship: WebAssembly Relaxed SIMD".

Mike Taylor

unread,
Mar 9, 2023, 5:38:43 PM3/9/23
to Deepti Gandluri, blin...@chromium.org, Lutz Vahl, Zhi An Ng, Thibaud Michaud

On 3/9/23 3:42 PM, Deepti Gandluri wrote:

Quick note that I realized my title was accidentally cropped, it should be: 

"Intent to Implement and Ship: WebAssembly Relaxed SIMD".

On Wed, Mar 8, 2023 at 4:11 PM Deepti Gandluri <gde...@chromium.org> wrote:

Contact emails

gde...@chromium.orgzh...@chromium.orgthib...@chromium.org

Explainer

https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md

Specification

https://github.com/WebAssembly/relaxed-simd/tree/main/document

Summary

Relaxed SIMD extends the existing SIMD proposal to introduce vector instructions that relax the strict determinism constraints of portable SIMD to take better advantage of the underlying hardware. The operations introduced in this proposal take advantage of widely available instruction sets to accelerate compute workloads.


Blink component

Blink>JavaScript>WebAssembly

TAG review

Not required as per: https://v8.dev/docs/feature-launch-process. This introduces an additional set of vector operations to WebAssembly, and makes no API changes.


Risks



Interoperability and Compatibility


Gecko: In development, enabled in nightly

WebKit: No signal as per request for position: mail-archive.com/webki...@lists.webkit.org/msg30574.html

This should be updated to neutral, with concerns around potential compat issues (it was manually moved to the new standards-position repo: https://github.com/WebKit/standards-positions/issues/4#issuecomment-1170364495).


Web developers: Strongly positive, Proposal in Phase 3 in the WebAssembly CG the proposal was incubated to address some of the developer/user requests from the previous SIMD proposal.

Other signals: Proposal voted to a provisional phase 4 as per meeting notes in the February 14th CG meeting (notes: https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-02-14.md). The feature has consensus in the CG, but the vote is provisional till the formal spec is up to date (Tracking issue: https://github.com/WebAssembly/relaxed-simd/issues/134, PRs also in flight).

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? No



Debuggability

Supported instructions are enabled in Liftoff, and are visible to DevTools for debuggability.



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

Yes

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

Not applicable, tested by WebAssembly spec tests

Flag name

V8: --wasm-relaxed-simd

Chrome: Features::kWebAssemblyRelaxedSimd

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=12284

Estimated milestones

114


Anticipated spec changes

No anticipated spec changes, but some potential for compat issues based on hardware, more details in this Entropy.md, and the linked issues.

Thanks for the Entropy.md doc - it's incredibly helpful.

For most of the exposed entropy, we already expose this via the User-Agent string, or the Arch UA Client Hint. Can you say more about "Differences between hardware that has native FMA support, and hardware that does not." and "whether the Dot product extension is supported in the most optimal codegen" - any idea what the distributions would look there there?

As to compat, "code compiled for one browser works differently on a different browser" - this sounds a little bit scary! Do we have any ideas on how to minimize (I assume preventing isn't a reality) this outcome?


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5082417973952512

--
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/CALi9WK_SOE5jAVCPydhY0Xn4S6P2rr_W9qhQhN5tA0Ew9vJEdg%40mail.gmail.com.

Deepti Gandluri

unread,
Mar 10, 2023, 2:42:18 AM3/10/23
to Mike Taylor, blin...@chromium.org, Lutz Vahl, Zhi An Ng, Thibaud Michaud
On Thu, Mar 9, 2023 at 2:38 PM Mike Taylor <mike...@chromium.org> wrote:

On 3/9/23 3:42 PM, Deepti Gandluri wrote:

Quick note that I realized my title was accidentally cropped, it should be: 

"Intent to Implement and Ship: WebAssembly Relaxed SIMD".

On Wed, Mar 8, 2023 at 4:11 PM Deepti Gandluri <gde...@chromium.org> wrote:

Contact emails

gde...@chromium.orgzh...@chromium.orgthib...@chromium.org

Explainer

https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md

Specification

https://github.com/WebAssembly/relaxed-simd/tree/main/document

Summary

Relaxed SIMD extends the existing SIMD proposal to introduce vector instructions that relax the strict determinism constraints of portable SIMD to take better advantage of the underlying hardware. The operations introduced in this proposal take advantage of widely available instruction sets to accelerate compute workloads.


Blink component

Blink>JavaScript>WebAssembly

TAG review

Not required as per: https://v8.dev/docs/feature-launch-process. This introduces an additional set of vector operations to WebAssembly, and makes no API changes.


Risks



Interoperability and Compatibility


Gecko: In development, enabled in nightly

WebKit: No signal as per request for position: mail-archive.com/webki...@lists.webkit.org/msg30574.html

This should be updated to neutral, with concerns around potential compat issues (it was manually moved to the new standards-position repo: https://github.com/WebKit/standards-positions/issues/4#issuecomment-1170364495).

Thanks for the pointer, I missed the issue being moved over. 


Web developers: Strongly positive, Proposal in Phase 3 in the WebAssembly CG the proposal was incubated to address some of the developer/user requests from the previous SIMD proposal.

Other signals: Proposal voted to a provisional phase 4 as per meeting notes in the February 14th CG meeting (notes: https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-02-14.md). The feature has consensus in the CG, but the vote is provisional till the formal spec is up to date (Tracking issue: https://github.com/WebAssembly/relaxed-simd/issues/134, PRs also in flight).

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? No



Debuggability

Supported instructions are enabled in Liftoff, and are visible to DevTools for debuggability.



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

Yes

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

Not applicable, tested by WebAssembly spec tests

Flag name

V8: --wasm-relaxed-simd

Chrome: Features::kWebAssemblyRelaxedSimd

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=12284

Estimated milestones

114


Anticipated spec changes

No anticipated spec changes, but some potential for compat issues based on hardware, more details in this Entropy.md, and the linked issues.

Thanks for the Entropy.md doc - it's incredibly helpful.

For most of the exposed entropy, we already expose this via the User-Agent string, or the Arch UA Client Hint. Can you say more about "Differences between hardware that has native FMA support, and hardware that does not." and "whether the Dot product extension is supported in the most optimal codegen" - any idea what the distributions would look there there?

As to compat, "code compiled for one browser works differently on a different browser" - this sounds a little bit scary! Do we have any ideas on how to minimize (I assume preventing isn't a reality) this outcome?


I re-posted this thread to fix the title, and have pasted+responded to this in the newer thread. Sorry for the churn!

Alex Russell

unread,
Mar 15, 2023, 12:06:03 PM3/15/23
to blink-dev, Deepti Gandluri, blin...@chromium.org, Lutz Vahl, Zhi An Ng, Thibaud Michaud, Mike Taylor
Hey Deepti,

LGTM1

I'm excited by the performance this intent will unlock. 

The explainer sort of hints at it, but what do you expect the impact to be on binary sizes based on compilers building in workarounds for missing relaxed instructions? How do you anticipate that developers will adopt to the presence/absence of these ops while balancing WASM binary size concerns?

On TAG review, this *is* a web-visible change, so it would be helpful to keep that in mind in the future. Would encourage you to send the TAG an FYI about new language additions to help them stay informed and consider those capabilities when reviewing other features.

Thanks.

Alex

On Thursday, March 9, 2023 at 11:42:18 PM UTC-8 Deepti Gandluri wrote:
On Thu, Mar 9, 2023 at 2:38 PM Mike Taylor <mike...@chromium.org> wrote:

On 3/9/23 3:42 PM, Deepti Gandluri wrote:

Quick note that I realized my title was accidentally cropped, it should be: 

"Intent to Implement and Ship: WebAssembly Relaxed SIMD".

On Wed, Mar 8, 2023 at 4:11 PM Deepti Gandluri <gde...@chromium.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Deepti Gandluri

unread,
Mar 16, 2023, 3:01:14 PM3/16/23
to Alex Russell, blink-dev, Lutz Vahl, Zhi An Ng, Thibaud Michaud, Mike Taylor
Thanks Alex!

On Wed, Mar 15, 2023 at 9:06 AM Alex Russell <sligh...@chromium.org> wrote:
Hey Deepti,

LGTM1

I'm excited by the performance this intent will unlock. 

The explainer sort of hints at it, but what do you expect the impact to be on binary sizes based on compilers building in workarounds for missing relaxed instructions? How do you anticipate that developers will adopt to the presence/absence of these ops while balancing WASM binary size concerns?

We don't expect that this will result in significant binary size increases. For the majority of the operations that are introduced here, they map 1:1 to non-relaxed fallbacks in the existing SIMD proposal. For code-gen, we would generate fewer instructions overall because the existing operations generate extra code for consistent handling of values across processors (NaNs, +-infinity, and some other cases where the masks/bounds vary), this in fact is the value add for the proposal that generating fewer (machine) instructions gives us more performance for benchmarks that are sensitive to it. The only two that don't have a fallback are the Dot product, and the FMA operations. These don't have a direct fallback, and would be comparatively expensive to emulate (mul+add in place of FMA, and a more involved lowering for dot, dotAdd operations of ~5 SIMD operations). 

The absence of these ops should not be visible, or affect developers that don't want to use these operations. For developers that are writing new applications, they wouldn't run into them unless they need them as the usage model is that they would have to explicitly invoke them using compiler intrinsics, or special toolchain flags. Wasm tools would not be generating relaxed SIMD ops by default, so these operations require users to know about them or opt-in by using intrinsics. The trickier case is when libraries already use them, and developers are using libraries pre-compiled to Wasm in their applications, in that case the recommended option would be to have a SIMD/Scalar fallback for the code that uses these operations. 

On TAG review, this *is* a web-visible change, so it would be helpful to keep that in mind in the future. Would encourage you to send the TAG an FYI about new language additions to help them stay informed and consider those capabilities when reviewing other features.

 Thanks for the clarification, is the right way to send an FYI through the issue tracker

Thanks.

Alex

On Thursday, March 9, 2023 at 11:42:18 PM UTC-8 Deepti Gandluri wrote:
On Thu, Mar 9, 2023 at 2:38 PM Mike Taylor <mike...@chromium.org> wrote:

On 3/9/23 3:42 PM, Deepti Gandluri wrote:

Quick note that I realized my title was accidentally cropped, it should be: 

"Intent to Implement and Ship: WebAssembly Relaxed SIMD".

On Wed, Mar 8, 2023 at 4:11 PM Deepti Gandluri <gde...@chromium.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Yoav Weiss

unread,
Mar 17, 2023, 5:47:39 AM3/17/23
to Deepti Gandluri, Alex Russell, blink-dev, Lutz Vahl, Zhi An Ng, Thibaud Michaud, Mike Taylor

Chris Harrelson

unread,
Mar 28, 2023, 2:07:25 PM3/28/23
to Yoav Weiss, Deepti Gandluri, Alex Russell, blink-dev, Lutz Vahl, Zhi An Ng, Thibaud Michaud, Mike Taylor
Reply all
Reply to author
Forward
0 new messages