Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dedicated square root operator #438

Closed
huningxin opened this issue Jun 30, 2023 · 2 comments
Closed

Support dedicated square root operator #438

huningxin opened this issue Jun 30, 2023 · 2 comments

Comments

@huningxin
Copy link
Contributor

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
Copy link
Collaborator

fdwr commented Aug 8, 2023

Motivations include:

  • Backends often have a more optimized version of it available than via pow.
  • It avoids needing to create and upload tiny temporary tensors (of 0.5).

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

@inexorabletash
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants