1ac930a55SSrikanth Yalavarthi.. SPDX-License-Identifier: BSD-3-Clause 2ac930a55SSrikanth Yalavarthi Copyright (c) 2022 Marvell. 3ac930a55SSrikanth Yalavarthi 4ac930a55SSrikanth Yalavarthidpdk-test-mldev Application 5ac930a55SSrikanth Yalavarthi=========================== 6ac930a55SSrikanth Yalavarthi 7ac930a55SSrikanth YalavarthiThe ``dpdk-test-mldev`` tool is a Data Plane Development Kit (DPDK) application 8ac930a55SSrikanth Yalavarthithat allows testing various mldev use cases. 9ac930a55SSrikanth YalavarthiThis application has a generic framework to add new mldev based test cases 10ac930a55SSrikanth Yalavarthito verify functionality 11ac930a55SSrikanth Yalavarthiand measure the performance of inference execution on DPDK ML devices. 12ac930a55SSrikanth Yalavarthi 13ac930a55SSrikanth Yalavarthi 14ac930a55SSrikanth YalavarthiApplication and Options 15ac930a55SSrikanth Yalavarthi----------------------- 16ac930a55SSrikanth Yalavarthi 17ac930a55SSrikanth YalavarthiThe application has a number of command line options: 18ac930a55SSrikanth Yalavarthi 19ac930a55SSrikanth Yalavarthi.. code-block:: console 20ac930a55SSrikanth Yalavarthi 21ac930a55SSrikanth Yalavarthi dpdk-test-mldev [EAL Options] -- [application options] 22ac930a55SSrikanth Yalavarthi 23ac930a55SSrikanth Yalavarthi 24ac930a55SSrikanth YalavarthiEAL Options 25ac930a55SSrikanth Yalavarthi~~~~~~~~~~~ 26ac930a55SSrikanth Yalavarthi 27ac930a55SSrikanth YalavarthiThe following are the EAL command-line options that can be used 28ac930a55SSrikanth Yalavarthiwith the ``dpdk-test-mldev`` application. 29ac930a55SSrikanth YalavarthiSee the DPDK Getting Started Guides for more information on these options. 30ac930a55SSrikanth Yalavarthi 31ac930a55SSrikanth Yalavarthi``-c <COREMASK>`` or ``-l <CORELIST>`` 32ac930a55SSrikanth Yalavarthi Set the hexadecimal bitmask of the cores to run on. 33ac930a55SSrikanth Yalavarthi The corelist is a list of cores to use. 34ac930a55SSrikanth Yalavarthi 35ac930a55SSrikanth Yalavarthi``-a <PCI_ID>`` 36ac930a55SSrikanth Yalavarthi Attach a PCI based ML device. 37ac930a55SSrikanth Yalavarthi Specific to drivers using a PCI based ML device. 38ac930a55SSrikanth Yalavarthi 39ac930a55SSrikanth Yalavarthi``--vdev <driver>`` 40ac930a55SSrikanth Yalavarthi Add a virtual mldev device. 41ac930a55SSrikanth Yalavarthi Specific to drivers using a ML virtual device. 42ac930a55SSrikanth Yalavarthi 43ac930a55SSrikanth Yalavarthi 44ac930a55SSrikanth YalavarthiApplication Options 45ac930a55SSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~ 46ac930a55SSrikanth Yalavarthi 47ac930a55SSrikanth YalavarthiThe following are the command-line options supported by the test application. 48ac930a55SSrikanth Yalavarthi 49ac930a55SSrikanth Yalavarthi``--test <name>`` 50ac930a55SSrikanth Yalavarthi Name of the test to execute. 51bbd272edSSrikanth Yalavarthi ML tests are divided into three groups: Device, Model and Inference tests. 52bb38d854SSrikanth Yalavarthi Test name should be one of the following supported tests. 53bb38d854SSrikanth Yalavarthi 54bb38d854SSrikanth Yalavarthi **ML Device Tests** :: 55bb38d854SSrikanth Yalavarthi 56bb38d854SSrikanth Yalavarthi device_ops 57ac930a55SSrikanth Yalavarthi 58f6661e6dSSrikanth Yalavarthi **ML Model Tests** :: 59f6661e6dSSrikanth Yalavarthi 60f6661e6dSSrikanth Yalavarthi model_ops 61f6661e6dSSrikanth Yalavarthi 62bbd272edSSrikanth Yalavarthi **ML Inference Tests** :: 63bbd272edSSrikanth Yalavarthi 64bbd272edSSrikanth Yalavarthi inference_ordered 6588be513bSSrikanth Yalavarthi inference_interleave 66f6661e6dSSrikanth Yalavarthi 67ac930a55SSrikanth Yalavarthi``--dev_id <n>`` 68ac930a55SSrikanth Yalavarthi Set the device ID of the ML device to be used for the test. 69ac930a55SSrikanth Yalavarthi Default value is ``0``. 70ac930a55SSrikanth Yalavarthi 71ac930a55SSrikanth Yalavarthi``--socket_id <n>`` 72ac930a55SSrikanth Yalavarthi Set the socket ID of the application resources. 73ac930a55SSrikanth Yalavarthi Default value is ``SOCKET_ID_ANY``. 74ac930a55SSrikanth Yalavarthi 75f6661e6dSSrikanth Yalavarthi``--models <model_list>`` 76f6661e6dSSrikanth Yalavarthi Set the list of model files to be used for the tests. 77f6661e6dSSrikanth Yalavarthi Application expects the ``model_list`` in comma separated form 78f6661e6dSSrikanth Yalavarthi (i.e. ``--models model_A.bin,model_B.bin``). 79f6661e6dSSrikanth Yalavarthi Maximum number of models supported by the test is ``8``. 80f6661e6dSSrikanth Yalavarthi 81bbd272edSSrikanth Yalavarthi``--filelist <file_list>`` 82bbd272edSSrikanth Yalavarthi Set the list of model, input, output and reference files to be used for the tests. 83bbd272edSSrikanth Yalavarthi Application expects the ``file_list`` to be in comma separated form 84bbd272edSSrikanth Yalavarthi (i.e. ``--filelist <model,input,output>[,reference]``). 85bbd272edSSrikanth Yalavarthi 86bbd272edSSrikanth Yalavarthi Multiple filelist entries can be specified when running the tests with multiple models. 87bbd272edSSrikanth Yalavarthi Both quantized and dequantized outputs are written to the disk. 88bbd272edSSrikanth Yalavarthi Dequantized output file would have the name specified by the user through ``--filelist`` option. 89bbd272edSSrikanth Yalavarthi A suffix ``.q`` is appended to quantized output filename. 90bbd272edSSrikanth Yalavarthi Maximum number of filelist entries supported by the test is ``8``. 91bbd272edSSrikanth Yalavarthi 92*671e9c20SAnup Prabhu``--quantized_io`` 93*671e9c20SAnup Prabhu Disable IO quantization and dequantization. 94*671e9c20SAnup Prabhu 95bbd272edSSrikanth Yalavarthi``--repetitions <n>`` 96bbd272edSSrikanth Yalavarthi Set the number of inference repetitions to be executed in the test per each model. 97bbd272edSSrikanth Yalavarthi Default value is ``1``. 98bbd272edSSrikanth Yalavarthi 9939890f07SSrikanth Yalavarthi``--burst_size <n>`` 10039890f07SSrikanth Yalavarthi Set the burst size to be used when enqueuing / dequeuing inferences. 10139890f07SSrikanth Yalavarthi Default value is ``1``. 10239890f07SSrikanth Yalavarthi 103c0e87165SSrikanth Yalavarthi``--queue_pairs <n>`` 104c0e87165SSrikanth Yalavarthi Set the number of queue-pairs to be used for inference enqueue and dequeue operations. 105c0e87165SSrikanth Yalavarthi Default value is ``1``. 106c0e87165SSrikanth Yalavarthi 107c0e87165SSrikanth Yalavarthi``--queue_size <n>`` 108c0e87165SSrikanth Yalavarthi Set the size of queue-pair to be created for inference enqueue / dequeue operations. 109c0e87165SSrikanth Yalavarthi Queue size would translate into ``rte_ml_dev_qp_conf::nb_desc`` field during queue-pair creation. 110c0e87165SSrikanth Yalavarthi Default value is ``1``. 111c0e87165SSrikanth Yalavarthi 112da679339SSrikanth Yalavarthi``--tolerance <n>`` 113da679339SSrikanth Yalavarthi Set the tolerance value in percentage to be used for output validation. 114da679339SSrikanth Yalavarthi Default value is ``0``. 115da679339SSrikanth Yalavarthi 1165a82bc33SSrikanth Yalavarthi``--stats`` 1175a82bc33SSrikanth Yalavarthi Enable reporting device extended stats. 1185a82bc33SSrikanth Yalavarthi 119ac930a55SSrikanth Yalavarthi``--debug`` 120ac930a55SSrikanth Yalavarthi Enable the tests to run in debug mode. 121ac930a55SSrikanth Yalavarthi 122ac930a55SSrikanth Yalavarthi``--help`` 123ac930a55SSrikanth Yalavarthi Print help message. 124ac930a55SSrikanth Yalavarthi 125ac930a55SSrikanth Yalavarthi 126bb38d854SSrikanth YalavarthiML Device Tests 127bb38d854SSrikanth Yalavarthi--------------- 128bb38d854SSrikanth Yalavarthi 129bb38d854SSrikanth YalavarthiML device tests are functional tests to validate ML device API. 130bb38d854SSrikanth YalavarthiDevice tests validate the ML device handling configure, close, start and stop APIs. 131bb38d854SSrikanth Yalavarthi 132bb38d854SSrikanth Yalavarthi 133bb38d854SSrikanth YalavarthiApplication Options 134bb38d854SSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~ 135bb38d854SSrikanth Yalavarthi 136bb38d854SSrikanth YalavarthiSupported command line options for the ``device_ops`` test are following:: 137bb38d854SSrikanth Yalavarthi 138bb38d854SSrikanth Yalavarthi --debug 139bb38d854SSrikanth Yalavarthi --test 140bb38d854SSrikanth Yalavarthi --dev_id 141bb38d854SSrikanth Yalavarthi --socket_id 142c0e87165SSrikanth Yalavarthi --queue_pairs 143c0e87165SSrikanth Yalavarthi --queue_size 144bb38d854SSrikanth Yalavarthi 145bb38d854SSrikanth Yalavarthi 146bb38d854SSrikanth YalavarthiDEVICE_OPS Test 147bb38d854SSrikanth Yalavarthi~~~~~~~~~~~~~~~ 148bb38d854SSrikanth Yalavarthi 149c0e87165SSrikanth YalavarthiDevice ops test validates the device configuration and reconfiguration support. 150c0e87165SSrikanth YalavarthiThe test configures ML device based on the options 151c0e87165SSrikanth Yalavarthi``--queue_pairs`` and ``--queue_size`` specified by the user, 152c0e87165SSrikanth Yalavarthiand later reconfigures the ML device with the number of queue pairs and queue size 153c0e87165SSrikanth Yalavarthibased on the maximum specified through the device info. 154bb38d854SSrikanth Yalavarthi 155bb38d854SSrikanth Yalavarthi 156bb38d854SSrikanth YalavarthiExample 157bb38d854SSrikanth Yalavarthi^^^^^^^ 158bb38d854SSrikanth Yalavarthi 159bb38d854SSrikanth YalavarthiCommand to run ``device_ops`` test: 160bb38d854SSrikanth Yalavarthi 161bb38d854SSrikanth Yalavarthi.. code-block:: console 162bb38d854SSrikanth Yalavarthi 163bb38d854SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 164bb38d854SSrikanth Yalavarthi --test=device_ops 165bb38d854SSrikanth Yalavarthi 166c0e87165SSrikanth YalavarthiCommand to run ``device_ops`` test with user options: 167c0e87165SSrikanth Yalavarthi 168c0e87165SSrikanth Yalavarthi.. code-block:: console 169c0e87165SSrikanth Yalavarthi 170c0e87165SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 171c0e87165SSrikanth Yalavarthi --test=device_ops --queue_pairs <M> --queue_size <N> 172c0e87165SSrikanth Yalavarthi 173bb38d854SSrikanth Yalavarthi 174f6661e6dSSrikanth YalavarthiML Model Tests 175f6661e6dSSrikanth Yalavarthi-------------- 176f6661e6dSSrikanth Yalavarthi 177f6661e6dSSrikanth YalavarthiModel tests are functional tests to validate ML model API. 178f6661e6dSSrikanth YalavarthiModel tests validate the functioning of load, start, stop and unload ML models. 179f6661e6dSSrikanth Yalavarthi 180f6661e6dSSrikanth Yalavarthi 181f6661e6dSSrikanth YalavarthiApplication Options 182f6661e6dSSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~ 183f6661e6dSSrikanth Yalavarthi 184f6661e6dSSrikanth YalavarthiSupported command line options for the ``model_ops`` test are following:: 185f6661e6dSSrikanth Yalavarthi 186f6661e6dSSrikanth Yalavarthi --debug 187f6661e6dSSrikanth Yalavarthi --test 188f6661e6dSSrikanth Yalavarthi --dev_id 189f6661e6dSSrikanth Yalavarthi --socket_id 190f6661e6dSSrikanth Yalavarthi --models 191f6661e6dSSrikanth Yalavarthi 192f6661e6dSSrikanth YalavarthiList of model files to be used for the ``model_ops`` test can be specified 193f6661e6dSSrikanth Yalavarthithrough the option ``--models <model_list>`` as a comma separated list. 194f6661e6dSSrikanth YalavarthiMaximum number of models supported in the test is ``8``. 195f6661e6dSSrikanth Yalavarthi 196f6661e6dSSrikanth Yalavarthi.. note:: 197f6661e6dSSrikanth Yalavarthi 198f6661e6dSSrikanth Yalavarthi * The ``--models <model_list>`` is a mandatory option for running this test. 199f6661e6dSSrikanth Yalavarthi * Options not supported by the test are ignored if specified. 200f6661e6dSSrikanth Yalavarthi 201f6661e6dSSrikanth Yalavarthi 202f6661e6dSSrikanth YalavarthiMODEL_OPS Test 203f6661e6dSSrikanth Yalavarthi~~~~~~~~~~~~~~ 204f6661e6dSSrikanth Yalavarthi 205f6661e6dSSrikanth YalavarthiThe test is a collection of multiple sub-tests, 206f6661e6dSSrikanth Yalavarthieach with a different order of slow-path operations 207f6661e6dSSrikanth Yalavarthiwhen handling with `N` number of models. 208f6661e6dSSrikanth Yalavarthi 209f6661e6dSSrikanth Yalavarthi**Sub-test A:** 210f6661e6dSSrikanth Yalavarthiexecutes the sequence of load / start / stop / unload for a model in order, 211f6661e6dSSrikanth Yalavarthifollowed by next model. 212f6661e6dSSrikanth Yalavarthi 213f6661e6dSSrikanth Yalavarthi.. _figure_mldev_model_ops_subtest_a: 214f6661e6dSSrikanth Yalavarthi 215f6661e6dSSrikanth Yalavarthi.. figure:: img/mldev_model_ops_subtest_a.* 216f6661e6dSSrikanth Yalavarthi 217f6661e6dSSrikanth Yalavarthi Execution sequence of model_ops subtest A. 218f6661e6dSSrikanth Yalavarthi 219f6661e6dSSrikanth Yalavarthi**Sub-test B:** 220f6661e6dSSrikanth Yalavarthiexecutes load for all models, followed by a start for all models. 221f6661e6dSSrikanth YalavarthiUpon successful start of all models, stop is invoked for all models followed by unload. 222f6661e6dSSrikanth Yalavarthi 223f6661e6dSSrikanth Yalavarthi.. _figure_mldev_model_ops_subtest_b: 224f6661e6dSSrikanth Yalavarthi 225f6661e6dSSrikanth Yalavarthi.. figure:: img/mldev_model_ops_subtest_b.* 226f6661e6dSSrikanth Yalavarthi 227f6661e6dSSrikanth Yalavarthi Execution sequence of model_ops subtest B. 228f6661e6dSSrikanth Yalavarthi 229f6661e6dSSrikanth Yalavarthi**Sub-test C:** 230f6661e6dSSrikanth Yalavarthiloads all models, followed by a start and stop of all models in order. 231f6661e6dSSrikanth YalavarthiUpon completion of stop, unload is invoked for all models. 232f6661e6dSSrikanth Yalavarthi 233f6661e6dSSrikanth Yalavarthi.. _figure_mldev_model_ops_subtest_c: 234f6661e6dSSrikanth Yalavarthi 235f6661e6dSSrikanth Yalavarthi.. figure:: img/mldev_model_ops_subtest_c.* 236f6661e6dSSrikanth Yalavarthi 237f6661e6dSSrikanth Yalavarthi Execution sequence of model_ops subtest C. 238f6661e6dSSrikanth Yalavarthi 239f6661e6dSSrikanth Yalavarthi**Sub-test D:** 240f6661e6dSSrikanth Yalavarthiexecutes load and start for all models available. 241f6661e6dSSrikanth YalavarthiUpon successful start of all models, stop is executed for the models. 242f6661e6dSSrikanth Yalavarthi 243f6661e6dSSrikanth Yalavarthi.. _figure_mldev_model_ops_subtest_d: 244f6661e6dSSrikanth Yalavarthi 245f6661e6dSSrikanth Yalavarthi.. figure:: img/mldev_model_ops_subtest_d.* 246f6661e6dSSrikanth Yalavarthi 247f6661e6dSSrikanth Yalavarthi Execution sequence of model_ops subtest D. 248f6661e6dSSrikanth Yalavarthi 249f6661e6dSSrikanth Yalavarthi 250f6661e6dSSrikanth YalavarthiExample 251f6661e6dSSrikanth Yalavarthi^^^^^^^ 252f6661e6dSSrikanth Yalavarthi 253f6661e6dSSrikanth YalavarthiCommand to run ``model_ops`` test: 254f6661e6dSSrikanth Yalavarthi 255f6661e6dSSrikanth Yalavarthi.. code-block:: console 256f6661e6dSSrikanth Yalavarthi 257f6661e6dSSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 258f6661e6dSSrikanth Yalavarthi --test=model_ops --models model_1.bin,model_2.bin,model_3.bin, model_4.bin 259f6661e6dSSrikanth Yalavarthi 260f6661e6dSSrikanth Yalavarthi 261bbd272edSSrikanth YalavarthiML Inference Tests 262bbd272edSSrikanth Yalavarthi------------------ 263bbd272edSSrikanth Yalavarthi 264bbd272edSSrikanth YalavarthiInference tests are a set of tests to validate end-to-end inference execution on ML device. 265bbd272edSSrikanth YalavarthiThese tests executes the full sequence of operations required to run inferences 266bbd272edSSrikanth Yalavarthiwith one or multiple models. 267bbd272edSSrikanth Yalavarthi 268bbd272edSSrikanth Yalavarthi 269bbd272edSSrikanth YalavarthiApplication Options 270bbd272edSSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~ 271bbd272edSSrikanth Yalavarthi 272bbd272edSSrikanth YalavarthiSupported command line options for inference tests are following:: 273bbd272edSSrikanth Yalavarthi 274bbd272edSSrikanth Yalavarthi --debug 275bbd272edSSrikanth Yalavarthi --test 276bbd272edSSrikanth Yalavarthi --dev_id 277bbd272edSSrikanth Yalavarthi --socket_id 278bbd272edSSrikanth Yalavarthi --filelist 279bbd272edSSrikanth Yalavarthi --repetitions 28039890f07SSrikanth Yalavarthi --burst_size 281c0e87165SSrikanth Yalavarthi --queue_pairs 282c0e87165SSrikanth Yalavarthi --queue_size 283da679339SSrikanth Yalavarthi --tolerance 2845a82bc33SSrikanth Yalavarthi --stats 285bbd272edSSrikanth Yalavarthi 286bbd272edSSrikanth YalavarthiList of files to be used for the inference tests can be specified 287bbd272edSSrikanth Yalavarthithrough the option ``--filelist <file_list>`` as a comma separated list. 288bbd272edSSrikanth YalavarthiA filelist entry would be of the format 289bbd272edSSrikanth Yalavarthi``--filelist <model_file,input_file,output_file>[,reference_file]`` 290bbd272edSSrikanth Yalavarthiand is used to specify the list of files required to test with a single model. 291bbd272edSSrikanth YalavarthiMultiple filelist entries are supported by the test, one entry per model. 292bbd272edSSrikanth YalavarthiMaximum number of file entries supported by the test is ``8``. 293bbd272edSSrikanth Yalavarthi 29439890f07SSrikanth YalavarthiWhen ``--burst_size <num>`` option is specified for the test, 29539890f07SSrikanth Yalavarthienqueue and dequeue burst would try to enqueue or dequeue 29639890f07SSrikanth Yalavarthi``num`` number of inferences per each call respectively. 29739890f07SSrikanth Yalavarthi 298c0e87165SSrikanth YalavarthiIn the inference test, a pair of lcores are mapped to each queue pair. 299c0e87165SSrikanth YalavarthiMinimum number of lcores required for the tests is equal to ``(queue_pairs * 2 + 1)``. 300c0e87165SSrikanth Yalavarthi 301da679339SSrikanth YalavarthiOutput validation of inference would be enabled only 302da679339SSrikanth Yalavarthiwhen a reference file is specified through the ``--filelist`` option. 303da679339SSrikanth YalavarthiApplication would additionally consider the tolerance value 304da679339SSrikanth Yalavarthiprovided through ``--tolerance`` option during validation. 305da679339SSrikanth YalavarthiWhen the tolerance values is 0, CRC32 hash of inference output 306da679339SSrikanth Yalavarthiand reference output are compared. 307da679339SSrikanth YalavarthiWhen the tolerance is non-zero, element wise comparison of output is performed. 308da679339SSrikanth YalavarthiValidation is considered as successful only 309da679339SSrikanth Yalavarthiwhen all the elements of the output tensor are with in the tolerance range specified. 310da679339SSrikanth Yalavarthi 3115a82bc33SSrikanth YalavarthiEnabling ``--stats`` would print the extended stats supported by the driver. 3125a82bc33SSrikanth Yalavarthi 313bbd272edSSrikanth Yalavarthi.. note:: 314bbd272edSSrikanth Yalavarthi 315bbd272edSSrikanth Yalavarthi * The ``--filelist <file_list>`` is a mandatory option for running inference tests. 316bbd272edSSrikanth Yalavarthi * Options not supported by the tests are ignored if specified. 317da679339SSrikanth Yalavarthi * Element wise comparison is not supported when 318da679339SSrikanth Yalavarthi the output dtype is either fp8, fp16 or bfloat16. 319da679339SSrikanth Yalavarthi This is applicable only when the tolerance is greater than zero 320da679339SSrikanth Yalavarthi and for pre-quantized models only. 321bbd272edSSrikanth Yalavarthi 322bbd272edSSrikanth Yalavarthi 323bbd272edSSrikanth YalavarthiINFERENCE_ORDERED Test 324bbd272edSSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~~~~ 325bbd272edSSrikanth Yalavarthi 326bbd272edSSrikanth YalavarthiThis is a functional test for validating the end-to-end inference execution on ML device. 327bbd272edSSrikanth YalavarthiThis test configures ML device and queue pairs 328bbd272edSSrikanth Yalavarthias per the queue-pair related options (queue_pairs and queue_size) specified by the user. 329bbd272edSSrikanth YalavarthiUpon successful configuration of the device and queue pairs, 330bbd272edSSrikanth Yalavarthithe first model specified through the filelist is loaded to the device 331bbd272edSSrikanth Yalavarthiand inferences are enqueued by a pool of worker threads to the ML device. 332bbd272edSSrikanth YalavarthiTotal number of inferences enqueued for the model are equal to the repetitions specified. 333bbd272edSSrikanth YalavarthiA dedicated pool of worker threads would dequeue the inferences from the device. 334bbd272edSSrikanth YalavarthiThe model is unloaded upon completion of all inferences for the model. 335bbd272edSSrikanth YalavarthiThe test would continue loading and executing inference requests for all models 336bbd272edSSrikanth Yalavarthispecified through ``filelist`` option in an ordered manner. 337bbd272edSSrikanth Yalavarthi 338bbd272edSSrikanth Yalavarthi.. _figure_mldev_inference_ordered: 339bbd272edSSrikanth Yalavarthi 340bbd272edSSrikanth Yalavarthi.. figure:: img/mldev_inference_ordered.* 341bbd272edSSrikanth Yalavarthi 342bbd272edSSrikanth Yalavarthi Execution of inference_ordered on single model. 343bbd272edSSrikanth Yalavarthi 344bbd272edSSrikanth Yalavarthi 345bbd272edSSrikanth YalavarthiExample 346bbd272edSSrikanth Yalavarthi^^^^^^^ 347bbd272edSSrikanth Yalavarthi 348bbd272edSSrikanth YalavarthiExample command to run ``inference_ordered`` test: 349bbd272edSSrikanth Yalavarthi 350bbd272edSSrikanth Yalavarthi.. code-block:: console 351bbd272edSSrikanth Yalavarthi 352bbd272edSSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 353bbd272edSSrikanth Yalavarthi --test=inference_ordered --filelist model.bin,input.bin,output.bin 354bbd272edSSrikanth Yalavarthi 35539890f07SSrikanth YalavarthiExample command to run ``inference_ordered`` test with a specific burst size: 35639890f07SSrikanth Yalavarthi 35739890f07SSrikanth Yalavarthi.. code-block:: console 35839890f07SSrikanth Yalavarthi 35939890f07SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 36039890f07SSrikanth Yalavarthi --test=inference_ordered --filelist model.bin,input.bin,output.bin \ 36139890f07SSrikanth Yalavarthi --burst_size 12 36239890f07SSrikanth Yalavarthi 363c0e87165SSrikanth YalavarthiExample command to run ``inference_ordered`` test with multiple queue-pairs and queue size: 364c0e87165SSrikanth Yalavarthi 365c0e87165SSrikanth Yalavarthi.. code-block:: console 366c0e87165SSrikanth Yalavarthi 367c0e87165SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 368c0e87165SSrikanth Yalavarthi --test=inference_ordered --filelist model.bin,input.bin,output.bin \ 369c0e87165SSrikanth Yalavarthi --queue_pairs 4 --queue_size 16 370c0e87165SSrikanth Yalavarthi 371da679339SSrikanth YalavarthiExample command to run ``inference_ordered`` with output validation using tolerance of ``1%``: 372da679339SSrikanth Yalavarthi 373da679339SSrikanth Yalavarthi.. code-block:: console 374da679339SSrikanth Yalavarthi 375da679339SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 376da679339SSrikanth Yalavarthi --test=inference_ordered --filelist model.bin,input.bin,output.bin,reference.bin \ 377da679339SSrikanth Yalavarthi --tolerance 1.0 378da679339SSrikanth Yalavarthi 379bbd272edSSrikanth Yalavarthi 38088be513bSSrikanth YalavarthiINFERENCE_INTERLEAVE Test 38188be513bSSrikanth Yalavarthi~~~~~~~~~~~~~~~~~~~~~~~~~ 38288be513bSSrikanth Yalavarthi 38388be513bSSrikanth YalavarthiThis is a stress test for validating the end-to-end inference execution on ML device. 38488be513bSSrikanth YalavarthiThe test configures the ML device and queue pairs 38588be513bSSrikanth Yalavarthias per the queue-pair related options (queue_pairs and queue_size) specified by the user. 38688be513bSSrikanth YalavarthiUpon successful configuration of the device and queue pairs, 38788be513bSSrikanth Yalavarthiall models specified through the filelist are loaded to the device. 38888be513bSSrikanth YalavarthiInferences for multiple models are enqueued by a pool of worker threads in parallel. 38988be513bSSrikanth YalavarthiInference execution by the device is interleaved between multiple models. 39088be513bSSrikanth YalavarthiTotal number of inferences enqueued for a model are equal to the repetitions specified. 39188be513bSSrikanth YalavarthiAn additional pool of threads would dequeue the inferences from the device. 39288be513bSSrikanth YalavarthiModels would be unloaded upon completion of inferences for all models loaded. 39388be513bSSrikanth Yalavarthi 39488be513bSSrikanth Yalavarthi.. _figure_mldev_inference_interleave: 39588be513bSSrikanth Yalavarthi 39688be513bSSrikanth Yalavarthi.. figure:: img/mldev_inference_interleave.* 39788be513bSSrikanth Yalavarthi 39888be513bSSrikanth Yalavarthi Execution of inference_interleave on single model. 39988be513bSSrikanth Yalavarthi 40088be513bSSrikanth Yalavarthi 40188be513bSSrikanth YalavarthiExample 40288be513bSSrikanth Yalavarthi^^^^^^^ 40388be513bSSrikanth Yalavarthi 40488be513bSSrikanth YalavarthiExample command to run ``inference_interleave`` test: 40588be513bSSrikanth Yalavarthi 40688be513bSSrikanth Yalavarthi.. code-block:: console 40788be513bSSrikanth Yalavarthi 40888be513bSSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 40988be513bSSrikanth Yalavarthi --test=inference_interleave --filelist model.bin,input.bin,output.bin 41088be513bSSrikanth Yalavarthi 41188be513bSSrikanth YalavarthiExample command to run ``inference_interleave`` test with multiple models: 41288be513bSSrikanth Yalavarthi 41388be513bSSrikanth Yalavarthi.. code-block:: console 41488be513bSSrikanth Yalavarthi 41588be513bSSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 41688be513bSSrikanth Yalavarthi --test=inference_interleave --filelist model_A.bin,input_A.bin,output_A.bin \ 41788be513bSSrikanth Yalavarthi --filelist model_B.bin,input_B.bin,output_B.bin 41888be513bSSrikanth Yalavarthi 419c0e87165SSrikanth YalavarthiExample command to run ``inference_interleave`` test 420c0e87165SSrikanth Yalavarthiwith a specific burst size, multiple queue-pairs and queue size: 42139890f07SSrikanth Yalavarthi 42239890f07SSrikanth Yalavarthi.. code-block:: console 42339890f07SSrikanth Yalavarthi 42439890f07SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 42539890f07SSrikanth Yalavarthi --test=inference_interleave --filelist model.bin,input.bin,output.bin \ 426c0e87165SSrikanth Yalavarthi --queue_pairs 8 --queue_size 12 --burst_size 16 42739890f07SSrikanth Yalavarthi 428da679339SSrikanth YalavarthiExample command to run ``inference_interleave`` test 429da679339SSrikanth Yalavarthiwith multiple models and output validation using tolerance of ``2.0%``: 430da679339SSrikanth Yalavarthi 431da679339SSrikanth Yalavarthi.. code-block:: console 432da679339SSrikanth Yalavarthi 433da679339SSrikanth Yalavarthi sudo <build_dir>/app/dpdk-test-mldev -c 0xf -a <PCI_ID> -- \ 434da679339SSrikanth Yalavarthi --test=inference_interleave \ 435da679339SSrikanth Yalavarthi --filelist model_A.bin,input_A.bin,output_A.bin,reference_A.bin \ 436da679339SSrikanth Yalavarthi --filelist model_B.bin,input_B.bin,output_B.bin,reference_B.bin \ 437da679339SSrikanth Yalavarthi --tolerance 2.0 438da679339SSrikanth Yalavarthi 43988be513bSSrikanth Yalavarthi 440ac930a55SSrikanth YalavarthiDebug mode 441ac930a55SSrikanth Yalavarthi---------- 442ac930a55SSrikanth Yalavarthi 443ac930a55SSrikanth YalavarthiML tests can be executed in debug mode by enabling the option ``--debug``. 444ac930a55SSrikanth YalavarthiExecution of tests in debug mode would enable additional prints. 445da679339SSrikanth Yalavarthi 446da679339SSrikanth YalavarthiWhen a validation failure is observed, output from that buffer is written to the disk, 447da679339SSrikanth Yalavarthiwith the filenames having similar convention when the test has passed. 448da679339SSrikanth YalavarthiAdditionally index of the buffer would be appended to the filenames. 449