-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Description
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_inplaceoperator. 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_inplaceinvocations. At this stage, the memory planner should also be modified to handle cases where the input tensor needs a larger underlying storage.
quic-sanirudh, yzh119, psrivas2 and sunggg