Skip to content

[HAL] set shared usage bits - #20953

Closed
ziereis wants to merge 6 commits into
iree-org:mainfrom
ziereis:hal_set_shared_usage_bits
Closed

ziereis wants to merge 6 commits into
iree-org:mainfrom
ziereis:hal_set_shared_usage_bits

Conversation

@ziereis

@ziereis ziereis commented May 30, 2025

Copy link
Copy Markdown
Contributor

draft implementation for #20856

This probably needs a lot of improvement in the design, I hope I can get some feedback here.

In general there are still a couple of open questions for me:

  1. When to set the usage bits (should it be part of the stream-conversion or happen after it?)
  2. How to use the topology information? This currently does not and only relies on the information provided by the TargetDevices. However, it feels like setting the usage bits should be dependent on the topology.

So to improve this I could imagine setting the buffer bits based on the topology information + usage information of the hal.device.optimal. However, this would require the topology information to always be available. While so far I understood it more as something (optional) that could be set at the higher level of the stack to enable optimizations (like eliding transfers) but should not be required to exist. However, this assumption could also be wrong on my side.

What I could also imagine as a plausible solution is to have an additional pass that runs before the stream-conversion that would query the devices for some default topology information (if it is not already set by the user). So have something like TargetDevice::getTopologyLinks() which would then replace the TargetDevice::setSharedUsageBits.

This would also have the benefit of removing the dependence of the TargetRegistry and DeviceAnalysis from the stream-conversion which I (sadly) introduced here.

ziereis added 6 commits May 30, 2025 15:30
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
Signed-off-by: Thomas Ziereis <[email protected]>
@ziereis
ziereis requested a review from benvanik as a code owner May 30, 2025 13:57
@ziereis
ziereis marked this pull request as draft May 30, 2025 20:04
@benvanik

Copy link
Copy Markdown
Collaborator

Interesting approach and a great discussion starter! I'll respond on the issue so we keep design discussions in one place.

@ziereis

ziereis commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

will close this in favour of whats been discussed in #20856.

@ziereis ziereis closed this Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants