Skip to content

allocation order propagation for matmul/linear #2198

@jjsjann123

Description

@jjsjann123

issue was raised by @jacobhinkle

We would like allocation order inference to populate proper allocation domain for inputs to matmul/linear ops.

i.e.

tv0 = fusion.define_tensor(...)
tv1 = fusion.define_tensor(...)
// magic operations that produces `tv0_derived` and `tv1_derived`

tv_out = fusion.ops.matmul(tv0_derived, tv1_derived)
// ...

with a vanilla fusion, tv0_derived and tv1_derived will have an empty allocation domain. This is not ideal, imagining if tv0 and tv1 comes in with a non-trivial allocation_domain.

The ask here is:

  1. we would want allocation order transpose to infer allocation order on tv0_derived and tv1_derived and populate it properly from their producers.
  2. the target of the propagation is recognized simply as inputs to matmul/linear operation. (or other pattern matching that we want to apply).
  3. We do NOT need to populate the allocation_order for tv_out, which should be better done by the scheduler.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions