Repository navigation
MetaTF 2.18 - Upgrade to Quantizeml 1.1.1, Akida/CNN2SNN 2.18.2 and Akida models 1.12.0
·
50 commits
to main
since this release
Update QuantizeML to version 1.1.1
New features
- Added InputQuantizer feature for Keras models (already available for ONNX). This will allow user to forward float32 inputs to quantized models and later to Akida models.
- Added support for Cast node in ONNX InputQuantizer to handle Keras models exported to ONNX with an input type different from float32
- Encapsulated sanitizers operations into a safe fail mechanism to prevent cryptic error messages.When prerequisites are not met for a sanitizer to be applied or some failure happens, the sanitizer is ignored and quantization will result in a clear unsupported chain of operations.
- Added new sets of sanitizers for both quantization and hardware compatibility:
- Transform
0.5 * (x * (op.Erf(x / math.sqrt(2)) + 1.0))into an explicit GeLU - Transform
Reshape(Conv)orSqueeze(Conv)toGemm(Flatten) - Transform depthwise layers with kernel 5 or 7 and stride 2 to an equivalent kernel 5 or 7 with stride 1 followed by identity kernel 3 with stride 2
- Invert batch normalization and pooling nodes for ONNX
- Transform
- Aligned depthwise quantization pattern with standard convolution patterns
- Dropped Add > ReLU quantization pattern that is not allowed in hardware
- Warnings now clearly state that process is continuing when non critical
Bug fixes
- Gemm followed by activation will now properly be downscaled to 8-bit (instead of 32)
- Quantization could produce out of range scales values that were not compatible with Akida
- Prevent adding identity layers after Add when outbound is a depthwise layer since hardware supports it
- Apply 8-bit downscaling to nodes that have both a quantized and a float outbound in ONNX
Update Akida and CNN2SNN to version 2.18.2
Aligned with FPGA-1764(2-nodes)/1765(6-nodes)/1766(6-nodes bittware)
New features and updates:
- [cnn2snn] Aligned with QuantizeML 1.1.1
- [cnn2snn] Now supports InputQuantizer layers in conversion patterns for both Keras and ONNX
- [akida] Introduced Akida.Quantizer layer that is the recipient for an InputQuantizer layer and that holds quantization scale, zero point, channel order and sign
- [akida] Introduced a new Akida.Padding.SameUpper padding mode for kernel 3, 5, 7 convolutions with a stride of 2 that matches PyTorch/ONNX "same upper" or "symmetric" padding scheme
- [akida] Introduced akida.compute_min_device and akida.compute_common_device APIs that allows to build minimal virtual devices to map a given model or list of models respectively
- [akida] Improved skip connection mapping for Add layers that are both merge and splits layers, especially when oubounds are two convolutional layers
- [akida] Improved hw_only=True mapping to build single sequence
- [akida] Warnings now explicitly state when non-critical
- [akida] Improved mapping error message when components shortage happens
- [akida] Removed "activation" parameter of Add layer (not a suppported feature)
Bug fixes
- [akida] Fixed an error message for out-of-bounds variables that was reporting incorrect signedness
- [akida] Fixed both computation and error message for HWPR number of descriptors and passes limitations
- [akida] Fixed a mapping error on concatenate layers when outbounds branches were of the same depth
- [akida] Fixed stride computation for StatefulRecurrent layer through nn.ops
- [akida] Fixed some top-level registers definition used in mesh discovery
- [akida] Fixed HRC hardware constraints check on 1.0
- [akida] Fixed 4-bit weights value check on 2.0
- [akida] Fixed mismatches for HRC in hardware when it has a large number of filters
- [akida] Fixed an hardware FIFO overflow error that could cause mismatches in models outputs
- [cnn2snn] Fixed a conversion issue for Rescaling layer and InputData in 1.0
- [cnn2snn] Fixed a conversion issue for InputConv2D layers with padding_value=0
Update Akida models to 1.12.0
Changes in akida_models package
- Aligned with QuantizeML 1.1.0 and CNN2SNN 2.18.0
- All models from the zoo have been updated with a typed input layer so that they will not have an InputQuantizer or akida.Quantizer layer. Training and evaluation pipelines have been updated accordingly.
- All quantized models from the zoo have been updated, optionally tuned, with the latest QuantizeML version without major accuracy difference
- Detection models training pipelines have been improved for an increased accuracy
- Edge models have been removed from 2.0 model zoo since the edge learning feature is 1.0 only
Bug fixes
- Removed the Rescaling layer from Jester model definition that was not used
- CenterNet models had an extra identity layer (sanitization issue) that has been removed
Documentation update
- Removed advanced quantization tutorial on custom pattern that was deprecated
- Updated models in tutorials so that they will not have an input quantizer