Closed rpavlovicTT closed 2 months ago
FYI @ddilbazTT
@rpavlovicTT, Defne is currently refactoring the kernel desc interface to flatbuffer, if it's not too much effort to git mv
the translate to flatbuffer file, it'd probably make her rebase much smoother.
This commit refactors:
Dialect conversion from TTKernel to EmitC - fixes #317
Serialization of TTMetal IR to flatbuffer binary - fixes #316
Implement dialect conversion from TTKernel to EmitC TTKernel dialect that can be found nested in TTMetal ops can now be converted via 'convert-ttkernel-to-emitc' pass. Pass is registered as a func::FuncOp pass so the kernel must be put inside a function before conversion. When serializing ttmetal IR to binary, we call this conversion for every region of a ttmetal dispatch op.
FileCheck UT (
ttkernel.mlir
) is added. UT's output looks like:Serialization to flatbuffer binary is now a proper translation pass that can be run with:
ttmlir-translate --ttmetal-to-flatbuffer ttmetal.mlir
Example run:
One of dispatch op's kernel when translated to C++: