Quantized Tosa IR lowing to llvm IR

For now I have sucessfully converted tosa float IR to linalg on tensor-> llvm ir. Then JIT run it.

But for a Quantized Tosa IR, which including !quant.uniform<> type for some ops like tosa.rescale/tosa.conv2d. I failed to do the lowing.

In llvm-project/tosa-to-linalg.mlir at main · llvm/llvm-project · GitHub and llvm-project/TosaToLinalg.cpp at main · llvm/llvm-project · GitHub, seems tosa can only support float conv2d to linalg on tensor conversion.

So is there a way converting Quantized Tosa IR to llvm ir? If not, is there a plan to do it?

Thanks

1 Like

Representing the zero point shift of a couple of tosa ops is still being worked on – iirc, it is blocked by some cleanup in linalg that is planned but just not yet gotten to. @gysit @rsuderman

I believe there is a separate set of patterns for lowering rescale that you need to opt in to (the most efficient wear to represent it is target specific).

1 Like

I am working on linalg extensions to improve the support for scalar parameters. Together with other developments this extension should enable support for more complex operations. So I expect some progress over the course of the next weeks.

2 Likes

@stellaraccident @gysit Thanks alot, it really help.