Skip to content

Conversation

@inexorabletash
Copy link
Contributor

@inexorabletash inexorabletash commented Mar 12, 2025

Add rankRange to opSupportLimits() by renaming MLSupportLimits to MLDataTypeLimits (still used for inputs, constants, and output operands), and deriving MLTensorLimits (used for tensor operands) which adds the new member as a MLRankRange dictionary.

This also adds a note about an operand's allowed data types and ranks, indicating the implementations may extend or impose limits.

In addition, maxTensorByteLength is added to the MLOpSupportLimits dictionary.

Based on the work in Chromium by Reilly Grant, Wei Wang, and Junwei Fu.

Resolves #456


Preview | Diff

Add rankRange to opSupportLimits() by renaming MLSupportLimits to
MLDataTypeLimits (still used for inputs, constants, and output
operands), and deriving MLTensorLimits (used for tensor operands)
which adds the new member as a MLRankRange dictionary.

This also adds a note about an operand's allowed data types and ranks,
indicating the implementations may extend or impose limits.

Finally, maxTensorByteLength is exposed at the top level of the
dictionary.
@inexorabletash inexorabletash marked this pull request as draft March 12, 2025 20:58
@inexorabletash inexorabletash marked this pull request as ready for review March 17, 2025 21:23
@inexorabletash
Copy link
Contributor Author

Ready for review, I think. Please take a look?

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

A few thoughts good sir. 🔍

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍

@inexorabletash
Copy link
Contributor Author

Thanks @fdwr ! This should still match the Chromium implementation at least as far as what's web-observable, even if the IDL differs somewhat.

The discussion around whether or how to represent output tensors is still unresolved; two options:

  • Discuss it here (pro: already active thread)
  • Merge this as-is, file a new issue (pro: incremental progress)

Preferences?

@fdwr
Copy link
Collaborator

fdwr commented Apr 7, 2025

The discussion around whether or how to represent output tensors is still unresolved; two options:

  • Discuss it here (pro: already active thread)
  • Merge this as-is, file a new issue (pro: incremental progress)

Preferences?

Incremental progress?

Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM!

@inexorabletash
Copy link
Contributor Author

I opened #835 to capture the output tensor discussion. So... good to merge this as-is?

@fdwr fdwr merged commit 963437c into webmachinelearning:main Apr 9, 2025
2 checks passed
github-actions bot added a commit that referenced this pull request Apr 9, 2025
SHA: 963437c
Reason: push, by fdwr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@inexorabletash inexorabletash deleted the tensor-limits branch April 9, 2025 21:12
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.

Define the maximum number of operand dimensions (maximum rank)

5 participants