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

introduce "--webnn-ort-ov-gpu-precision" to specify gpu precision #162

Open
wants to merge 1 commit into
base: ort_backend
Choose a base branch
from

Conversation

mingmingtasd
Copy link
Collaborator

@mingmingtasd mingmingtasd commented Feb 26, 2025

Change the --webnn-ort-use-ov-gpu-fp32 flag to --webnn-ort-ov-gpu-precision

You can specify the flag to use FP32 or ACCURACY inference precision:
Usage1: --webnn-ort-ov-gpu-precision=FP32
Usage2: --webnn-ort-ov-gpu-precision=ACCURACY

--webnn-ort-ov-gpu-precision=ACCURACY will let OV EP GPU use ACCURACY execution mode. As my observation, this mode will not decrease the SD Turbo's inference time a lot, but can increase the pass rate of many ops' wpt tests (resolve the accuracy failure). We can test more with this flag.

see https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/openvino/backends/basic_backend.cc#L167

PTAL, thanks!
cc/ @BruceDai @lisa0314 @miaobin

Copy link
Collaborator

@huningxin huningxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

// the flag to use FP32 or ACCURACY inference precision to get better accuracy,
// but it may result in decreased performance.
// Usage1: --webnn-ort-ov-gpu-precision=FP32
// Usage2: --webnn-ort-ov-gpu-precision=ACCURACY
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to explain what the underlying setting to OV execution mode when specifying "FP32" or "ACCURACY". Adding a pointer to OV documentation would be helpful.

@@ -30,6 +30,18 @@ namespace webnn::ort {

namespace {

// These keys and values must align with the implementation of the ORT OpenVINO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please point out the valid keys and values available in OV EP?

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

Successfully merging this pull request may close these issues.

2 participants