Skip to content

Commit 16daeb4

Browse files
freddan80facebook-github-bot
authored andcommitted
Increase memory allocated for inputs in case semi hosting is used. (#5309)
Summary: Enable E2E MNV2 unit test Pull Request resolved: #5309 Reviewed By: mcr229 Differential Revision: D62582648 Pulled By: digantdesai fbshipit-source-id: efa4b4f399cf6dee8e87ecfdc9885628c2c0e275
1 parent 9c5994d commit 16daeb4

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_mv2_tosa_BI(self):
8484
)
8585

8686
def test_mv2_u55_BI(self):
87-
(
87+
tester = (
8888
ArmTester(
8989
self.mv2,
9090
example_inputs=self.model_inputs,
@@ -96,4 +96,9 @@ def test_mv2_u55_BI(self):
9696
.check(list(self.operators_after_quantization))
9797
.partition()
9898
.to_executorch()
99+
.serialize()
99100
)
101+
if common.is_option_enabled("corstone300"):
102+
tester.run_method_and_compare_outputs(
103+
atol=1.0, qtol=1, inputs=self.model_inputs
104+
)

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,26 @@
2222

2323
#include "arm_perf_monitor.h"
2424

25-
/**
26-
* This header file is generated by the build process based on the .pte file
27-
* specified in the ET_PTE_FILE_PATH variable to the cmake build.
28-
* Control of the action of the .pte, it's use of operators and delegates, and
29-
* which are included in the bare metal build are also orchestrated by the
30-
* CMakeLists file. For example use see examples/arm/run.sh
31-
*/
3225
#ifdef SEMIHOSTING
33-
// TODO: Verify the section attribute to match the linker script
34-
// pending MLETORCH-39
35-
const size_t input_allocation_pool_size = 1 * 1024 * 1024;
26+
// In our unit test flow, we have the capability to provide an enitre model to
27+
// the Corstone-3xx FVP using semi hosting. Hence, the input allocation pool
28+
// needs to be large enough to take an entire model. On the FVP,
29+
// network_model_sec is linked to the DDR, which is large (256MB on
30+
// Corstone-300).
31+
const size_t input_allocation_pool_size = 100 * 1024 * 1024;
3632
unsigned char __attribute__((
3733
section("network_model_sec"),
3834
aligned(16))) input_allocation_pool[input_allocation_pool_size];
3935
// memory for the model will be allocated from the input_allocation_pool
4036
char* model_pte = nullptr;
4137
#else
38+
/**
39+
* This header file is generated by the build process based on the .pte file
40+
* specified in the ET_PTE_FILE_PATH variable to the cmake build.
41+
* Control of the action of the .pte, it's use of operators and delegates, and
42+
* which are included in the bare metal build are also orchestrated by the
43+
* CMakeLists file. For example use see examples/arm/run.sh
44+
*/
4245
#include "model_pte.h"
4346
#endif
4447

0 commit comments

Comments
 (0)