Repository navigation
Initial affinity assignment plumbing through flow/stream/hal. - #10833
Merged
Merged
Conversation
benvanik
force-pushed
the
benvanik-affinity-prep
branch
2 times, most recently
from
October 18, 2022 21:15
e13e611 to
dd2109c
Compare
benvanik
marked this pull request as ready for review
October 18, 2022 23:23
ScottTodd
approved these changes
Oct 24, 2022
This is a placeholder for some more involved attributes that allow specifying HAL device targets and other constraints. I don't like that hal now relies on stream like this; in the future target specification may move to a dedicated dialect that is shared across flow/stream/hal. Progress on #10765.
Partitioning now respects affinities, properly clones ops when affinities allow, and drops affinities from partitioned ops to clean up the IR. Progress on #10765.
benvanik
force-pushed
the
benvanik-affinity-prep
branch
from
October 24, 2022 20:43
dd2109c to
962c073
Compare
benvanik
enabled auto-merge
October 24, 2022 20:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stream affinity attr is changed to an interface and a placeholder
#hal.affinity.queue<...>implementation is defined to support single-device multi-queue assignment. There's still a decent number of things that will need to change for heterogeneous devices where we'll want affinities to specify#hal.device.targetvalues but for now queues are enough. The queues specified are carried all the way to the runtime device queue affinity masks.Example:
->
Currently the affinities are picked up starting from the
flow.dispatch.region/flow.dispatch.workgroupsops. To specify affinities before then the various dispatch region formation code (I guess 3 different ways now?) will need to be updated to respect user affinity specification (only fuse compatible things) and put the affinity attribute on the resulting dispatch region.Affinities attributes must implement the interface and as such are at this layer IREE-specific. Before dispatch region formation (or as part of it) anything else could be used, with the only requirement being that before the stream dialect transformation pipeline is entered they are all turned in to
stream.affinityattributes. For example a frontend could saymy.device_placement = "please run this on queue 4 🙇"so long as it can later be mapped tostream.affinity = #hal.affinity.queue<[4]>.Progress on #10765.