Back to directory

HGQ2: High Granularity Quantization 2

A quantization-aware training framework built on Keras 3 that optimizes neural-network bit-widths by gradient, down to a per-weight and per-activation level, for real-time deep learning on FPGAs and other edge devices.

HGQ2: High Granularity Quantization 2

HGQ2 optimizes bit-widths for quantized neural networks using gradients rather than manual tuning, at any granularity up to per-weight and per-activation, and reports an EBOPs resource estimate that tracks actual FPGA usage, either an upper bound on LUTs through da4ml or LUT-plus-DSP through hls4ml. Models trained with it convert to RTL such that the RTL output matches the Keras model's output, subject to floating-point precision limits.

It runs on TensorFlow, JAX or PyTorch, with JAX and TensorFlow benefiting from XLA compilation; training is reported to be 1.2 to 5 times faster than the previous HGQ implementation. It supports multiple ways of parameterizing fixed-point quantizers plus an alpha-quality minifloat quantizer with surrogate-gradient support, and adds support for more layer types, including EinsumDense with batch normalization and MultiHeadAttention with bit-accurate softmax and scaled dot-product attention.

It installs with pip, with optional da4ml (0.6 or newer) or hls4ml (1.2 or newer) for deployment to FPGA targets.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.