-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial affinity assignment plumbing through flow/stream/hal. (#10833)
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.target` values but for now queues are enough. The queues specified are carried all the way to the runtime device queue affinity masks. Example: ```mlir // run only on queue 0 %0 = flow.dispatch @ex::@entry0(%input) {stream.affinity = #hal.affinity.queue<[0]>} : ... // run on either queue 1 or 2 %1 = flow.dispatch @ex::@Entry1(%input) {stream.affinity = #hal.affinity.queue<[1, 2]>} : ... // run on any queue (attr can also be omitted) %2 = flow.dispatch @ex::@entry2(%0, %1) {stream.affinity = #hal.affinity.queue<*>} : ... ``` -> ```mlir hal.device.queue.execute<%device : !hal.device> affinity(%c1) // 0b001 hal.device.queue.execute<%device : !hal.device> affinity(%c6) // 0b110 hal.device.queue.execute<%device : !hal.device> affinity(%c-1) // 0b111... ``` Currently the affinities are picked up starting from the `flow.dispatch.region`/`flow.dispatch.workgroups` ops. 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.affinity` attributes. For example a frontend could say `my.device_placement = "please run this on queue 4 🙇"` so long as it can later be mapped to `stream.affinity = #hal.affinity.queue<[4]>`. Progress on #10765.
- Loading branch information
Showing
29 changed files
with
575 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.