28
28
// needs to be large enough to take an entire model. On the FVP,
29
29
// network_model_sec is linked to the DDR, which is large (256MB on
30
30
// Corstone-300).
31
- const size_t input_allocation_pool_size = 60 * 1024 * 1024 ;
31
+ const size_t input_allocation_pool_size = 100 * 1024 * 1024 ;
32
32
unsigned char __attribute__ ((
33
33
section (" network_model_sec" ),
34
34
aligned(16 ))) input_allocation_pool[input_allocation_pool_size];
@@ -63,7 +63,7 @@ using executorch::runtime::Span;
63
63
using executorch::runtime::Tag;
64
64
using executorch::runtime::TensorInfo;
65
65
66
- #define METHOD_ALLOCATOR_POOL_SIZE (60 * 1024 * 1024 )
66
+ #define METHOD_ALLOCATOR_POOL_SIZE (70 * 1024 * 1024 )
67
67
unsigned char __attribute__ ((
68
68
section (" network_model_sec" ),
69
69
aligned(16 ))) method_allocation_pool[METHOD_ALLOCATOR_POOL_SIZE];
@@ -326,8 +326,6 @@ int main(int argc, const char* argv[]) {
326
326
std::vector<Span<uint8_t >> planned_spans; // Passed to the allocator
327
327
size_t num_memory_planned_buffers = method_meta->num_memory_planned_buffers ();
328
328
329
- size_t planned_buffer_membase = method_allocator.used_size ();
330
-
331
329
for (size_t id = 0 ; id < num_memory_planned_buffers; ++id) {
332
330
size_t buffer_size =
333
331
static_cast <size_t >(method_meta->memory_planned_buffer_size (id).get ());
@@ -339,8 +337,6 @@ int main(int argc, const char* argv[]) {
339
337
planned_buffers.push_back (buffer);
340
338
planned_spans.push_back ({planned_buffers.back (), buffer_size});
341
339
}
342
- size_t planned_buffer_memsize =
343
- method_allocator.used_size () - planned_buffer_membase;
344
340
345
341
HierarchicalAllocator planned_memory (
346
342
{planned_spans.data (), planned_spans.size ()});
@@ -351,7 +347,6 @@ int main(int argc, const char* argv[]) {
351
347
MemoryManager memory_manager (
352
348
&method_allocator, &planned_memory, &temp_allocator);
353
349
354
- size_t method_loaded_membase = method_allocator.used_size ();
355
350
Result<Method> method = program->load_method (method_name, &memory_manager);
356
351
if (!method.ok ()) {
357
352
ET_LOG (
@@ -360,12 +355,10 @@ int main(int argc, const char* argv[]) {
360
355
method_name,
361
356
method.error ());
362
357
}
363
- size_t method_loaded_memsize =
364
- method_allocator.used_size () - method_loaded_membase;
365
358
ET_LOG (Info, " Method loaded." );
366
359
367
360
ET_LOG (Info, " Preparing inputs..." );
368
- size_t input_membase = method_allocator. used_size ();
361
+
369
362
auto inputs =
370
363
::prepare_input_tensors (*method, method_allocator, input_buffers);
371
364
@@ -376,15 +369,12 @@ int main(int argc, const char* argv[]) {
376
369
method_name,
377
370
inputs.error ());
378
371
}
379
- size_t input_memsize = method_allocator.used_size () - input_membase;
380
372
ET_LOG (Info, " Input prepared." );
381
373
382
374
ET_LOG (Info, " Starting the model execution..." );
383
- size_t executor_membase = method_allocator.used_size ();
384
375
StartMeasurements ();
385
376
Error status = method->execute ();
386
377
StopMeasurements ();
387
- size_t executor_memsize = method_allocator.used_size () - executor_membase;
388
378
389
379
if (status != Error::Ok) {
390
380
ET_LOG (
@@ -435,25 +425,6 @@ int main(int argc, const char* argv[]) {
435
425
}
436
426
out:
437
427
ET_LOG (Info, " Program complete, exiting." );
438
- if (method_allocator.size () != 0 ) {
439
- size_t method_allocator_used = method_allocator.used_size ();
440
- ET_LOG (
441
- Info,
442
- " Method allocator area ( method_allocator_planned: %zu method_allocator_loaded: %zu method_allocator_input: %zu method_allocator_executor: %zu ) total: %zu" ,
443
- planned_buffer_memsize,
444
- method_loaded_memsize,
445
- input_memsize,
446
- executor_memsize,
447
- method_allocator_used);
448
- ET_LOG (
449
- Info,
450
- " Method allocator area method_allocator_used: %d / method_allocator_size: %d method_allocator_free: %d ( used: %d %% ) " ,
451
- method_allocator_used,
452
- method_allocator.size (),
453
- method_allocator.free_size (),
454
- 100 * method_allocator_used / method_allocator.size ());
455
- }
456
-
457
428
#ifdef SEMIHOSTING
458
429
_exit (0 );
459
430
#endif
0 commit comments