Repository navigation
Description
For environments where the execution model is known to be exclusively local and inline (embedded systems) we can have a paired down HAL that pretty much only contains executable support. The idea is to still use HAL executable translation in the compiler but lowering the stream dialect to a new lightweight dialect that pretty much only manages executables and dispatches. Most of the local/ implementation of the executable loader and the loaders themselves have no dependencies on command buffers, allocators, buffers, or devices and can be cleanly pulled into the module without bringing in the bulk of the HAL API.
It's debatable whether the allocator/buffer stuff should be included - that would allow the coming allocator types to be reused but at the cost of additional non-user-controllable overheads. Since the local executables take byte spans all buffers could just be iree_vm_buffer_t which is already compiled in and available for use - and since they take a custom iree_allocator_t it's still possible for hosting applications to manage memory however they want.
Executables themselves will still be injected on the module when created same as today, allowing for dynamic, static, vmvx, etc executables to be run this way. This allows us to separate the execution model from the deployment model at the cost of a few vtables.
Outline:
- Add
hal_inlinedialect with basic ops:-
hal_inline.executable.create -
hal_inline.executable.dispatch -
hal_inline.executable_layout.create? (still need this to reuse loaders/libraries)
-
- Add
--execution-mode=iree-compile flag to switch betweenhal-asyncandhal-inline(or w/e)- Have a new
iree-hal-inline-transformation-pipelinethat still performs interface materialization and executable translation but otherwise lowersstreamitself
- Have a new
- Add
iree/modules/hal_inlineruntime module that links directly against theiree/hal/local/libraries - Build a runner tool that uses the inline module (or make iree-run-module/etc always support it with a flag)
(could also call this the inline dialect or something - it's still technically a HAL though as the executables being called are abstracted across hardware - can have CPU/FPGA/DSP/etc)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
benvanik commentedon Oct 24, 2022
Landed - can be enabled with
--iree-execution-model=inline-static(VMVX only) or--iree-execution-model=inline-dynamic(any CPU backend).