iree-opt
does not properly include backend (amdgpu
) dependent dialect for standalone (iree-gpu-lower-ops
) pass
#19081
Labels
bug 🐞
Something isn't working
What happened?
For end to end compilation with a simple batch gemm test case, I am able to confirm the test case can compile to finish. In order to observe what
iree-gpu-lower-ops
does (around how it lower amulti_mma
op tomfma
op), I intercepted the IR and manually compile it viairee-opt
.iree-opt
ended up crashing with error code:Upon investigation, a few evidence indicate that this shouldn't happen, including:
iree-opt --show-dialects
indeed print amdgpu as part of the available dialects.iree-opt --allow-unregistered-dialect
cannot prevent the pass from crashingiree-opt
registerAllDialects(registry)
is already invoked fromiree-opt
periree/compiler/src/iree/compiler/API/Internal/IREEOptToolEntryPoint.cpp
Line 148 in 3acb533
registry.insert<amdgpu::AMDGPUDialect>();
will continue to yield a crash fromiree-opt
amdgpu
dialect as a dependency at:iree/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Passes.td
Lines 57 to 63 in f6ca0e3
Tasks
Upon discussion in discord, the conclusion is that following needs to be fixed:
registerAllDialects()
doesn't include theamdgpu
dialect iniree-opt
standalone pass invokation.amdgpu
target isn't already included viaROCMTarget
that registersrocdl
dialect.--register-dialect
as a plumbing for user to register dialect in passes especially inTransforms
folder4
is undesirable and is not considered as a proper fix to this ticket.Steps to reproduce your issue
the IR from print-after-all right before this pass happens
iree-opt --iree-hal-target-backends=rocm --pass-pipeline="builtin.module(func.func(iree-gpu-lower-ops))" --iree-hip-target=gfx942 before_iree_gpu_lower_ops.mlir
iree-opt
crash wheniree-gpu-lower-ops
attempt to convert airee_gpu.multi_mma
op toamdgpu.mfma
op.The text was updated successfully, but these errors were encountered: