From: Yuan Zhao Date: Thu, 5 Sep 2019 20:40:36 +0000 (-0500) Subject: More example sizes adjustment with new TIDL lib X-Git-Tag: v01.03.01^2 X-Git-Url: https://git.ti.com/gitweb?p=tidl%2Ftidl-api.git;a=commitdiff_plain;h=268aecd993dec4faec1a414d6aac4c43b0c059ed More example sizes adjustment with new TIDL lib - MCT-1217 --- diff --git a/examples/one_eo_per_frame/main.cpp b/examples/one_eo_per_frame/main.cpp index c8000d1..2665bb6 100644 --- a/examples/one_eo_per_frame/main.cpp +++ b/examples/one_eo_per_frame/main.cpp @@ -101,6 +101,8 @@ bool Run(const string& config_file, int num_eve, int num_dsp, // Heap sizes for this network determined using Configuration::showHeapStats c.PARAM_HEAP_SIZE = (3 << 20); // 3MB c.NETWORK_HEAP_SIZE = (34 << 20); // 34MB + // AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if (num_eve > 2) num_eve = 2; c.numFrames = 16; diff --git a/examples/pybind/imagenet.py b/examples/pybind/imagenet.py index f249c09..4d83bbe 100755 --- a/examples/pybind/imagenet.py +++ b/examples/pybind/imagenet.py @@ -111,7 +111,7 @@ def run(num_eve, num_dsp, configuration, labels_file): # Heap sizes for this network determined using Configuration.showHeapStats configuration.param_heap_size = (3 << 20) - configuration.network_heap_size = (20 << 20) + configuration.network_heap_size = (34 << 20) try: diff --git a/examples/pybind/one_eo_per_frame.py b/examples/pybind/one_eo_per_frame.py index 81c9e22..dda9712 100755 --- a/examples/pybind/one_eo_per_frame.py +++ b/examples/pybind/one_eo_per_frame.py @@ -54,6 +54,9 @@ def main(): num_dsp = Executor.get_num_devices(DeviceType.DSP) num_eve = Executor.get_num_devices(DeviceType.EVE) + # AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if num_eve > 2: + num_eve = 2 if num_dsp == 0 and num_eve == 0: print('No TIDL API capable devices available') @@ -93,7 +96,7 @@ def run(num_eve, num_dsp, configuration): # Heap sizes for this network determined using Configuration.showHeapStats configuration.param_heap_size = (3 << 20) - configuration.network_heap_size = (20 << 20) + configuration.network_heap_size = (34 << 20) try: print('TIDL API: performing one time initialization ...') diff --git a/examples/pybind/two_eo_per_frame.py b/examples/pybind/two_eo_per_frame.py index 953c691..6090d7b 100755 --- a/examples/pybind/two_eo_per_frame.py +++ b/examples/pybind/two_eo_per_frame.py @@ -55,10 +55,13 @@ def main(): # Heap sizes for this network determined using Configuration.showHeapStats configuration.param_heap_size = (3 << 20) - configuration.network_heap_size = (20 << 20) + configuration.network_heap_size = (34 << 20) num_dsp = Executor.get_num_devices(DeviceType.DSP) num_eve = Executor.get_num_devices(DeviceType.EVE) + # AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if num_eve > 2: + num_eve = 2 if num_dsp == 0 or num_eve == 0: print('This example requires EVEs and DSPs.') diff --git a/examples/pybind/two_eo_per_frame_opt.py b/examples/pybind/two_eo_per_frame_opt.py index 2819555..1202511 100755 --- a/examples/pybind/two_eo_per_frame_opt.py +++ b/examples/pybind/two_eo_per_frame_opt.py @@ -51,10 +51,13 @@ def main(): # Heap sizes for this network determined using Configuration.showHeapStats configuration.param_heap_size = (3 << 20) - configuration.network_heap_size = (20 << 20) + configuration.network_heap_size = (34 << 20) num_dsp = Executor.get_num_devices(DeviceType.DSP) num_eve = Executor.get_num_devices(DeviceType.EVE) + # AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if num_eve > 2: + num_eve = 2 if num_dsp == 0 or num_eve == 0: print('This example requires EVEs and DSPs.') diff --git a/examples/ssd_multibox/main.cpp b/examples/ssd_multibox/main.cpp index 93f4c89..eaa61bd 100644 --- a/examples/ssd_multibox/main.cpp +++ b/examples/ssd_multibox/main.cpp @@ -166,6 +166,9 @@ bool RunConfiguration(const cmdline_opts_t& opts) c.enableApiTrace = opts.verbose; if (opts.num_eves == 0 || opts.num_dsps == 0) c.runFullNet = true; + // DSP only execution requires larger NETWORK HEAP size + if (opts.num_eves == 0) + c.NETWORK_HEAP_SIZE = 75000000; // setup camera/video input VideoCapture cap; diff --git a/examples/two_eo_per_frame/main.cpp b/examples/two_eo_per_frame/main.cpp index f309d4e..d746edc 100644 --- a/examples/two_eo_per_frame/main.cpp +++ b/examples/two_eo_per_frame/main.cpp @@ -92,6 +92,8 @@ bool Run(int num_eve, int num_dsp, const char* ref_output) // Heap sizes for this network determined using Configuration::showHeapStats c.PARAM_HEAP_SIZE = (3 << 20); // 3MB c.NETWORK_HEAP_SIZE = (34 << 20); // 34MB + // AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if (num_eve > 2) num_eve = 2; // Run this example for 16 input frames c.numFrames = 16; diff --git a/examples/two_eo_per_frame_opt/main.cpp b/examples/two_eo_per_frame_opt/main.cpp index 68d9221..c54b908 100644 --- a/examples/two_eo_per_frame_opt/main.cpp +++ b/examples/two_eo_per_frame_opt/main.cpp @@ -97,6 +97,8 @@ bool Run(int num_eve, int num_dsp, const char* ref_output) // Heap sizes for this network determined using Configuration::showHeapStats c.PARAM_HEAP_SIZE = (3 << 20); // 3MB c.NETWORK_HEAP_SIZE = (34 << 20); // 34MB + // AM572x default CMEM size is 160MB, 4 EVEs + 2DSPs won't fit + if (num_eve > 2) num_eve = 2; // Run this example for 16 input frames c.numFrames = 16;