Skip to content

Comments

Add optional operator labels for more diagnosable error messages#742

Merged
fdwr merged 8 commits intowebmachinelearning:mainfrom
inexorabletash:label
Jul 30, 2024
Merged

Add optional operator labels for more diagnosable error messages#742
fdwr merged 8 commits intowebmachinelearning:mainfrom
inexorabletash:label

Conversation

@inexorabletash
Copy link
Contributor

@inexorabletash inexorabletash commented Jul 25, 2024

This adds an internal 'label' property to the operators that are created as a graph is constructed, which MAY (in the RFC 2119 sense) be used by implementations in async error messages. Developers populate this via a 'label' member in the options dictionary for MLGraphBuilder methods.

A new MLOperatorOptions dictionary is defined, and all existing options dictionaries now inherit from this, and all relevant methods now take an options dictionary.

This is based on the Chromium prototype by @lisa0314

Fixes #585


Preview | Diff

This adds an internal 'label' property to the operators that are
created as a graph is constructed, which MAY (in the RFC 2119 sense)
be used by implementations in async error messages. Developers
populate this via a 'label' member in the options dictionary for
MLGraphBuilder methods.

A new MLOperatorOptions dictionary is defined, and all existing
options dictionaries now inherit from this, and all relevant methods
now take an options dictionary.

Fixes #585
@inexorabletash
Copy link
Contributor Author

@lisa0314 and @philloooo - can you do an initial review to ensure this matches the Chromium prototype?

Copy link
Contributor

@philloooo philloooo left a comment

Choose a reason for hiding this comment

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

Overall it matches with current implementation 👍

@lisa0314
Copy link

LGTM. 👍

@inexorabletash inexorabletash requested review from fdwr and huningxin July 26, 2024 16:17
@inexorabletash
Copy link
Contributor Author

Thank you @lisa0314 & @philloooo !

Editors - @huningxin & @fdwr - could you please review and merge when ready?

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍 Oof, looks like no fancy regex saves you here 🥲. Thank you JB for making WebNN more debuggable.

Co-authored-by: Dwayne Robinson <[email protected]>
Copy link
Contributor

@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 a nit

@inexorabletash
Copy link
Contributor Author

please merge when ready!

guschmue pushed a commit to microsoft/onnxruntime that referenced this pull request Jul 29, 2024
In order to provide more diagnosable error messages for developers.

Spec change: webmachinelearning/webnn#742
@fdwr fdwr merged commit 8734bea into webmachinelearning:main Jul 30, 2024
github-actions bot added a commit that referenced this pull request Jul 30, 2024
SHA: 8734bea
Reason: push, by fdwr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@inexorabletash inexorabletash deleted the label branch July 30, 2024 16:33
rohan11235813 pushed a commit to quadric-io/onnxruntime that referenced this pull request Aug 19, 2025
In order to provide more diagnosable error messages for developers.

Spec change: webmachinelearning/webnn#742
rohan11235813 pushed a commit to quadric-io/onnxruntime that referenced this pull request Sep 15, 2025
In order to provide more diagnosable error messages for developers.

Spec change: webmachinelearning/webnn#742
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.

Consider adding node labels for more diagnosable error messages for async errors.

5 participants