-
Notifications
You must be signed in to change notification settings - Fork 47
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
Rename MLOperandDescriptor's "dimensions" key to "shape" #676
Rename MLOperandDescriptor's "dimensions" key to "shape" #676
Conversation
e6703a8
to
c27f8a7
Compare
@fdwr PTAL? This is not a mass find-and-replace because, as I mentioned in #666 (comment):
I've combed through all the uses of "dimensions" and updated uses of the latter definition to "shape" while keeping uses of the former definition as-is (though this process was manual and therefore fallible. Apologies if I missed anything!) Thanks! P.S. I'd like to follow up this change with #758 - I'll put up a PR shortly after this merges |
P.P.S. I'd like to follow up that change with the changes proposed here #666 (comment) |
Sorry for the delay, and I realize this is tedious work. @huningxin and I talked about this some last week, and most importantly, we want to be sure it's done in a way that smoothly transitions existing samples, ORT Web, and people using the former to work on drivers, in a way that doesn't cause hiccups by allowing a grace period with the old name. It may still be an experimental API, but at least 24 people are affected these days by breaking changes. My personal preference aside, we all agree with intra-API consistency is the most important, and so the current |
I don't want to spend too much time bikeshedding on this but my reasons for preferring "shape" are:
|
Having a grace period where either
Agreed, though I'll mention another developer-ergonomics reason I encountered while refactoring the WebNN WPTs, which is that since "dimensions" - while referring to one set of dimensions (i.e. one shape) - is plural, referring to a collection of dimensions is awkward and results in use of variable names like |
(Thinking aloud). The way tensor definitions use these terms (for instance here) is that Scalar: rank 0, no axes, no dimension, shape: (). In this sense, |
🤔 Have you considered After collecting the pro's/con's above and elsewhere, and updating my comment here, I see why this was difficult, because there was no clear winner in this toss-up (if there was, there wouldn't be any discussion ⚖️).
Cool, that's really the most important aspect of this. I'm going to approve this because you're clearly intent your direction to avoid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
c27f8a7
to
bbfa491
Compare
Thank you for the review! Please merge this at your convenience (the button is not available to me) |
For stylistic and minor wording choices, I'm content to merge changes, but for bug fixes and content changes, I need my co-editor Ningxin's approval too. |
Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356886}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this PR together. Just some minor clarification questions.
And could you also replace dimensions
with shape
in WebNN explainer: https://github.com/webmachinelearning/webnn/blob/main/explainer.md
bbfa491
to
870885a
Compare
Sure, I'll put up a follow-up PR shortly 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…sions SHA: 53a24db Reason: push, by huningxin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356886}
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <reillygchromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086 UltraBlame original commit: 07f0bc50e723e5fde447a9fbcb888a800f1cf186
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <reillygchromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086 UltraBlame original commit: 07f0bc50e723e5fde447a9fbcb888a800f1cf186
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <reillygchromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086 UltraBlame original commit: 07f0bc50e723e5fde447a9fbcb888a800f1cf186
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086
… discourage use of dimensions, a=testonly Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: webmachinelearning/webnn#676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086
Fixes #669
Preview | Diff