Skip to content

Commit 5a34b0d

Browse files
Gaurav Shuklaharman-kalra
authored andcommitted
doc: add machine learning application test usage
Added documentation for Machine Learning test usage. Made required changes for machine learning documentation Signed-off-by: Gaurav Shukla <gshukla@marvell.com> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com> Change-Id: I20919edb7f5f7d1e53fdc3e4944ee66ec30a8e06 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/136284 Reviewed-by: Abed Mohammad Kamaluddin <akamaluddin@marvell.com> Klocwork: Abed Mohammad Kamaluddin <akamaluddin@marvell.com> Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
1 parent 14d4817 commit 5a34b0d

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

doc/guides/applications/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Application User Guide
1414
smart-nic
1515
vpp
1616
tls-proxy-nginx
17+
machine-learning
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. SPDX-License-Identifier: Marvell-MIT
2+
Copyright (c) 2024 Marvell.
3+
4+
****************
5+
Machine Learning
6+
****************
7+
8+
Introduction
9+
============
10+
11+
The Data Plane Development Kit (DPDK) is an open-source software project managed by the Linux Foundation. It is designed to offload TCP packet processing from the operating system kernel to user-space processes, thereby enhancing computing efficiency and packet throughput.
12+
13+
The ``dpdk-test-mldev`` tool is a DPDK application designed to test various machine learning (mldev) use cases. As part of the DAO package, it provides a way for users to run inference operations with specific inputs. The current DAO release provides int8 ( ``resnet50_int8_t08_b01`` ) and fp16 ( ``resnet50_fp16_t08_b01`` ) quantized versions of Resnet50 models, which can be used for running inference operations.
14+
15+
.. note::
16+
For detailed documentation related to dpdk-test-mldev, refer to `documentation <https://doc.dpdk.org/guides/tools/testmldev.html>`_
17+
18+
Preprocessing of Input
19+
======================
20+
21+
Involves converting the input image format to a binary format that the model can accept as an input. This is done using the ``image2bin.py`` Python script.
22+
23+
.. code-block:: console
24+
25+
# Convert input in Image format to binary format
26+
python image2bin.py \
27+
--image_file input.jpeg \
28+
--bin_file output.bin
29+
30+
Model Execution
31+
===============
32+
33+
The preprocessed binary is given as an input to the model. The model processes the input, runs the inference operation, and generates the output in binary format.
34+
35+
.. code-block:: console
36+
37+
# Run inferences with dpdk-test-mldev application
38+
dpdk-test-mldev --lcores=4-23 -a 0000:00:10.0,fw_path=/lib/firmware/mlip-fw.bin -- \
39+
--test inference_ordered \
40+
--filelist model.tar,input.bin,output.bin,reference.bin \
41+
--tolerance 5 \
42+
--stats \
43+
--repetitions 1000
44+
45+
Postprocessing of Output
46+
========================
47+
48+
The binary output generated by the model is converted into a JSON file for easier interpretation and analysis. This is done using the ``bin2json.py`` Python script.
49+
50+
.. code-block:: console
51+
52+
# Convert output in binary format to JSON format
53+
python bin2json.py \
54+
--bin_file output.bin \
55+
--json_file output.json

0 commit comments

Comments
 (0)