Converting Krnl to Affine or Std

It seems that even after converting the Krnl dialect to the Affine dialect by running onnx-mlir-opt --convert-krnl-to-affine --lower-affine input.mlir > out.mlir, some operations of Krnl are not converted to Affine. How to get rid of the Krnl dialect ?

When I try to add the C wrappers using

mlir-opt --convert-std-to-llvm='emit-c-wrappers=1' --allow-unregistered-dialect out.mlir -o c.mlir

I am getting this error

out.mlir:2939:24: error: custom op 'krnl.vector_type_cast' is unknown
                %198 = krnl.vector_type_cast %95 : memref<256x64xf32> to memref<256x4xvector<16xf32>>

Thanks!

There is no such dialect in upstream MLIR. Where does your IR come from?

I generated the mlir code from an onnx file using onnx-mlir. I checked and Krnl is actually a dialect in onnx-mlir not in MLIR upstream.

Thanks!