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

Is QAT supported in Keras 3.0 for TFLite Quantisation? #18930

Closed
tarushbansal opened this issue Dec 12, 2023 · 7 comments
Closed

Is QAT supported in Keras 3.0 for TFLite Quantisation? #18930

tarushbansal opened this issue Dec 12, 2023 · 7 comments
Assignees
Labels
keras-team-review-pending Pending review by a Keras team member. type:feature The user is asking for a new feature. type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@tarushbansal
Copy link

I couldn't find any mention of Quantisation Aware Training in the Keras 3 API documentation. Is it possible to convert the current Keras 3.0 models into quantisation-aware models with quantisation nodes added for TFLite conversion after training? If not, are there any plans to include this support in the future?

@SuryanarayanaY
Copy link
Contributor

Hi @tarushbansal ,

Have you seen this mobilevit tutorial that converts keras3 model into TFlite ? Is it what you are looking for ?

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Dec 27, 2023
@tarushbansal
Copy link
Author

tarushbansal commented Jan 7, 2024

Hi @SuryanarayanaY,
The mobilevit tutorial focuses on post-training quantisation instead. I am looking for a way to train the model in a quantisation aware setting just like previously supported by the TF Optimisation toolkit as in this example here.

@SuryanarayanaY SuryanarayanaY added the type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. label Jan 31, 2024
@SuryanarayanaY
Copy link
Contributor

Hi @tarushbansal ,

I am looking for a way to train the model in a quantisation aware setting just like previously supported by the TF Optimisation toolkit as in this example here.

The tutorial not working with Keras3. It seems Keras3 not yet supporting this feature. Escalating to Dev team for confirmation.

@SuryanarayanaY SuryanarayanaY added type:feature The user is asking for a new feature. keras-team-review-pending Pending review by a Keras team member. labels Jan 31, 2024
@fchollet
Copy link
Collaborator

fchollet commented Feb 1, 2024

This is not yet supported. However, Keras 3 will be adding its own QAT API in the near future.

@fchollet fchollet closed this as completed Feb 1, 2024
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@matpalm
Copy link
Contributor

matpalm commented Sep 20, 2024

is QAT still on the roadmap @fchollet ?

have been porting code to keras3 ( as a way to move more to Jax ) & have options for post training quantisation but expect a non trivial benefit from QAT in a number of projects.

can see a path forward by partially porting pieces of https://www.tensorflow.org/model_optimization/api_docs/python/tfmot and/or https://github.com/google/aqt but will hold back if a QAT api is imminent ? ( additionally; might have some bandwidth to help if there are community contrib options? )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keras-team-review-pending Pending review by a Keras team member. type:feature The user is asking for a new feature. type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

4 participants