Skip to content

[Unity][Tracking Issue] In-place operations #15319

@slyubomirsky

Description

@slyubomirsky

Per the discussion on in-place updates, this is a tracking issue to discuss the steps and implementation details.

  • Implement a basic version of the call_tir_inplace operator. This will handle the "simple case" described in the discussion thread, where the input tensor must be at least large enough to hold the desired output. At this stage, we will not handle memory planning for the cases where the input tensor is too small to hold the output (thus requiring the memory planner to ensure that the underlying storage is large enough).
  • Implement a conservative alias analysis to ensure that candidates for in-place operations are not aliased. We may also need to implement special operators to assert that values are not aliased or assert that a given PackedCall does not create aliases.
  • Implement a liveness analysis to determine that candidates for an in-place operation are not live later in the program.
  • Implement a pass that uses the alias and liveness analyses to identify candidates for in-place operations and replaces them with call_tir_inplace invocations. At this stage, the memory planner should also be modified to handle cases where the input tensor needs a larger underlying storage.

cc @quic-sanirudh

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions