Skip to content

Releases: Brainchip-Inc/akida_examples

Upgrade to Quantizeml 0.11.1, Akida/CNN2SNN 2.9.0 and Akida models 1.6.0

25 Sep 09:55
Compare
Choose a tag to compare

This release is an update from the previous with:

  • Python 3.8 support dropped
  • Dependency updated to Tensorflow 2.15

Update QuantizeML to version 0.11.1

Bug fixes:

  • Update ONNX requirement to 1.13.x
  • Fix ONNX sanitize for Reshape nodes with allowzero
  • Apply Keras >2.13 variables naming context for all layers

Update Akida and CNN2SNN to version 2.9.0

Aligned with FPGA 1492/1515(ViT)

New features

  • [akida] Added the global average pooling WxH < 144 hardware constraint check at mapping time

Update Akida models to 1.6.0

  • Nothing to report.

Documentation update

  • Installation page updated to reflect python >3.9 and Tensorflow 2.15
  • Added an activity tracker tag on documentation pages

Upgrade to Quantizeml 0.10.1, Akida/CNN2SNN 2.8.1 and Akida models 1.5.2

12 Sep 13:15
Compare
Choose a tag to compare

Last release supporting python 3.8 and Tensorflow 2.10 to 2.12, next release will support python 3.9 to 3.11 and Tensorflow 2.15.

Update QuantizeML to version 0.10.1

New features

  • Introduced "analysis" module that allows to gather information about quantized layers and display quantization error informations
  • Implemented partial quantization that allows to stop at a given layer
  • Bias quantization improved in layers to handle outliers
  • Added support for '+' operation quantization in Tensorflow/Keras
  • Now handling ONNX models in "load_model"
  • Removed the deprecated 'check_quantization' API and CLI
  • Added dispatch for QTensor slicing
  • Added support for ReLU activation comming after an Add layer
  • Added support for Keras layers defined with an activation parameter
  • Updated ONNX sanitize function to handle MobileNetV1/V2 ops patterns
  • Optimized input shift quantization is ONNX skip connections
  • Added support for QuantizedConcatenate, QuantizedTransposedConvolution, QuantizedRescaling in ONNX

Bug fixes:

  • Fixed a cross-layer equalization issue with Conv2DTranspose
  • Prevented cross-layer equalization when layers do not perform an output scaling operation
  • Fixed a quantization issue with ONNX where models with skip connection and computation in both branches would lead to an invalid graph
  • Fixed a issue preventing to load quantized model into a multi-GPU setup
  • Fixed issues in sanitize when model comes with skip connections both on the Keras and ONNX paths
  • OutputQuantizer will now properly use their buffer_bitwidth parameter

Update Akida and CNN2SNN to version 2.8.1

Aligned with FPGA 1492/1515(ViT)

New features

  • [akida] Added a mapping mode to akida.Model.map that allows to map a model on AllNps (default), HwPr (all NPs and partial reconfig) or Minimal (legacy mode using less resources)
  • [akida] Added a 'run' CLI to perform an inference on device from a one line command
  • [akida] Added support for multi-sequence mapping for V2
  • [akida] Full support of Stem layer in V2 HW
  • [akida] Skip connection support in V2: added mesh discovery and early mapping algorithm
  • [akida] Model constructor that takes a list of layers as parameter now supports Add layers
  • [akida] Added support for CNP without activation but with max pooling enabled
  • [akida] When mapping is not possible after a search, the initial mapping is restored
  • [cnn2snn] Bumped QuantizeML requirement to 0.10.1 and included support for Add>ReLU conversion

Bug fixes:

  • [akida] Added an exception when unsigned inputs are fed to a V2 InputData
  • [akida] Updated MeshMapper behavior for DepthwiseConvolution layers
  • [akida] Restricted FNP > CNP mapping that is not supported
  • [akida] Fixed non-homogenous behavior in the mapping seach algorithm depending on the hw_only parameter

Update Akida models to 1.5.2

New features

  • Aligned with Akida/CNN2SNN 2.8.1 and QuantizeML 0.10.1
  • Improved AkidaNet18/CenterNet detection model training and architecture
  • Updated a large part of the 8-bits models from the zoo with better bias quantization (and accuracy)
  • Updated GXNOR/MNIST model quantization scheme
  • Fixed AkidaUNet evaluation pipeline
  • Added explicit dependency to tqdm
  • Improved exception handling in load_model

Documentation update

  • Added akida run CLI usage in Akida user guide
  • Added akida_models summary CLI usage in Akida models zoo user guide
  • Added analysis module in QuantizeML user guide
  • Reworked advanced ONNX quantization example that uses custom pattern to reflect updated supported patterns

Upgrade to Akida/CNN2SNN 2.7.2 and Akida models 1.5.0

26 Apr 11:03
Compare
Choose a tag to compare

Update Akida and CNN2SNN to version 2.7.2

New features

  • [akida] Full support of standard and depthwise transposed convolution in V2 hardware
  • [akida] Initial support of Stem in V2 hardware (not all used cased covered for now)
  • [akida] Introduced VitEncoderBlock layer: it corresponds to the groups of layers that will be mapped to an hardware block
  • [akida] Limited multi-sequence mapping on V2
  • [akida] Engine fully supports 8-bits outputs for Akida 2.0 (with/without activation)
  • [akida] Added a workaround to avoid race condition when NPs try to reach AeDMA
  • [akida] Added support for stride 2 1x1 Conv2D (pointwise) layers for ResNet50
  • [akida] Added support for 7x7, stride 2 with max pooling (pool_size=3, pool_stride=2) InputConv2D layer for ResNet50
  • [akida] Added an 'activation' parameter to Add layer for ResNet50
  • [akida] Improved NP count in 'Model.summary()' for 2.0 components
  • [akida] Improved layers docstrings
  • [cnn2snn] A set of layers that are compatible with a VitEncoderBlock will now be converted to the block instead of independent layers

Bug fixes:

  • [akida] Fixed and added restriction on successive mappings call that would lead in graph being invalidated and summary to crash
  • [akida] Fixed StatefulRecurrent fixture and variables ranges
  • [akida] Fixed clock_counter_en_ initialization
  • [akida] Fixed padding scheme for pointwise layers
  • [akida] Fixed an error when generating a trace with a Dequantizer layer
  • [akida] Fixed MadNorm layer corner case computation errors

Update Akida models to 1.5.0

New features

  • Aligned with CNN2SNN 2.7.2
  • Reworked the detection tools: dataset management now based on TensorFlow datasets, others tools updated accordingly, COCO dataset added
  • Updated AkidaNet YOLO/VOC model: now trained on COCO and transferred on the whole 20 VOC classes
  • Introduced AudioViT/Urbansound model, leveraging ViT backbone for audio classification
  • Added a 'summary' CLI to akida_models that handles Keras, ONNX and Akida models
  • Rebased DVSSamsung model architecture to its DVSGesture sibling for hardware efficiency
  • Pruned DS-CNN/KWS model from unnecessary reshape operations

Documentation update

  • Performances: added AudioViT, updated dectection and audio sections
  • Updated "Advanced ONNX model quantization" removing parts for patterns that are now supported

Upgrade to QuantizeML 0.8.1, Akida/CNN2SNN 2.7.0 and Akida models 1.4.0

23 Feb 16:00
Compare
Choose a tag to compare

Update QuantizeML to version 0.8.1

New features

  • Improvements for random samples calibration: limited to per-tensor quantization to allow proper calibration
  • Improved Recorders and internal variables management
  • Updated buffer_bitwidth maximum value to 28 for Conv2D, DepthwiseConv2D and their transposed version
  • OutputQuantizer now comes with a buffer_bitwidth value defaulting to 32 that is used during the scale out operation

Bug fixes:

  • Prevent generating random calibration samples twice
  • Limited available CLI action according to model file type

Update Akida and CNN2SNN to version 2.7.0

New features

  • [Akida] Complete support of legacy layers and 8-bits models on V2, including InputConv2D, Conv2D, DepthwiseConv2D and Dense layers, partial reconfiguration, and associated test suite
  • [Akida] Proper Dequantizer handling during mapping on hardware
  • [Akida] Extended mapping checks, aligned with hardware limitations
  • [Akida] AKD1500/PCIe is now able to use host memory
  • [Akida] SW simulation parallelization now based on batch size
  • [Akida] Layers docstring updated
  • [Akida] Homogenized Conv2D and DepthwiseConv2D layers parameters orders
  • [Akida] Layers come with an extra "post_op_buffer_bits" that specifies the bitwidth at which bias, activation and scale_out are performed
  • [CNN2SNN] Updated requirement to QuantizeML 0.8.1
  • [CNN2SNN] Improved check_model_compatibility error messages for both quantization and conversion
  • [CNN2SNN] As done for "act_step" during conversion towards V1, "threshold" is now clipped to HW limitation to allow conversion of QuantizeML models targeting V1
  • [CNN2SNN] Removed a limitation on weight bitwidth when converting from QuantizeML to V1

Bug fixes:

  • [Akida] Fixed issues where layers could be removed from sequence when mapping twice on a device and exception are thrown
  • [CNN2SNN] Fixed a conversion issue where shift value could be higher than 31

Update Akida models to 1.4.0

New features

  • Updated CNN2SNN minimal required version to 2.7.0 and QuantizeML to 0.8.1
  • Complete rework of the detection pipeline: now based on tensorflow_dataset instead of custom intermediate format
  • Reworked UTKFace model adding a global average pooling to make it hardware compatible
  • Calibration samples are now saved in int8/uint8 format
  • Fixed PlantVillage data augmentation that could create out-of-range values
  • Removed dependency to tensorflow-addons

Documentation update

  • Updated akida_models detection API and related YOLO example
  • Examples using ImageNet-like data now using a shared helper
  • Improved accuracy display in ImageNet-like based examples

Upgrade to QuantizeML 0.7.3, Akida/CNN2SNN 2.6.0 and Akida models 1.3.1

12 Dec 17:06
Compare
Choose a tag to compare

Update QuantizeML to version 0.7.3

New features

  • Quantization support for ONNX graph
  • ONNX quantization 'custom_pattern' feature
  • Allow padding value per-channel on first convolution
  • Proper support of dilation rate parameter
  • Removal of support of activation parameter in layers
  • Added a check on last-channel format
  • Quantization now supports per-axis offset and scale in Rescaling layer
  • Multiple reshape/flatten removal transformation
  • Added a pretty print on QuantizationParams class

Bug fixes:

  • Fixed a saturation that could happen when small amount of random samples are used for calibration
  • Configuration parameter will not wrongly be updated when used to create a quantized layer
  • Silenced a division by zero warning
  • Mean and variance are now non-trainable in QuantizedBatchNormalization
  • QuantizedDense buffer bitwidth limited to 28
  • FixedPoint.quantize no longer build incoherent frac_bits tensor and will default to a per-tensor quantization

Update Akida and CNN2SNN to version 2.6.0

New features

  • [Akida] Added support of SPI driver over FTDI to support AKD1500
  • [Akida] Added support for latest version of PCIe driver, focusing on AKD1500 support
  • [Akida] Added initial support for Conv2D/CNP programming and inference on Akida V2
  • [Akida] Added initial support for Dense1D/FNP3 programming and inference on Akida V2
  • [Akida] Added initial support for DepthwiseConv2D/CNP programming and inference on Akida V2
  • [Akida] Added initial support for InputConv2D/HRC programming and inference on Akida V2
  • [Akida] Implemented per-axis padding value support in InputConv2D
  • [Akida] Added support to perform multipass programming from AKD1500 flash
  • [Akida] Refactored PoolingCalculatedParams and the way it is built
  • [Akida] Dropped HwVersion.Latest support
  • [Akida] Updated engine deployed README to latest version
  • [CNN2SNN] Integrated support to convert ONNX graphs quantized with QuantizeML
  • [CNN2SNN] Raise a warning if input_scaling is used when converting to Akida V2.
  • [CNN2SNN] Added __version__ attribute to module.
  • [CNN2SNN] Removed input-shape dependency on ONNX graph
  • [CNN2SNN] Clarified support for dilation rate argument in Keras layers
  • [CNN2SNN] Added model equalization to avoid extreme variable values when converting QuantizeML V1 models
  • [CNN2SNN] Refactored check_model_compatibility that now takes a float model as input and checks quantization, conversion and optionally mapping
  • [CNN2SNN] Improved the block matching displayed error during conversion

Bug fixes:

  • [Akida] Fixed left shift overflow when programming some models
  • [Akida] Fixed on conv2d_map on windows
  • [Akida] Fixed DMA-related error when using raspberry PI and AKD1500 via PCIe
  • [Akida] Fixed error on program_info retrieval causing crash
  • [CNN2SNN] Allowed sequential model conversion
  • [CNN2SNN] Reject QuantizeConv2D using the groups parameter with a value different than 1 (unsupported)
  • [CNN2SNN] Correctly reject unbounded ReLU and ReLU without OutputQuantizer when converting towards V1

Update Akida models to 1.3.1

  • Updated CNN2SNN minimal required version to 2.6.0 and QuantizeML to 0.7.3

New features

  • Added a version attribute to the package
  • Improved helpers import path in all submodules
  • Removed default path to datasets in training scripts, they are now mandatory
  • Reworked ModelNet40/PointNet++ model so that it is hardware compatible
  • Added a ‘quantized’ parameter to pretrained helpers that will fetch float model when set to False
  • Removed apply_weights_to_model API that is already available in QuantizeML
  • Improved several docstrings
  • Improved transfer learning on PlantVillage
  • Improved fetch_file management of ConnectionResetError

Bug fixes:

  • Allowed non-square input for ImageNet preprocessing
  • Ill-formed URL path for pretrained model on Windows
  • Fixed AkidaNet edge and VWW pretrained checksums

Documentation update

  • Introduced "PyTorch to Akida", "Off-the-shelf models quantization" and "Advanced ONNX models quantization" examples
  • Added an Akida engine user guide
  • Updated QuantizeML user guide with ONNX support
  • Updated vision transformers example transform recommendation to single step
  • Updated transfer learning recommendation to not freezing the backbone
  • Dropped hardware constraints page

Upgrade to QuantizeML 0.5.3, Akida/CNN2SNN 2.4.0 and Akida models 1.2.0

05 Sep 12:58
Compare
Choose a tag to compare

Update QuantizeML to version 0.5.3

  • "quantize" (both method and CLI) will now also perform calibration and cross-layer equalization
  • Changed default quantization scheme to 8 bits (from 4) for both weights and activations

Update Akida and CNN2SNN to version 2.4.0

New features

  • [Akida] Updated compatibility with python 3.11, dropped support for python 3.7
  • [Akida] Support for unbounded ReLU activation by default
  • [Akida] C++ helper added on CLI to allow testing Akida engine from a host PC
  • [Akida] Prevent user from mixing V1 and V2 Layers
  • [Akida] Add fixtures for the DepthwiseConv2D
  • [Akida] Add AKD1500 virtual device
  • [Akida] Default buffer_bitwidth for all layers is now 32.
  • [Akida] InputConv2D parameters and Stem convolution parameters take the same parameters
  • [Akida] Estimated bit width of variables added to json serialised model
  • [Akida] Added Akida 1500 PCIe driver support
  • [Akida] Shifts are now uint8 instead of uint4
  • [Akida] Bias variables are now int8
  • [Akida] Support of Vision Transformer inference
  • [Akida] Model.predict now supports Akida 2.0 models
  • [Akida] Add an Akida 2.0 ExtractToken layer
  • [Akida] Add an Akida 2.0 Conv2D layer
  • [Akida] Add an Akida 2.0 Dense1D layer
  • [Akida] Add an Akida 2.0 DepthwiseConv2D layer
  • [Akida] Add an Akida 2.0 DepthwiseConv2DTranspose layer
  • [Akida] Add an Akida Dequantizer layer
  • [Akida] Support the conversion of QuantizeML CNN models into Akida 1.0 models
  • [Akida] Support the conversion of QuantizeML CNN models into Akida 2.0 models
  • [Akida] Support Dequantizer and Softmax on conversion of a QuantizeML model
  • [Akida] Model metrics now include configuration clocks
  • [Akida] Pretty-print serialized JSON model
  • [Akida] Include AKD1000 tests when deploying engine
  • [Akida/infra] Add first official ADK1500 PCIe driver support
  • [CNN2SNN] Updated dependency to QuantizeML 0.5.0
  • [CNN2SNN] Updated compatibility with tensorflow 2.12
  • [CNN2SNN] Provide a better solution to match the block pattern with the right conversion function
  • [CNN2SNN] Implement DenseBlockConverterVX
  • [CNN2SNN] GAP output quantizer can be signed
  • [CNN2SNN] removed input_is_image from convert API, now deduced by input channels

Bug fixes:

  • [Akida] Fixed wrong buffer size in update_learn_mem, leading to handling of bigger buffers than required
  • [Akida] Fixed issue in matmul operation leading to an overflow in corner cases
  • [Akida] Akida models could not be created by a list of layers starting from InputConv2D
  • [Akida] Increasing batch size between two forward did not work
  • [Akida] Fix variables shape check failure
  • [engine] Optimize output potentials parsing
  • [CNN2SNN] Fixed conversion issue when converting QuantizeML model with Reshape + Dense
  • [CNN2SNN] Convert with input_is_image=False raises an exception if the first layer is a Stem or InputConv2D

Note that version 2.3.7 is the last Akida and CNN2SNN drop supporting Python 3.7 (EOL end of June 2023).

Update Akida models to 1.2.0

  • Updated CNN2SNN minimal required version to 2.4.0 and QuantizeML to 0.5.2
  • Pruned the zoo from several models: Imagenette, cats_vs_dogs, melanoma classification, both occular disease, ECG classification, CWRU fault detection, VGG, face verification
  • Added load_model/save_models utils
  • Added a 'fused' option to separable layer block
  • Added a helper to unfuse SeparableConvolutional2D layers
  • Added a 'post_relu_gap' option to layer blocks
  • Stride 2 is now the default for MobileNet models
  • Training scripts will now always save the model after tuning/calibration/rescaling
  • Reworked GXNOR/MNIST pipeline to get rid of distillation
  • Removed the renaming module
  • Data server with pretrained models reorganized in preparation for Akida 2.0 models
  • Legacy 1.0 models have been updated towards 2.0, providing both a compatible architecture and a pretrained model
  • 2.0 models now also come with a pretrained 8bit helper (ViT, DeiT, CenterNet, AkidaNet18 and AkidaUNet)
  • ReLU max value is now configurable in layer_blocks module
  • It is now possible to build ‘unfused’ separable layer blocks
  • Legacy quantization parameters removed from model creation APIs
  • Added an extract.py module that allows samples extraction for model calibration
  • Dropped pruning tools support
  • Added Conv3D blocks

Bug fixes:

  • Removed duplicate DVS builders in create CLI
  • Silenced unexpected verbosity in detection models evaluation pipeline

Known issues:

  • Pretrained helpers will fail downloading models on Windows
  • Edge models are not available for 2.0 yet

Documentation update

  • Large rework of the documentation to integrate changes for 2.0
  • Added QuantizeML user guide, reference API and examples
  • Introduced a segmentation example
  • Introduced a vision transformer example
  • Introduce a tutorial to upgrade 1.0 to 2.0
  • Updated zoo performance page with 2.0 models
  • Aligned overall theme with Brainchip website
  • Fixed a menu display issue in the example section

Upgrade to akida/cnn2snn 2.3.0 and akida_models 1.1.9

08 Feb 13:23
Compare
Choose a tag to compare

Update akida and cnn2snn to version 2.3.0

New features

  • [akida] Upgrade to quantizeml 0.3.0
  • [akida] Implement an Integer Concat layer
  • [akida] Implement an akida Normalization layer
  • [akida] Create a Stem layer
  • [akida] Provide a method to serialize a model to a JSON file
  • [akida] Improved application generator allowing to link with akida library
  • [engine] Allocate only the required number of input dma descriptors
  • [engine] Fetch always clears dma interrupt

API changes

  • [akida] Remove weights and register readback
  • [akida] generate is now a stand-alone command
  • [akida] array_to_cpp moved to generate module
  • [engine] Move the reset of the EPG out of the engine
  • [engine] Implement a custom akida::Shape class

Update akida_models to 1.1.9

  • Updated cnn2snn minimal required version to 2.3.0 and quantizeml to 0.3.1
  • New AkidaNet18 model architecture
  • New CenterNet model architecture
  • Introduced ViTDeT YOLO architecture (DeiT + YOLOv2 head)
  • Dropped support for DeiT non distilled pretrained models

Upgrade to akida/cnn2snn 2.2.6 and akida_models 1.1.8

14 Dec 14:49
Compare
Choose a tag to compare

Update akida and cnn2snn to version 2.2.6

New features

  • [akida] Upgrade to quantizeml 0.0.13
  • [akida] Attention layer
  • [akida] Identify AKD500 devices
  • [engine] Move mesh scan to host library

API changes

  • [engine] toggle_learn must be called instead of program(p,learn_enabled)
  • [engine] set_batch_size allows to preallocate inputs

Bug fixes

  • [engine] Memory can grow indefinitely if queueing is faster than processing

Update akida_models to 1.1.8

  • updated CNN2SNN minimal required version to 2.2.6 and QuantizeML to 0.0.13
  • VWW model and training pipeline refactored and aligned with TinyML
  • Layer names in almost all models have been updated in preparation for quantization with QuantizeML
  • Tabular data models and tools have been removed from the package
  • Transformers pretrained models updated to 4-bits
  • Introduced calibration utils in training toolset
  • KWS and ImageNet training scripts now offer a "calibrate" CLI action
  • ImageNet training script will now automatically restore the best weights after training

Documentation update

  • dropped quantizeml API details for now

Upgrade to akida/cnn2snn 2.2.5, quantizeml 0.0.11 and akida_models 1.1.7

15 Nov 13:48
Compare
Choose a tag to compare

Update akida and cnn2snn to version 2.2.5

New features:

  • [akida] prevent loading a model from a version higher than the current one
  • [akida] add total number of NPs to akida model summary
  • [akida] new model summary including hardware passes
  • [akida/cnn2snn] new Shiftmax layer (software only)
  • [akida/cnn2snn] new Dense2D layer (software only)
  • [akida/cnn2snn] new Add layer (software only)
  • [cnn2snn] minimum TensorFlow version is now 2.10
  • [engine] optimize dense activations retrieval
  • [engine] new async API

Bug Fixes

  • [akida] support partial read/write in hardware traces dump
  • [akida] 1600 bytes allocated always for DMA should be optimized
  • [cnn2snn] AkidaNet/Imagenet training (QAT) fails to achieve model zoo performance
  • [engine] clock count now correctly evaluated in multipass
  • [engine] avoid double free on scratch buffer memory shortage (panic)

Update quantizeml to version 0.0.11

New features:

  • WeightQuantizer behaviour aligned on cnn2snn quantizer (always evaluate weights quantization during training)
  • TensorFlow required version is now 2.10.

Update akida_models to 1.1.7

  • introduced a segmentation model for Portrait128 based on SeparableConv2DTranspose
  • introduced the 'macs' CLI action
  • introduced a DeitDistiller object and enabled training with distillation in ImageNet pipeline
  • added tools to rename layers in models in preparation for quantizeml quantization
  • introduced 'fetch_file' that reimplements 'keras.utils.get_file' pre 2.8.0 behavior

Known issue: it is not possible to compute MACS for models quantized with quantizeml.

Documentation update

  • now contains a section with quantizeml API details

Upgrade to akida/cnn2snn 2.2.3 and akida_model 1.1.4

23 Aug 10:06
Compare
Choose a tag to compare

Update akida and cnn2snn to version 2.2.3

New features:

  • [akida] add support for python 3.10
  • [akida] support multiple layer inputs in software sequences
  • [akida] update Akida USB vendor ID
  • [engine] avoid superfluous copies

API changes:

  • [akida] new signature for Model.compile
  • [engine] outputs are now unique_ptr
  • [engine] Tensor::buffer is now public
  • [engine] memory mapping

Bug Fixes

  • [engine] memory corruption in learning with FNP2
  • [engine] learning now works in multipass with FNP3
  • [engine] overflow when programming Dense outputs for FNP
  • [cnn2snn] quantized weights go NaN during training
  • [cnn2snn] cannot quantize a model with MinValueConstraint from CLI

Update akida_models to 1.1.4

  • fixed a YOLO preprocessing issue where bounding boxes were not augmented along with the image
  • anchors files for YOLO models are now versioned
  • added a quantizeml 0.0.3 dependency to the package
  • introduced ViT and DeiT transformer model architectures that are using quantizeml features
  • updated ImageNet training script to work with the newly introduced transformer models

Documentation update

  • YOLO detection tutorial updated with mentions to calibration in the training pipeline
  • numbers of parameters for the models is now displayed in the model zoo page