Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable scaled-int datatypes in InferDataTypes #167

Merged
merged 5 commits into from
Feb 1, 2025

Conversation

maltanar
Copy link
Collaborator

This PR adds an optional argument allow_scaledint_dtypes=True to InferDataTypes which controls whether SCALEDINT<x> datatypes will be inferred. If set to False, those will be inferred as FLOAT32 instead. A simple testcase is also included to verify this behaviorr.

Background: PR #53 introduced scaled-integer datatypes in InferDataTypes, mostly for the purposes of listing quantized values as scaled-integers in inferece cost. These datatypes may cause problems for backends downstream (like FINN) since they are incomplete e.g. they do not specify what the scale factor is to obtain the integer part.

@iksnagreb
Copy link
Contributor

Thank you, merging this seems (have not done any exhaustive testing yet) to make our FINN builds pass again. However, I wonder whether allow_scaledint_dtypes=False would be the more reasonable default to restore FINN-compatibility? With defaulting to True, we still would have to refactor any transformation in FINN which does InferDataTypes as a kind of cleanup transformation and it might be enough to miss one transformation to slip in some scaledint to have a broken build...

@maltanar maltanar merged commit 5b0d9fd into main Feb 1, 2025
5 checks passed
@maltanar maltanar deleted the feature/dtinf_no_scaledint branch February 1, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants