tancheng/CGRA-Flow

How can I map a kernel optimized by soda to CGRA?

MIONkb opened this issue · 2 comments

Dear Tancheng, good job in CGRA-FLOW!
Could you please answer me a question: soda-opt can optimize an application and then generate llvm IR. How can I generate a dfg from that, and then map to CGRA in this framework?

Hi,

Thanks for your interest. I guess you are talking about mlir-cgra? It is designed to lower a model onto CGRA for acceleration. For now, i have provide a simulator to functionally simulate the lowered/offloaded/generated IR running/mapped on the CGRA. This simulator provide you rough estimation about how many execution cycles it will take if the IR is mapped on CGRA in different ways (detailed in our DAC2023 paper). But the IR to mapping part still requires some manual work (you might need to do some coding in CGRA-Mapper to make it work in an automated way).

I will also probably try to integrate mlir-cgra with cgra-flow (for now, mlir-cgra is just placed in the folder and integration is not fully done), so it won't rely on the above mentioned simulator but run in our RTL simulation. If this could happen, you don't need to manually scope a portion of the IR, and then map to CGRA in this framework. It could be automated but I am not sure if I have time to do it soon.

FYI, soda-opt is born for integrating with HLS so it optimizes the IR targeting HLS rather than targeting CGRA mapping. CGRAs and FPGAs are two directions for IR/kernel/DFG's acceleration in my opinion (though they might share some common optimization techniques, e.g., unrolling).

I understand that, thanks for your contribution in CGRA modelling and auto-compile framework!