You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Stream] Elide transfers in the stream dialect when resources are accessible on participating affinities. #20853
Similar to the existing execution compatibility queries a AffinityAttr::getMemoryCompatibility (or something like it) would allow for passes to adjust their transfer ops or remove them entirely. Its exact design is still TBD and will likely be a stand-in controlled by a compiler flag to start but could use whatever #20854 adds.
A new pass that ran prior to MaterializeCopyOnWritePass could perform affinity analysis and detect transfers that are from/to devices that are indicated as having shared access. Before COW it's safe to elide the transfers as they are there mostly for type refinement and affinity changes.
Since the transfers are load-bearing to correct IR prior to resource lifetime assignment a new op or a new transfer attribute may be required to indicate that the transfer is not needed for correctness. Alternatively, the pass may ignore any transfer that is perform a usage cast.
changed the title [-][Stream] Elide of transfers in the stream dialect when resources are accessible on participating affinities.[/-][+][Stream] Elide transfers in the stream dialect when resources are accessible on participating affinities.[/+]on May 19, 2025
I also started working on this and created a draft implementation for this here: ziereis#1. The PR is currently against my own branch for the topology attribute as this is needed for this.
Neat start! There's some issues it's likely to run into with affinity analysis later on in the pipeline that I'm working on now, but this will be fine standalone for now as it will hopefully help us get some more useful IR (I've just been hacking things together by hand).
Activity
[-][Stream] Elide of transfers in the stream dialect when resources are accessible on participating affinities.[/-][+][Stream] Elide transfers in the stream dialect when resources are accessible on participating affinities.[/+]ziereis commentedon May 22, 2025
I also started working on this and created a draft implementation for this here: ziereis#1. The PR is currently against my own branch for the topology attribute as this is needed for this.
benvanik commentedon May 22, 2025
Neat start! There's some issues it's likely to run into with affinity analysis later on in the pipeline that I'm working on now, but this will be fine standalone for now as it will hopefully help us get some more useful IR (I've just been hacking things together by hand).
[Stream] New ElideAsyncTransfersPass (#21029)
[Stream] New ElideAsyncTransfersPass (#21029)