You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add dynamic flow.tensor.update (and other) ops to reduce readbacks #1160
compiler/dialectsRelating to the IREE compiler dialects (flow, hal, vm)enhancement ➕New feature or requestperformance ⚡Performance/optimization related work across the compiler and runtime
Current flow.tensor.update lowers to hal.command_buffer.copy_buffer, which is itself based on vkCmdCopyBuffer. vkCmdCopyBuffer requires that the source and destination data regions are known at the time the command is recorded into the command buffer, which means that if the flow.tensor.update is sourcing offsets from computed values will involve a host readback.
Instead, we could synthesize a dynamic copy executable for flow.tensor.update with dynamic arguments and then use the normal target backend lowerings to compile it and dispatch it. Instead of then mapping to hal.command_buffer.copy_buffer we'll just have a hal.command_buffer.dispatch that we can turn into an indirect dispatch (if shape is unknown) or pass in the offsets as arguments stored in other buffers.
Trying first to make the offsets static (improved by #1159) is best as the vkCmdCopyBuffer is easier to profile and inspect, however compared to avoiding the host round trip there's almost no amount of performance degradation a custom copy kernel would impose that would not make it a worthwhile transformation.
It's worth noting that many Vulkan implementations don't have dedicated command buffer copy operations (except when issuing on a dedicated DMA queue) and themselves emulate the copies with dispatched kernels. This would just be us doing the same.
compiler/dialectsRelating to the IREE compiler dialects (flow, hal, vm)enhancement ➕New feature or requestperformance ⚡Performance/optimization related work across the compiler and runtime
Activity