High Granularity Quantizarion for hls4ml
Project description
High Granularity Quantization for Ultra-Fast Inference on FPGAs
HGQ is a method for quantization aware training of neural works to be deployed on FPGAs, which allows for per-weight and per-activation bitwidth optimization.
Depending on the specific application, HGQ could achieve up to 10x resource reduction compared to the traditional AutoQkeras
approach, while maintaining the same accuracy. For some more challenging tasks, where the model is already under-fitted, HGQ could still improve the performance under the same on-board resource consumption. For more details, please refer to our paper (link coming not too soon).
This repository implements HGQ for tensorflow.keras
models. It is independent of the QKeras project.
Notice: this repository is still under development, and the API might change in the future.
This package is still under development. Any API might change without notice at any time
Installation
pip install HGQ
, and you are good to go. Note that HGQ requires python3.10
and tensorflow>=2.11
.
Usage Guide
Please refer to the usage guide for more details. This repo contains some use cases for HGQ.
FAQ
Please refer to the FAQ for more details.
Citation
The paper is not ready. Please check back later.
Important Usage Notice
When using HGQ in your project, remember to...
- Make sure
inp_q
is in the input quantizer layer's name. - Add
ResetMinMax
callback during training. - Call
compute_bops
before converting to hls4ml model.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file HGQ-0.1.3.tar.gz
.
File metadata
- Download URL: HGQ-0.1.3.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24085dc44276d83f1572343bc80e27c6bf6d0e5d598814e3095cf8a1e74e6d7 |
|
MD5 | d767e91c8a07fa910cc448af90635811 |
|
BLAKE2b-256 | dc448a33f154fb8f3281f31831ddae341c6a8dba5e832336b6acb4962e9f472e |
File details
Details for the file HGQ-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: HGQ-0.1.3-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 189e29966695d7aac38e6ef6d6a68441bf2738039ecbc48cda0e39c3b142de01 |
|
MD5 | 69e974a83c3b1a04176c439a2136b6d5 |
|
BLAKE2b-256 | e5768edd894e279622aa988c1e8cccf643e0d1a7bfa30f5d5d1e61027ef47fdb |