New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove usage of nested PassManager from the compiler #1036
Comments
Mahesh points out that currently the SPIR-V/LLVM backends are using the RewriteLegacyIO pass - that'll also need to be setup in their new pipelines nested on the IREE::HAL::ExecutableSourceOp |
Chatting with river/mehdi it sounds like dynamic pass registration will be required to do this right. They've got plans to implement that this quarter, so my hope is to get everything else done except for the unnesting and then that can be done as a simple change when the infra is ready. |
Filed upstream issue here: https://bugs.llvm.org/show_bug.cgi?id=45643 |
This avoids needing to register all dialects that a TargetBackend transformation will create because we can now create the pipeline early and query that for its dependent dialects. Now TargetBackends are resposible only for declaring the dialects they create entities from in declareTargetOps, which is a localized thing. Resolves iree-org#1036
This avoids needing to register all dialects that a TargetBackend transformation will create because we can now create the pipeline early and query that for its dependent dialects. Now TargetBackends are resposible only for declaring the dialects they create entities from in declareTargetOps, which is a localized thing. It also nicely propagates pass manager options and gives us parallelism at the ExecutableTarget level. Resolves #1036
To make debugging easier I think it'd be good to remove the nested pass manager used during executable translation... somehow.
Right now, all executables for all targets are translated in a single parent pass (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Transforms/TranslateExecutables.cpp#L76) which then requires the various targets to initiate their own pass run (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Target/VMLA/VMLATarget.cpp#L70-L75).
If we instead move the logic for deriving target backends to the transform pipeline setup (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Transforms/Passes.cpp#L33) we could have the target registration function populate a nested pass manager (
nest<IREE::HAL::ExecutableOp>()
) with the passes it requires.This should make getting end-to-end reproducers easier.
Right now the target functions may do a bit of extra prep that we should remove or move to passes (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Target/VMLA/VMLATarget.cpp#L59-L67) before running their core passes (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Target/VMLA/VMLATarget.cpp#L71-L72) and finally serializing their contents (https://github.com/google/iree/blob/master/iree/compiler/Dialect/HAL/Target/VMLA/VMLATarget.cpp#L77-L111).
If instead each target had a serialization pass that took the contents and packed them into the flatbuffer then we don't need to run anything outside of the nested pass.
Initial tasks (unblocked):
makeLegacyExecutableABI
)Post-handwritten-VulkanSPIRVTarget.cpp-kernels:
(the logic in VulkanSPIRVTarget.cpp is complex right now with all the special cases/flags, but will be getting simpler soon)
The text was updated successfully, but these errors were encountered: