feat: Add missing operators for AIDGE model benchmarking
Context
I am working on benchmarking AIDGE models by fully creating them in AIDGE, setting their weights randomly, and exporting them to C++. The goal is to verify if the outputs in C++ match the forward pass results in AIDGE. You can find it here
To achieve this, I have added several missing operators necessary for running models such as:
- SqueezeNet
- ResNet18 / ResNet50
- MLP for MNIST
- MobileNet
These operators are now available in the export pipeline to ensure proper benchmarking.
Modified Files
-
Operators & Kernels
-
aidge_export_cpp/kernels/batchnorm.hpp
: Added missing batch normalization operator. -
aidge_export_cpp/kernels/concat.hpp
: Added concatenation operator. -
aidge_export_cpp/kernels/pad.hpp
: Added padding operator. -
aidge_export_cpp/kernels/pooling.hpp
: Added AvgPooling2D. -
aidge_export_cpp/kernels/softmax.hpp
: Added softmax operator.
-
-
Python Script
-
aidge_export_cpp/operators.py
: Updated operator handling to include new additions.
-
-
Configuration Templates
-
aidge_export_cpp/templates/configuration/*
: Added configurations for batchnorm, concat, pad, and softmax.
-
-
Kernel Forward Templates
-
aidge_export_cpp/templates/kernel_forward/*
: Added missing forward implementations for batchnorm, concat, pad, and softmax.
-
-
Unit Tests
-
aidge_export_cpp/unit_tests/test_export.py
: Updated tests to validate newly added operators.
-
Detailed Major Modifications
- Implemented missing operators to support model export and validation in C++.
- Ensured each new operator follows the existing API.
- Updated test cases to validate correctness of the exported model execution.
- Added the possibility of setting the weights inside the model randomly or with a default value to stay deterministic for the unit tests
TODO
-
Add some of the missing args of Pad2D. Do add assertion for now that attribute for padding is constant fill (i.e.do not support other attributes such as mirror etc...).
Merge request reports
Activity
@axelfarr FYI
assigned to @gallasko
added Feature 🚀 Unit-test 🧪 labels
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
changed milestone to %aidge v0.6.0
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
added StatusChanges required label
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
added 10 commits
- 7d5b8ce3 - feat: Added Batchnorm2d export op
- 3136f3c2 - feat: Added Concat export op
- a298e118 - feat: Added Pad2d export op
- 4a0dbb6f - feat: Added more tests
- 2c410ef5 - fix: Better control over random number generation
- b2dbf4da - fix: Some unit test failing
- a4c4b922 - fix: Only allow possitive value of variances in batchnorm
- c0763c37 - feat: Added AvgPooling2D export op
- 1bac314b - Pad works for with size mismatch
- 0b984f82 - Pad works now for all size of batch and rectangular aspects
Toggle commit list@mnewson FYI. Btw it may be worth adding your ConvNeXt model to the aidge_benchmark at a later date...
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
- Resolved by Christophe Guillon
mentioned in merge request !33 (closed)
changed milestone to %aidge v0.7.0
mentioned in merge request aidge_core!403 (merged)
added 6 commits
Toggle commit list- Resolved by Christophe Guillon
added 21 commits
- efa5e9bb...da88eb0f - 11 earlier commits
- 3d6707b0 - feat: Added more tests
- 939fdfc4 - fix: Better control over random number generation
- 6612538a - fix: Some unit test failing
- 9c5d3b0b - fix: Only allow possitive value of variances in batchnorm
- eefac137 - feat: Added AvgPooling2D export op
- 649a27e8 - fix: Better pad op implementation
- 52475cd1 - feat: Added more test cases to the test suite
- fb5ebdb2 - fix: Batch support for batchnorm
- 0cb91a4e - feat: Softmax works with any number of dimensions
- 520cabd6 - feat: Concat works for any axis
Toggle commit listadded 26 commits
-
e63fdee8...6a5441df - 12 commits from branch
eclipse/aidge:dev
- 6a5441df...1044a6b6 - 4 earlier commits
- 8f3170bf - feat: Added more tests
- 1aecd6c3 - fix: Better control over random number generation
- 0ee3b761 - fix: Some unit test failing
- 90f53c3d - fix: Only allow possitive value of variances in batchnorm
- f4815323 - feat: Added AvgPooling2D export op
- 8c84b470 - fix: Better pad op implementation
- d521dbed - feat: Added more test cases to the test suite
- d6064e31 - fix: Batch support for batchnorm
- 141e7c3e - feat: Softmax works with any number of dimensions
- 0f32cc6d - feat: Concat works for any axis
Toggle commit list-
e63fdee8...6a5441df - 12 commits from branch
Fine for me.
@cmoineau, I let you merge optionally as you may arbitrate better than me currently opened MR for this repo.