cornell-zhang / allo

Allo: A Programming Model for Composable Accelerator Design
https://cornell-zhang.github.io/allo
Apache License 2.0
134 stars 28 forks source link

[Feature] Examples of how to import existing HLS module using .compose() primitive #166

Open bibo-msft opened 3 months ago

bibo-msft commented 3 months ago

Is your feature request related to a problem? Please describe. I want to add an existing HLS module into the Allo flow.

Describe the solution you'd like I need an example of how an HLS module, such as quantize/dequantize kernels, can be inserted in a design. To be specific, I want to insert an Int8 quantizer before a systolic array and dequantize the result back to Float32/16 as the input to the Gelu operator.

Additional context According to the end of Sec.6.1 of the Allo paper, this can be done with .compose() primitive. But I could not find an example in the repo.

chhzh123 commented 3 months ago

Hi @bibo-msft, sorry for the late reply and thanks for providing this kernel. Currently Allo exposes the .IPModule() interface for users to integrate their HLS kernels into the Allo program. Please refer to this test file for more examples.

Also, the current Allo C++ parser is restricted, so templates and classes are not supported yet. I'm testing your kernel and see what is the best way to integrate. Will get back to you soon.

chhzh123 commented 3 months ago

@bibo-msft We would appreciate it if you could provide more details about your current project so we can explore how best to support your team. Please feel free to email me at hzchen@cs.cornell.edu to discuss more details or schedule a meeting. Thanks!