[Fix] Graph's input memory offset
Context
The memory manager generates offsets for each output of each layer within the graph, following a given layout (optimized, wrapping, ...).
Then each kernel within the CPP Export needs to get this memory layout for both its inputs and outputs.
However in the case of the very first layer of the graph, the memory layout of the input was not generated (as it is not the output of any layer).
Then default values were set within the _meminfo.jinja
template file, assuming the input would always be contiguous data.
However these default values were not correct, causing buffer overflow and segfault.
Changes
Two changes have been made to correct these default offsets :
-
in_size
was replaced byin_chan
when needed, according to what was found within the memory manager functions; -
in_sizeof
was added to make sure that the values actually are in bytes as it has recently been chosen.
Merge request reports
Activity
changed milestone to %aidge v0.7.0
added Fix 🔥🔥 Help Wanted StatusReview Ready TopicExport labels
requested review from @olivierbichler
assigned to @pineapple and @axelfarr
mentioned in merge request aidge_core!467 (merged)
@axelfarr Should be OK, but I am not sure of the template syntax notably for the in_dformat check and it may not be tested in unit tests... I think you should add the revelant unit tests also in this MR.
@axelfarr Can you add a unit test please for both cases ?
added 16 commits
-
4b251f96...2466d41d - 14 commits from branch
dev
- 10bbbf50 - [Fix] Change the default offset values for the input of the graph
- fdba9ac4 - Fixed standalone tensors dimensions
-
4b251f96...2466d41d - 14 commits from branch
mentioned in merge request !59 (merged)
@axelfarr Could you check if everything works now? Also, do not hesite to add unit tests for your cases. This MR must make it in 0.7.0.