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
Stateful hal.command_buffer canonicalizations/redundant op tracing #1155
Whether these are implemented using canonicalizers, a pass, or a utility in ConvertStreamOps is TBD, but basically we want to look at the hal.command_buffer.* methods and remove the ones that are redundant, including ops like hal.command_buffer.push_constants, hal.command_buffer.push_descriptor_set, hal.command_buffer.execution_barrier, etc.
This will allow us to emit more verbose (and correct) IR during transformation and ease the process of stream formation across basic blocks which is effectively similar to inlining in that can merge IR that came from separate places late in the process.
The goal is to emit only the ops that we know we need and no more, which will reduce module size (fewer ops), runtime execution overhead (fewer HAL export calls across VM/C++), driver API overhead (fewer calls to Vulkan functions), etc.
This would be implemented with DFA to track at each use of the command buffer what the assumptions on its internal state can be. Needs to support going through control flow.
A few bits of this have grown recently in iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp - it's not fantastic but can do peephole elision. It'll be more effective to spend time on reducing our unique binding/layout setup (#3502) over something specific to this.
Activity
benvanik commentedon Aug 30, 2021
This would be implemented with DFA to track at each use of the command buffer what the assumptions on its internal state can be. Needs to support going through control flow.
benvanik commentedon Nov 15, 2021
A few bits of this have grown recently in
iree/compiler/Dialect/HAL/Transforms/ElideRedundantCommands.cpp- it's not fantastic but can do peephole elision. It'll be more effective to spend time on reducing our unique binding/layout setup (#3502) over something specific to this.benvanik commentedon Jul 1, 2022
#3502 covers the most common cases of this.