Skip to content

Experimenting with Log8 Data Type in hls4ml #1144

Answered by bo3z
phucducnguyen asked this question in Q&A
Discussion options

You must be logged in to vote

log-precision is not natively supported in hls4ml but can be added. To do so, you would need to extend the current types with a new class, for e.g. LogType. We do something similar for other data types, e.g. Exponential, Binary, Ternary etc.; see here:

class ExponentPrecisionType(PrecisionType):

After that, in the model conversion step you need to make sure your weights are interpreted as the log data type. This is automatically done for QKeras and QONNX; i.e. if there is a binary/ternary/exponential weight the frontend parser will pick it up. You can see how this is done for QKeras here:

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by phucducnguyen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants