Repository navigation
[Stream] Adding AffinityTopologyAttrInterface and HAL implementation. - #20885
Conversation
a6b4d68 to
df5fce1
Compare
benvanik
left a comment
There was a problem hiding this comment.
Nice first draft! Some minor style comments and then some ideas around the design inline.
|
|
||
| let assemblyFormat = [{ | ||
| `{` `[` $devices `]` `,` | ||
| `transfer_required` `=` $transferRequired `}` |
There was a problem hiding this comment.
To make the defaults make more sense we'd want to have the flag be flipped - instead of "transfer required" we'd want "no transfer is required" to be the new information. We can make the query function be the "is a transfer required" part and have something different in the IR. for example, unified_memory && transparent_access would let us set the policy as to whether we rematerialize large resources if the memory is discrete for performance separately from whether the buffers can be accessed without staging.
In the future we may be able to make the existing --iree-stream-resource-memory-model= flag that is used to force discrete/unified piggy back on this for cases with single devices as well, though we may need a special entry for generic host-device relations (vs device-device, even if one of those devices happens to be a local host executor).
|
Thanks a lot for the Comments! Im not sure if i got the Would something like this already be sufficient to signal that no transfer is required for transfers in both directions? It indicates only gpu -> cpu access works. However, assuming I can always control the target device for memory allocation it would be sufficient to also elide transfers from cpu -> gpu? Or should the Also, one follow up question about how this information should be incorporated into the module. You mentioned using the |
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
fb33a0f to
e231073
Compare
Signed-off-by: Thomas Ziereis <[email protected]>
054a80f to
d78741e
Compare
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
|
Also removed the bidirectional '<->' arrows for now. They did seem to work fine when standalone but as soon as i used them as part of the #hal.device.topology<links = [...]> i would get this error: not sure how to work around this. |
Signed-off-by: Thomas Ziereis <[email protected]>
benvanik
left a comment
There was a problem hiding this comment.
Looking good! I think we should strongly type the properties to avoid the custom parser/printer/verifier and make it easier to maintain. We can still keep an optional dictionary for out-of-tree/core properties that we don't want to make part of the API but let the standard ones that the compiler supports be nice.
Signed-off-by: Thomas Ziereis <[email protected]>
…#20885) Adds `IREE::Stream::AffinityTopologyAttrInterface` so that analysis and passes in the stream dialect can query for topology information from target device layers. `#hal.device.topology<...>` is the first implementation. Fixes #20854. --------- Signed-off-by: Thomas Ziereis <[email protected]> Co-authored-by: Ben Vanik <[email protected]>
Adds
IREE::Stream::AffinityTopologyAttrInterfaceso that analysis and passes in the stream dialect can query for topology information from target device layers.#hal.device.topology<...>is the first implementation.Fixes #20854.