Skip to content
New issue

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

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

Already on GitHub? # to your account

Add optional operator labels for more diagnosable error messages #742

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

inexorabletash
Copy link
Member

@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 webmachinelearning#585
@inexorabletash
Copy link
Member 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 huningxin and fdwr July 26, 2024 16:17
@inexorabletash
Copy link
Member 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 <dwayner@microsoft.com>
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
Member 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
2 checks passed
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
# for free to join this conversation on GitHub. Already have an account? # 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