Skip to content

Copy input ArrayBuffers#700

Closed
a-sully wants to merge 1 commit intowebmachinelearning:mainfrom
a-sully:dont-transfer-input-arraybuffers
Closed

Copy input ArrayBuffers#700
a-sully wants to merge 1 commit intowebmachinelearning:mainfrom
a-sully:dont-transfer-input-arraybuffers

Conversation

@a-sully
Copy link
Copy Markdown
Contributor

@a-sully a-sully commented Jun 3, 2024

Fixes #566


Preview | Diff

@a-sully a-sully force-pushed the dont-transfer-input-arraybuffers branch from 49edccb to e52d259 Compare July 7, 2024 20:29
@inexorabletash
Copy link
Copy Markdown
Contributor

My reading of "get a copy of the bytes" is that if the buffer is detached then an empty byte sequence is returned but we don't explicitly throw.

Per #351 (and my #723) we want to error if transferring a detached buffer (which will still be used for output buffers). Should we error for detached input buffers too?

I think that just requires adding If |view| is [=BufferSource/detached=], then throw a {{TypeError}}. to the steps.

(I think we'd still end up throwing in most cases since the subsequent size check will fail. Although if allow 0 size dimensions (#391) there would be a weird case where it might slip through that check. Harmless, but weird?)

@a-sully
Copy link
Copy Markdown
Contributor Author

a-sully commented Nov 7, 2024

Abandoning since compute() is being deprecated in favor of dispatch(). See https://github.com/webmachinelearning/webnn/blob/main/mltensor-explainer.md#compute-vs-dispatch

All the logic regarding buffer transferring can be removed alongside compute(), which makes this CL irrelevant

@a-sully a-sully closed this Nov 7, 2024
@a-sully a-sully deleted the dont-transfer-input-arraybuffers branch November 7, 2024 21:15
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.

Don't transfer input ArrayBuffers

2 participants