You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opSupportLimits: Level of detail for output tensor(s)? #835
Per discussion in #828 (comment) there are a range variety of opinions about how much detail opSupportLimits() should include for the output tensors. Currently as specified and per the Chromium implementation, output tensor(s) are included and list just the data types, not ranks (#828).
On one extreme, the output data type and rank can (almost) always be inferred from the inputs. So providing the bare minimum of data in the dict would mean that output tensor(s) are not described at all - neither data type(s) nor rank(s).
On the other, it is informative to list what possible outputs are, and this can help with debugging. So providing both possible output data types and ranks would be useful.
Note that for ops where the output data type can be explicitly passed - argMin/argMax and cast - opSupportLimits() must include the supported types.
Would it make more sense for [input, constant, output] to be MLTensorLimits to capture any global maximum ranks #456 (comment)? For example, DML has a global maximum rank of 8D (regardless of operator), and CoreML (Phillis can correct me if incorrect) has a limit of 5D.
Feedback from implementers would help here - are there any problems with populating output ranks, for each of the backends?
For backend implementations, I believe the actual constraints from underlying ML frameworks are:
global tensor rank constraints.
op level input rank constraints.
So we have two ways to expose this:
a. expose rank for per op output, as it might have a different rank from input and violate global tensor rank constraint
b. create another term in opSupportLimits, e.g. operand or something to represent global tensor constraint
Option a is more verbose but maybe more consistent with existing opSupportLimits structure, option b is more concise but creates another magic word
Activity
inexorabletash commentedon Apr 10, 2025
From #828 (comment) by @fdwr:
inexorabletash commentedon Apr 10, 2025
Re: output tensors - I believe @huningxin's comment here got the most consensus:
Feedback from implementers would help here - are there any problems with populating output ranks, for each of the backends?
philloooo commentedon Apr 10, 2025
For backend implementations, I believe the actual constraints from underlying ML frameworks are:
So we have two ways to expose this:
a. expose rank for per op output, as it might have a different rank from input and violate global tensor rank constraint
b. create another term in opSupportLimits, e.g.
operandor something to represent global tensor constraintOption a is more verbose but maybe more consistent with existing opSupportLimits structure, option b is more concise but creates another magic word
inexorabletash commentedon May 22, 2025
Per discussion at https://github.com/webmachinelearning/meetings/blob/main/telcons/2025-05-22-wg-agenda.md - agreement to go into detail with ranks etc. for output tensors in
opSupportLimits(). @huningxin said he would work on a PR.Support rankRange for output tensors in opSupportLimits
Support rankRange for output tensors in opSupportLimits
Support rankRange for output tensors in opSupportLimits
Support rankRange for op output tensors in opSupportLimits (#857)