Skip to content

insert_write_back_for_buffers_pass should inject copy_ nodes at the earliest possible spot. #7345

Description

@JacobSzwejbka

🐛 Describe the bug

Currently the pass injects all the 'copy_' nodes at the end of the graph. It should instead insert them immediately following the last usage of the thing being copied into the original mutable buffer. By waiting till the end we are arbitrarily extending the lifetime of those tensors potentially wasting a non trivial amount of space in the memory plan.

Versions

.

cc @angelayi

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmodule: exirIssues related to Export IR and the code under exir/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog
    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions