[Add] Possibility to create a GenericOperator from any Operator
Context
One envisionned use-case is to be able to replace actual Operator
obejcts with GenericOperator
that would behave differently even regarding the size of inputs/outputs Tensors.
For example, a Conv that works on 4-bits packed data, which input/output size would be different from the standard Conv operator because of memory alignments. This would be useful for the export of sub 8-bits kernels in the Cortex-M export.
Major modifications
Add possibility to create a GenericOperator
from any Operator
.
- add:
toGenericOp()
recipe to convert operator into GenericOperator - add:
Operator::inputCategory()
getter for input categories - add: comparison operator= to DynamicAttributes
- add: GenericOperator constructor from Operator
- add: unit-tests for
toGenericOperator()
recipe - upd: make std::array and std::pair recursively hashable in DynamicAttributes
- upd: make almost every
StaticAttributes
convertible toDynamicAttributes
Merge request reports
Activity
requested review from @thibaultallenet
assigned to @olivierbichler
added Enhancement ⭐ label
When building
./setup.sh -m core -m backend_cpu -m backend_cuda -m quantization --debug --python -j 32
Commits :
- core : b5ed3f15 (latest commit on this MR)
- backend_cpu : 8b99d4f1bfec0cb1aa91e3dea655558eeadc7968
- backend_cuda : 75102058f9e75db69a9836b27c900507cbc723ca
- quantization : f50c8606001b0fe800362bf15c607a605bacd432
Several errors are raised on DynamicAttributes.hpp during the build of aidge_quantization.
See file "log_error" for complete log : log_error.txt
Edited by Thibault Allenet@olivierbichler can you explain your changes in
DynamicAttributes.hpp
?Yes, I added the
makeTypeConditionallyAvailable
function that is called whenStaticAttributes::getAttrs()
is called. Its purpose is to register the types used inStaticAttributes
to make them fully usable inDynamicAttributes
, by providing anAnyUtils
for these types. This allows seamless copy of static attributes to dynamic ones!Edited by Olivier BICHLER
added 1 commit
- 5fd06284 - Added missing hash specialization for std::pair
added 24 commits
-
3c91814d...0da4f0a8 - 23 commits from branch
dev
- 49400010 - Merge branch 'dev' into genericop_from_op
-
3c91814d...0da4f0a8 - 23 commits from branch
enabled an automatic merge when all merge checks for 49400010 pass
Lets merge this so @thibaultallenet can move forward on his other MR.
mentioned in commit 8833a2bd
changed milestone to %aidge v0.5.0