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

[WebNN EP] Validate MLContext creation early to allow fallback to other EP #20735

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

Conversation

Honry
Copy link
Contributor

@Honry Honry commented May 20, 2024

Try to fix issue #20729

Comment on lines +122 to +124
if (backendNames.filter(name => name === 'webnn').length > 1) {
throw new Error(`Registering duplicate 'webnn' backends in the session options is not permitted`);
}

Choose a reason for hiding this comment

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

Will this disable trying do this?

  executionProviders: [
    {
      name: "webnn",
      deviceType: "gpu",
    },
    {
      name: "webnn",
      deviceType: "cpu",
    },
    ...
  ]

Copy link
Contributor Author

@Honry Honry May 21, 2024

Choose a reason for hiding this comment

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

Creating multiple WebNN or WebGPU eps in a single session is not allowed, @fs-eire, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if that is possible or not technically. But in practice, I think there is no use case of multiple instances of the same EP being used in one session.

@guschmue guschmue added ep:WebGPU ort-web webgpu provider ep:WebNN WebNN execution provider and removed ep:WebGPU ort-web webgpu provider labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:WebNN WebNN execution provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants