Skip to content

opSupportLimits: Level of detail for output tensor(s)? #835

Closed

Description

@inexorabletash

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.

Activity

  1. inexorabletash commented on Apr 10, 2025

    @inexorabletash
    ContributorAuthor

    From #828 (comment) by @fdwr:

    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.

  2. inexorabletash commented on Apr 10, 2025

    @inexorabletash
    ContributorAuthor

    Re: output tensors - I believe @huningxin's comment here got the most consensus:

    I slightly prefer to have ranks in output. It basically represents output row in each op's constraints table.

    Feedback from implementers would help here - are there any problems with populating output ranks, for each of the backends?

  3. philloooo commented on Apr 10, 2025

    @philloooo
    Contributor

    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

  4. inexorabletash commented on May 22, 2025

    @inexorabletash
    ContributorAuthor

    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.

  5. added a commit that references this issue on Jun 4, 2025
    f474e81
  6. added a commit that references this issue on Sep 2, 2025
    573f901
  7. added a commit that references this issue on Sep 15, 2025
    69b43cd
  8. added a commit that references this issue on Sep 25, 2025
    e281c95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions