HGQ QMHA and QLinformer support for oneAPI #1432
HGQ QMHA and QLinformer support for oneAPI #1432laurilaatu wants to merge 9 commits intofastmachinelearning:mainfrom
Conversation
|
How are the names of tables associated with the layers? Is it now per-instance? |
| y[0] = 1; | ||
| return y.to_uint(); | ||
| // Extract the lower 'width' bits of x | ||
| return x.template slc<data_T::width>(0).to_uint(); |
There was a problem hiding this comment.
This is a logic change. Before it took the upper bits. Does it now assume that the table size is always the same as the width of the value? If so, I guess it must be reinforced somewhere. Are we sure we want this?
There was a problem hiding this comment.
I see the logic is unchanged for Vivado and libero, so I am hesitant to have this change.
| copyfile(srcpath, dstpath) | ||
|
|
||
| def __get_table_size(self, model, activation): | ||
| def __get_table_size(self, model, activation, table_name='table_size'): |
There was a problem hiding this comment.
table_name and table_size have very different meanings. Maybe table_name_size or something like that would read better?
|
I assume this also needs changes in |
|
Tests should be written (or hgq tests enabled) to show that this works as expected. |
|
Also consider the libero backend for how tables are created. We may want to unify the methods. oneAPI followed the Quartus style of LUTs, which is quite old. |
|
Scratch that about the Libero backend. Apparently it's just cut and paste code that has not been used or tested. So overall, I think this is fine other than potentially the |
Description
This PR adds the required changes to enable QMHA/QLinformer in oneAPI.
Requires parsing softmax tables from HGQ and support for multidim softmax.
Type of change
Tests
Test Configuration:
Checklist
pre-commiton the files I edited or added.