Repository navigation
Use nested references in HAL command buffer dispatches. - #3047
Conversation
…ents. This is not strictly required, but enforcing the already implicit structure seems like good practice.
* CommandBufferDispatchOp -> CommandBufferDispatchOp / CommandBufferDispatchOrdinalOp
* CommandBufferDispatchIndirectOp -> CommandBufferDispatchIndirectOp / CommandBufferDispatchIndirectOrdinalOp
* ResolveEntryPointOrdinalsPass runs prior to serialization
* Backends may choose to record with or without references
* Since VulkanSPIRV may split dispatches, it uses ordinals directly and must solve linking in some specialized way
This reverts commit 5ff550c. The LLVM targets match entry point symbol names to llvm.func names.
ScottTodd
left a comment
There was a problem hiding this comment.
Need to fix or work around some mysterious Python failures (in the MLIR crash reproducer..?).
This is crashing now and I'm not sure why.
benvanik
left a comment
There was a problem hiding this comment.
I like your idea about renaming targetbackend::name too
| HAL_CommandBuffer:$command_buffer, | ||
| HAL_Executable:$executable, | ||
| HAL_OrdinalAttr:$entry_point, | ||
| HAL_Executable:$executable, // TODO(scotttodd): remove this and extract from nested ref? |
There was a problem hiding this comment.
yeah we can kill this, which is nice (less chance for the two to get out of sync when we end up moving the entry points around - changing the entry point from @foo::@bar -> @taco::@beef is just a single op, not having to also update executable)
There was a problem hiding this comment.
we can also remove the entry_point here, as there will just be one symbol reference
this way, we have this:
hal.command_buffer.dispatch.symbol %cmd, @executable::@entry_point, ...
and
hal.command_buffer.dispatch %cmd, @executable, entry_point=0
There was a problem hiding this comment.
Oops, @ tagged you by username, sorry about that! @foo::@bar here are symbols >_>
Ben, use code blocks for those next time :P
There was a problem hiding this comment.
hahaha sorry about that :P
There was a problem hiding this comment.
Chatted offline a bit. Going to investigate that in a follow-up. It's not as straightforward as removing HAL_Executable:$executable here and pulling it out of the symbol reference later. It needs a hal.executable.lookup with a HAL_Device (which we might be able to carry through the DispatchState struct), or something similar.
|
|
||
| let arguments = (ins | ||
| HAL_CommandBuffer:$command_buffer, | ||
| HAL_Executable:$executable, // TODO(scotttodd): remove this and extract from nested ref? |
There was a problem hiding this comment.
(consistent with whatever we do above)
4830104 to
ef08751
Compare
Progress on #1890.
This splits
A new
ResolveEntryPointOrdinalsPassruns after linking but prior to serialization, converting the ops using references to ops using ordinals. Backends may choose to record with or without references. Since the VulkanSPIRV target may split dispatches, it uses ordinals directly and must solve linking in some specialized way (this will at least need more attention as we implement linking).