Skip to content

[Stream] Assign resource affinity based on usage (not just assigned execution affinity) with multiple potential affinities. #20855

Closed

Description

@benvanik

Near the end of the iree-stream-cmd-transformation-pipeline we have the total set of allocations and their usage in the program. A new RefineResourceAffinitiesPass that performed an affinity analysis per allocation to find all usage should reschedule the allocations to be performed on the optimal device (#20857). Since the selection logic is deterministic at runtime all deallocations for such allocations should also be changed. This could happen before ARC (where there may be some deallocations) or after (where we have them all).

The affinity attr joinOR method can be used to join the affinities and produce the final set which may be the same device but with multiple queues or different devices turned into a #hal.device.optimal<...> affinity.

Activity

  1. self-assigned this
    on May 19, 2025
  2. added
    compiler/dialects
    on May 19, 2025
  3. added 6 commits that reference this issue on May 31, 2025
    9e26404
    c5a28d8
    71cc8c8
    be7f79a
    8d79459
    63d171d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compiler/dialects

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions