webmachinelearning / webnn

🧠 Web Neural Network API
https://www.w3.org/TR/webnn/
Other
369 stars 46 forks source link

Support dedicated square root operator #438

Closed huningxin closed 8 months ago

huningxin commented 1 year ago

Use case and sample models

This op was proposed by @fdwr (Thanks Dwyane!) as a WebNN v2 op in WebML WG Teleconference – 29 June 2023 to support transformer models, such as segment anything model.

Cross-framework support

It is widely supported by ML frameworks, such as

Cross-platform implementability

The dedicated square root operator is widely available in native ML APIs / libs, e.g.,

Other references

Currently the Chromium CL-4615724 maps pow(x, 0.5) to xnn_define_square_root for WebNN XNNPACK backend. It could be exposed via the dedicated square root operator when WebNN spec supports it.

/cc @wacky6

fdwr commented 1 year ago

Motivations include:

Note any backends lacking a dedicated square root can still trivially achieve it via the fallback pow(x, 0.5).

inexorabletash commented 8 months ago

This can be closed off c/o PR #478, correct?