Skip to content

Remove the MLContext.compute() method - #795

Merged
fdwr merged 3 commits into
webmachinelearning:mainfrom
a-sully:delete-compute
Dec 2, 2024
Merged

fdwr merged 3 commits into
webmachinelearning:mainfrom
a-sully:delete-compute

Conversation

@a-sully

@a-sully a-sully commented Nov 27, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #791. Made possible by #787 which specified dispatch()

The changes proposed in #786 have also been rolled into this PR, since they can't really be decoupled from compute() removal at this point

I've tried to keep this PR minimal and focused on removing algorithms and IDL definitions which are no longer relevant. The spec still contains lots of normative text which was written with compute() in mind which doesn't map as well to dispatch() - specifically text which contains assumptions about how graph execution relates to compute devices. I've lightly updated some of this text where necessary to match the dispatch() paradigm, but my intention is to avoid opening the can of worms that is #749 in this PR :)


Preview | Diff

Comment thread index.bs
@a-sully

a-sully commented Nov 27, 2024

Copy link
Copy Markdown
Contributor Author

@huningxin @fdwr PTAL?

@inexorabletash inexorabletash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This does make me realize that as part of #529 we'll likely need to define queuing for operations on the timeline that share tensors, to avoid racy behavior. With ArrayBuffers transferred away synchronously during compute(), there wasn't the possibility for multiple compute()s to compete for access to the buffer or script to read/write the contents.

Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs

@huningxin huningxin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a comment to example, thanks!

@huningxin huningxin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@a-sully

a-sully commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews, @huningxin and @inexorabletash

@fdwr PTAL?

@fdwr fdwr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM Mr. Sully.

@fdwr
fdwr merged commit 4e80205 into webmachinelearning:main Dec 2, 2024
github-actions Bot added a commit that referenced this pull request Dec 2, 2024
SHA: 4e80205
Reason: push, by fdwr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@a-sully
a-sully deleted the delete-compute branch December 2, 2024 19:52
caugner pushed a commit to mdn/browser-compat-data that referenced this pull request Dec 19, 2024
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.

Remove MLContext.compute()

4 participants