-
Notifications
You must be signed in to change notification settings - Fork 48
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
[MLBuffer] Uploading/downloading tensor data #543
Comments
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5357633 Commit-Queue: Bryan Bernhart <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Rafael Cintron <[email protected]> Reviewed-by: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1280431}
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5357633 Commit-Queue: Bryan Bernhart <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Rafael Cintron <[email protected]> Reviewed-by: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1280431}
Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5357633 Commit-Queue: Bryan Bernhart <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Rafael Cintron <[email protected]> Reviewed-by: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1280431}
…a=testonly Automatic update from web-platform-tests WebNN: Implement MLBuffer transfer ops Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5357633 Commit-Queue: Bryan Bernhart <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Rafael Cintron <[email protected]> Reviewed-by: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1280431} -- wpt-commits: 8715bf87a42aad0a1948179ddb19e6382ace0108 wpt-pr: 45012
…a=testonly Automatic update from web-platform-tests WebNN: Implement MLBuffer transfer ops Adds support to upload or read back data to/from MLBuffer. Since MLContext determines the device-execution order of GPU operations, writeBuffer and readBuffer were added to MLContext. * Only full MLBuffer read/write from renderer are enabled. webmachinelearning/webnn#543 Bug: 40278771 Change-Id: Id95da35e3f81bed47a356f76b75c043cdd500beb Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5357633 Commit-Queue: Bryan Bernhart <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Rafael Cintron <[email protected]> Reviewed-by: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1280431} -- wpt-commits: 8715bf87a42aad0a1948179ddb19e6382ace0108 wpt-pr: 45012
@anssiko FYI, this issue should be tagged as non-interop |
While pondering that question, please consider the following issue too #391, where accepting 0-byte size transfers as silent nops probably makes life easier for callers (they can share more of the same generic code paths with less special case handling). |
The current note on |
Good eye. I think that "no copy" note was meant for JavaScript, not WASM. To allow readBuffer() be functionally equivalent to how compute() works today (ex. Do you think "no copy" for JS is still useful (no WASM)?
How would a task source be used to grant readBuffer() access to safely write into the WASM heap? |
It's important to consider why the design required the buffers to be transferred to begin with: We want to prevent concurrent access to the buffer from "the implementation" and JS/WASM. For output buffers, since Edited to add: The steps become basically "in parallel, gather the bytes that are contained in the |
Should we consider whether the buffer is SharedArrayBuffer that a worker may see the partially written bytes? AFAIK, ORT Web multi-threaded build uses SharedArrayBuffer as Wasm heap. |
That is the behavior a developer opts into by using |
Would the "copy those bytes into the provided ArrayBuffer" and "worker writes to ArrayBuffer" happen at the same time, if the dst is a |
For a |
(naming) Given it's been renamed to
Otherwise it's a little confusing because - void writeBuffer(MLTensor destinationTensor, ArrayBuffer sourceData);
+ void writeTensor(MLTensor destinationTensor, ArrayBuffer sourceData); |
I believe we can close this out, now that the spec is updated with MLTensor. Please re-open if i'm mistaken. |
I was wondering that too yesterday, thinking everything was complete 🤔. @bbernhar to confirm? Should any open issues in your "Opens" section be migrated to a separate issue? |
@inexorabletash @fdwr Yes, thanks for checking. No opens need follow-up atm. |
Purpose/Motivation
Provides a means to upload or download tensor data to/from a created
MLBuffer
via #542 . This is a sub-issue of #482.Proposed API
Example JS
Opens
mappedAtCreation
? @a-sullywriteBuffer
or are "zero-writes" allowed? @bbernhar[write|read]Buffer
arguments use a dictionary per https://w3ctag.github.io/design-principles/#prefer-dictionaries (note: WebGPU does not follow this).Edits
The text was updated successfully, but these errors were encountered: