Reorganization of the model folder and format - #1
Open
christophe0606 wants to merge 12 commits into
Open
Conversation
But tested only on a restricted set of operators.
Updated python script for new manifest format and new models folder organization.
pte now contains the test patterns and the thresholds for the test. memory format_channel last is not exported by pytorch (it is exported as channel_first for the constant_methods) so in those cases, the memory format of the input and expected tensors is converted before testing the operator. Additional semihosting exit function
Some tests were generated with random weights. It has been fixed and as result the model to test have changed. This commit updates the tests to use the new models.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR change the way models are represented and used. All the data needed for a test is now contained in the pte file:
It looks like tensors are exported as channel first when going through the constant_methods export path but some tests need channel last memory format. So a memory format boolean is used by the C++ test to correct the memory format of input tensor and expected output for some tests.
The model folder no more contain subdirectories but only the pte files.
The
manifest.jsonnow only contain the strings. Other data is in the pte.The models are now used through the new
EmbeddedModuleclass that is very similar to the executorchModuleclass. But originalModuleclass uses posix API likemmapso cannot be used for embedded development.Added new semihosting functions to quit the simulator at the end (since simulation was blocked at the end for some compilers).
cprojectandcsolutionare listing the versions of the PyTorch pack to use. So if version is upgraded, those files will need a change.The new tensor extension is built (but may not be needed for those tests)
AC6 is using full-fp mode so that
gelu,isnanandisinftests are passing.A simpler memory allocator is used for the
temporary memory allocations. Athough not needed for those tests, it is generally advised to
use such an allocator for the temporary memory allocator.
arm_embedded_module.cppadded to the project. It is a customization of theoriginal Meta
module.cppas explained by the copyright header.But it lives in a different namespace.
EmbeddedModelhas been modified. It no more needs anEmbeddedBuffersince the test patternscome from the pte.
Other field coming from pte have been removed.
gen_embedded_models.pyhas been modified to use the pte files directly (without any subfolders)and to use the new
manifest.jsonformatmain.cpp
More comments have been added to
main.cppSome debug functions have been added : to display a tensor or check its memory format.
A new function
to_channels_last_4d_floatto correct the memory format of the tensor has been added : note thatit makes a dynamic memory allocation which is ok for a test.
The test functions have been seperated:
tensor_all_closefor float (using standard all_close naming)Error handling may be improved but it is assumed that the pte have been generated in the right format.