-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use AllowSharedBufferSource
for MLGraphBuilder.constant()
#790
Use AllowSharedBufferSource
for MLGraphBuilder.constant()
#790
Conversation
@a-sully , PTAL? |
@@ -1503,9 +1504,6 @@ Build a composed graph up to a given output operand into a computational graph a | |||
1. Set |graph|.{{MLGraph/[[context]]}} to [=this=].{{MLGraphBuilder/[[context]]}}. | |||
1. [=set/For each=] |operand| in |inputs|: | |||
1. Set |graph|.{{MLGraph/[[inputDescriptors]]}}[|operand|.{{MLOperand/[[name]]}}] to |operand|.{{MLOperand/[[descriptor]]}}. | |||
|
|||
Issue(566): If {{MLGraphBuilder/constant(descriptor, bufferView)|constants'}} {{ArrayBuffer}}s are not [=ArrayBuffer/transferred=], make copies for [=MLGraphBuilder/graph=]'s [=computational graph/constants=] here. |
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.
Note: this issue is closed and not relevant.
index.bs
Outdated
</summary> | ||
1. If [=this=].{{MLGraphBuilder/[[hasBuilt]]}} is true, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. | ||
1. If [=MLOperandDescriptor/checking dimensions=] given |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. | ||
1. If [=validating buffer with descriptor=] given |bufferView| and |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. | ||
1. If [=validating buffer with descriptor=] given |bufferSource| and |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. |
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.
Note: This depends on #787 for supporting AllowSharedBufferSource
in "validate buffer with descriptor" algorithm.
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.
#787 is now complete.
MLGraphBuilder.constant()
AllowSharedBufferSource
for MLGraphBuilder.constant()
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!
@fdwr , PTAL? /cc @inexorabletash |
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.
Overall LGTM, but +1 to a naming suggestion.
After this and #787 go in, probably when compute() is removed, we should review any lingering ArrayBufferView
references in the spec and update them as appropriate (to be AllowSharedBufferSource
, replace with MLTensor
, reword entirely, etc)
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.
👍
index.bs
Outdated
</summary> | ||
1. If [=this=].{{MLGraphBuilder/[[hasBuilt]]}} is true, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. | ||
1. If [=MLOperandDescriptor/checking dimensions=] given |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. | ||
1. If [=validating buffer with descriptor=] given |bufferView| and |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. | ||
1. If [=validating buffer with descriptor=] given |bufferSource| and |descriptor| returns false, then [=exception/throw=] a {{TypeError}}. |
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.
#787 is now complete.
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.
Still LGTM 👍
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!
Thanks for the review and approval. I am going to merge it. |
SHA: bcc5dc2 Reason: push, by huningxin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, linux-blink-rel
This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel
This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1390750}
This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1390750}
This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1390750}
… for constant, a=testonly Automatic update from web-platform-tests WebNN: Support `AllowSharedBufferSource` for constant This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1390750} -- wpt-commits: 2643d924a518d89e3a8239ef92705bf1373504c9 wpt-pr: 49470
… for constant, a=testonly Automatic update from web-platform-tests WebNN: Support `AllowSharedBufferSource` for constant This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1390750} -- wpt-commits: 2643d924a518d89e3a8239ef92705bf1373504c9 wpt-pr: 49470
… for constant, a=testonly Automatic update from web-platform-tests WebNN: Support `AllowSharedBufferSource` for constant This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <asullychromium.org> Reviewed-by: Weizhong Xia <weizhonggoogle.com> Commit-Queue: ningxin hu <ningxin.huintel.com> Cr-Commit-Position: refs/heads/main{#1390750} -- wpt-commits: 2643d924a518d89e3a8239ef92705bf1373504c9 wpt-pr: 49470 UltraBlame original commit: 25acfa3eb6954786eb5663d66876762a2a82eec9
… for constant, a=testonly Automatic update from web-platform-tests WebNN: Support `AllowSharedBufferSource` for constant This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <asullychromium.org> Reviewed-by: Weizhong Xia <weizhonggoogle.com> Commit-Queue: ningxin hu <ningxin.huintel.com> Cr-Commit-Position: refs/heads/main{#1390750} -- wpt-commits: 2643d924a518d89e3a8239ef92705bf1373504c9 wpt-pr: 49470 UltraBlame original commit: 25acfa3eb6954786eb5663d66876762a2a82eec9
… for constant, a=testonly Automatic update from web-platform-tests WebNN: Support `AllowSharedBufferSource` for constant This CL implements the WebNN spec change proposal [1] that uses `AllowSharedBufferSource` for `MLGraphBuilder.constant()`. [1]: webmachinelearning/webnn#790 Bug: 380896836 Change-Id: Ib8fc58daaabf7493b08f9634daa1eeb08a50ad35 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac15.arm64-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050722 Reviewed-by: Austin Sullivan <asullychromium.org> Reviewed-by: Weizhong Xia <weizhonggoogle.com> Commit-Queue: ningxin hu <ningxin.huintel.com> Cr-Commit-Position: refs/heads/main{#1390750} -- wpt-commits: 2643d924a518d89e3a8239ef92705bf1373504c9 wpt-pr: 49470 UltraBlame original commit: 25acfa3eb6954786eb5663d66876762a2a82eec9
Fix #788
Preview | Diff