Skip to content

Commit

Permalink
Docs: updating references to A2Q (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
i-colbert authored Aug 29, 2023
1 parent aa0c046 commit 0764832
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
10 changes: 4 additions & 6 deletions src/brevitas/core/scaling/pre_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
class ParameterPreScalingWeightNorm(brevitas.jit.ScriptModule):
"""
ScriptModule implementation of learned pre-clipping scaling factor to support weight
normalization-based quantization as proposed in `Quantized Neural Networks for Low-
Precision Accumulation with Guaranteed Overflow Avoidance` by I. Colbert, A. Pappalardo,
and J. Petri-Koenig.
normalization-based quantization as proposed in `A2Q: Accumulator-Aware Quantization
with Guaranteed Overflow Avoidance` by I. Colbert, A. Pappalardo, and J. Petri-Koenig.
The module parameterizes the pre-clipping scaling factor (i.e., `pre_scale`) of the
decoupled tensor quantizer (i.e., `DecoupledRescalingIntQuant`) by combining the
Expand Down Expand Up @@ -114,9 +113,8 @@ def _load_from_state_dict(
class AccumulatorAwareParameterPreScaling(ParameterPreScalingWeightNorm):
"""
ScriptModule implementation of learned pre-clipping scaling factor to support
accumulator-aware quantizaion (A2Q) as proposed in `Quantized Neural Networks for Low-
Precision Accumulation with Guaranteed Overflow Avoidance` by I. Colbert, A. Pappalardo,
and J. Petri-Koenig.
accumulator-aware quantizaion (A2Q) as proposed in `A2Q: Accumulator-Aware Quantization
with Guaranteed Overflow Avoidance` by I. Colbert, A. Pappalardo, and J. Petri-Koenig.
The module parameterizes the pre-clipping scaling factor (i.e., `pre_scale`) of the
decoupled tensor quantizer (i.e., `DecoupledRescalingIntQuant`) by combining the
Expand Down
20 changes: 10 additions & 10 deletions src/brevitas/quant/scaled_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,11 @@ class Int8ActPerTensorFloatBatchQuant1d(IntQuant,
class Int8WeightNormL2PerChannelFixedPoint(WeightNormPerChannelFloatDecoupled):
"""
Experimental 8-bit narrow signed integer quantizer with learned per-channel scaling factors
and L2 weight normalization based on `Quantized Neural Networks for Low-Precision Accumulation
with Guaranteed Overflow Avoidance` by I. Colbert, A. Pappalardo, and J. Petri-Koenig
(https://arxiv.org/abs/2301.13376). The quantizer learns scaling factors in the float domain and
learns vector parameter g in the log domain with the half-way rounding function. Suitable for
retraining from floating-point depthwise separable weights.
and L2 weight normalization based on `A2Q: Accumulator-Aware Quantization with Guaranteed Overflow
Avoidance` by I. Colbert, A. Pappalardo, and J. Petri-Koenig (https://arxiv.org/abs/2308.13504).
The quantizer learns scaling factors in the float domain and learns vector parameter g in the log
domain with the half-way rounding function. Suitable for retraining from floating-point depthwise
separable weights.
Examples:
>>> from brevitas.nn import QuantConv2d
Expand All @@ -421,11 +421,11 @@ class Int8WeightNormL2PerChannelFixedPoint(WeightNormPerChannelFloatDecoupled):
class Int8AccumulatorAwareWeightQuant(AccumulatorAwareWeightQuant):
"""
Experimental 8-bit narrow signed accumulator-aware integer quantizer with learned per-channel
scaling factors based on `Quantized Neural Networks for Low-Precision Accumulation with Guaranteed
Overflow Avoidance` by I.Colbert, A.Pappalardo, and J.Petri-Koenig (https://arxiv.org/abs/2301.13376).
The quantizer learns scaling factors in the float domain and learns vector parameter g in the log
domain with the round-to-zero rounding function. The norm is clamped according the the specified
accumulator bit-width. Suitable for retraining from floating-point depthwise separable weights.
scaling factors based on `A2Q: Accumulator-Aware Quantization with Guaranteed Overflow Avoidance`
by I.Colbert, A.Pappalardo, and J.Petri-Koenig (https://arxiv.org/abs/2308.13504). The quantizer
learns scaling factors in the float domain and learns vector parameter g in the log domain with
the round-to-zero rounding function. The norm is clamped according the the specified accumulator
bit-width. Suitable for retraining from floating-point depthwise separable weights.
Examples:
>>> from brevitas.nn import QuantConv2d
Expand Down
2 changes: 1 addition & 1 deletion src/brevitas_examples/super_resolution/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Integer-Quantized Super Resolution Experiments with Brevitas

This directory contains training scripts to demonstrate how to train integer-quantized super resolution models using [Brevitas](https://github.com/Xilinx/brevitas).
Code is also provided to demonstrate accumulator-aware quantization (A2Q) as proposed in our paper "[Quantized Neural Networks for Low-Precision Accumulation with Guaranteed Overflow Avoidance](https://arxiv.org/abs/2301.13376)".
Code is also provided to demonstrate accumulator-aware quantization (A2Q) as proposed in our ICCV 2023 paper "[A2Q: Accumulator-Aware Quantization with Guaranteed Overflow Avoidance](https://arxiv.org/abs/2308.13504)".

## Experiments

Expand Down

0 comments on commit 0764832

Please sign in to comment.