Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
663 Discussions

Tensor libraries in C/C++ compatible with HLS

messn036
Novice
944 Views

Hello Intel Community,

I am working on a project that is porting a neural network written in pytorch into C so that it can be modified/optimized and then put on an FPGA. My current approach is just rewriting the code base in C, however, the functions relating to Tensors are not easy to understand or re-implement. There are very few libraries that implement tensor functions (multiplication, min, max, mean, view) in C (Xtensor, Libtorch, Eigen) and none that are supported by the HLS compiler.

Before writing my own, I wanted to post here to see if any work like this had already been done or if I am missing a compatible or builtin library.

Note: I am not familiar with the industry as this is for student research.

Thanks.

0 Kudos
4 Replies
BoonBengT_Intel
Moderator
931 Views

Hi @messn036,

Thank you for posting in Intel community forum and hope all is well.
We do have reusable function library bake in for HLS dealing with numbers, more details can be found here for random precision as well as advance math involved.
Please do have a look if that helps.

 

Best Wishes
BB

0 Kudos
messn036
Novice
871 Views

I was hoping to find a library that doesnt use dynamic memory location so that it would work out of the box with the intel HLS compiler. I ended up writing my own, though the matrix_mult function from intel's extended math library did help.

0 Kudos
BoonBengT_Intel
Moderator
896 Views

Hi @messn036,

 

Good day, just checking in to see if there is any further doubts in regards to this matter.
Hope we have clarify your doubts.

Best Wishes
BB

0 Kudos
BoonBengT_Intel
Moderator
845 Views

Hi @messn036,

 

Greetings, as we do not receive any further clarification on what is provided. Hence thread will now be transitioned to community support for further help on doubts in this thread. Pleasure having you here.

 

Best Wishes
BB

0 Kudos
Reply