get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/132029/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 132029,
    "url": "http://patches.dpdk.org/api/patches/132029/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230927181159.9794-2-syalavarthi@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230927181159.9794-2-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230927181159.9794-2-syalavarthi@marvell.com",
    "date": "2023-09-27T18:11:55",
    "name": "[v3,1/4] mldev: add support for arbitrary shape dimensions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0ed22eb2b3a8f67866cdbe01a63a947146a37b50",
    "submitter": {
        "id": 2480,
        "url": "http://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230927181159.9794-2-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 29660,
            "url": "http://patches.dpdk.org/api/series/29660/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29660",
            "date": "2023-09-27T18:11:54",
            "name": "Spec changes to support multi I/O models",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/29660/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/132029/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/132029/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 055FA425B7;\n\tWed, 27 Sep 2023 20:12:15 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0992E402E6;\n\tWed, 27 Sep 2023 20:12:11 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 31487402DF\n for <dev@dpdk.org>; Wed, 27 Sep 2023 20:12:10 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 38RHOwnF012864 for <dev@dpdk.org>; Wed, 27 Sep 2023 11:12:09 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tcrrs05sg-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 27 Sep 2023 11:12:09 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Wed, 27 Sep 2023 11:12:07 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Wed, 27 Sep 2023 11:12:07 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 057B83F7090;\n Wed, 27 Sep 2023 11:12:07 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=b7mVc2dmHfmjl+4a0uwMixnhx3kfKTc7Ql4QcAjYfZI=;\n b=WCcGCrh0Vjk24jbfNiNSq+XhuDMVbm6CMjVM7LexxLOINYueZt0HbFFv9Hqa9E+Wwz20\n HY2XLhBA0Gj8cbt8ihHmN+ceHsF8Oz4QuyxJA0r0AXLHg0mduMeDuXEKblhPgv6Gru05\n q7ZsPxbnYjS5XO9rTLHBnl+zCJlMVnRT+/SxurrsBYccrZKajEKG6nG19FRLd6QHFLqU\n Xn1pEVFNs8kVXwADFKA9pSOkHXcWL/NPSfKJFfsm7wttxw20J/frocaT8DFruL98X+nI\n iBcDW06Bw3sE+D5GJ0cbAklvpOrUrDABZdXNk04TfDYELMKFf+MatHg1+fcBIatCNG+g gg==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <aprabhu@marvell.com>,\n <ptakkar@marvell.com>",
        "Subject": "[PATCH v3 1/4] mldev: add support for arbitrary shape dimensions",
        "Date": "Wed, 27 Sep 2023 11:11:55 -0700",
        "Message-ID": "<20230927181159.9794-2-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<20230927181159.9794-1-syalavarthi@marvell.com>",
        "References": "<20230830155303.30380-1-syalavarthi@marvell.com>\n <20230927181159.9794-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "f1IOwOuNvNzIMh-PPL4BVLUTtuwRq_LQ",
        "X-Proofpoint-GUID": "f1IOwOuNvNzIMh-PPL4BVLUTtuwRq_LQ",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-09-27_12,2023-09-27_01,2023-05-22_02",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Updated rte_ml_io_info to support shape of arbitrary\nnumber of dimensions. Dropped use of rte_ml_io_shape\nand rte_ml_io_format. Introduced new fields nb_elements\nand size in rte_ml_io_info.\n\nUpdated drivers and app/mldev to support the changes.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n app/test-mldev/test_inference_common.c | 97 +++++---------------------\n drivers/ml/cnxk/cn10k_ml_model.c       | 78 +++++++++++++--------\n drivers/ml/cnxk/cn10k_ml_model.h       | 12 ++++\n drivers/ml/cnxk/cn10k_ml_ops.c         | 11 +--\n lib/mldev/mldev_utils.c                | 30 --------\n lib/mldev/mldev_utils.h                | 16 -----\n lib/mldev/rte_mldev.h                  | 59 ++++------------\n lib/mldev/version.map                  |  1 -\n 8 files changed, 94 insertions(+), 210 deletions(-)",
    "diff": "diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c\nindex 05b221401b..b40519b5e3 100644\n--- a/app/test-mldev/test_inference_common.c\n+++ b/app/test-mldev/test_inference_common.c\n@@ -3,6 +3,7 @@\n  */\n \n #include <errno.h>\n+#include <math.h>\n #include <stdio.h>\n #include <unistd.h>\n \n@@ -18,11 +19,6 @@\n #include \"ml_common.h\"\n #include \"test_inference_common.h\"\n \n-#define ML_TEST_READ_TYPE(buffer, type) (*((type *)buffer))\n-\n-#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance) \\\n-\t(((float)output - (float)reference) <= (((float)reference * tolerance) / 100.0))\n-\n #define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err) \\\n \tdo { \\\n \t\tFILE *fp = fopen(name, \"w+\"); \\\n@@ -763,9 +759,9 @@ ml_inference_validation(struct ml_test *test, struct ml_request *req)\n {\n \tstruct test_inference *t = ml_test_priv((struct ml_test *)test);\n \tstruct ml_model *model;\n-\tuint32_t nb_elements;\n-\tuint8_t *reference;\n-\tuint8_t *output;\n+\tfloat *reference;\n+\tfloat *output;\n+\tfloat deviation;\n \tbool match;\n \tuint32_t i;\n \tuint32_t j;\n@@ -777,89 +773,30 @@ ml_inference_validation(struct ml_test *test, struct ml_request *req)\n \t\tmatch = (rte_hash_crc(model->output, model->out_dsize, 0) ==\n \t\t\t rte_hash_crc(model->reference, model->out_dsize, 0));\n \t} else {\n-\t\toutput = model->output;\n-\t\treference = model->reference;\n+\t\toutput = (float *)model->output;\n+\t\treference = (float *)model->reference;\n \n \t\ti = 0;\n next_output:\n-\t\tnb_elements =\n-\t\t\tmodel->info.output_info[i].shape.w * model->info.output_info[i].shape.x *\n-\t\t\tmodel->info.output_info[i].shape.y * model->info.output_info[i].shape.z;\n \t\tj = 0;\n next_element:\n \t\tmatch = false;\n-\t\tswitch (model->info.output_info[i].dtype) {\n-\t\tcase RTE_ML_IO_TYPE_INT8:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int8_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, int8_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(int8_t);\n-\t\t\treference += sizeof(int8_t);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_UINT8:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint8_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, uint8_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(float);\n-\t\t\treference += sizeof(float);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_INT16:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int16_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, int16_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(int16_t);\n-\t\t\treference += sizeof(int16_t);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_UINT16:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint16_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, uint16_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(uint16_t);\n-\t\t\treference += sizeof(uint16_t);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_INT32:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int32_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, int32_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(int32_t);\n-\t\t\treference += sizeof(int32_t);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_UINT32:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint32_t),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, uint32_t),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(uint32_t);\n-\t\t\treference += sizeof(uint32_t);\n-\t\t\tbreak;\n-\t\tcase RTE_ML_IO_TYPE_FP32:\n-\t\t\tif (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, float),\n-\t\t\t\t\t\t ML_TEST_READ_TYPE(reference, float),\n-\t\t\t\t\t\t t->cmn.opt->tolerance))\n-\t\t\t\tmatch = true;\n-\n-\t\t\toutput += sizeof(float);\n-\t\t\treference += sizeof(float);\n-\t\t\tbreak;\n-\t\tdefault: /* other types, fp8, fp16, bfloat16 */\n+\t\tdeviation =\n+\t\t\t(*reference == 0 ? 0 : 100 * fabs(*output - *reference) / fabs(*reference));\n+\t\tif (deviation <= t->cmn.opt->tolerance)\n \t\t\tmatch = true;\n-\t\t}\n+\t\telse\n+\t\t\tml_err(\"id = %d, element = %d, output = %f, reference = %f, deviation = %f %%\\n\",\n+\t\t\t       i, j, *output, *reference, deviation);\n+\n+\t\toutput++;\n+\t\treference++;\n \n \t\tif (!match)\n \t\t\tgoto done;\n+\n \t\tj++;\n-\t\tif (j < nb_elements)\n+\t\tif (j < model->info.output_info[i].nb_elements)\n \t\t\tgoto next_element;\n \n \t\ti++;\ndiff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c\nindex 92c47d39ba..26df8d9ff9 100644\n--- a/drivers/ml/cnxk/cn10k_ml_model.c\n+++ b/drivers/ml/cnxk/cn10k_ml_model.c\n@@ -366,6 +366,12 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_\n \taddr->total_input_sz_q = 0;\n \tfor (i = 0; i < metadata->model.num_input; i++) {\n \t\tif (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {\n+\t\t\taddr->input[i].nb_dims = 4;\n+\t\t\taddr->input[i].shape[0] = metadata->input1[i].shape.w;\n+\t\t\taddr->input[i].shape[1] = metadata->input1[i].shape.x;\n+\t\t\taddr->input[i].shape[2] = metadata->input1[i].shape.y;\n+\t\t\taddr->input[i].shape[3] = metadata->input1[i].shape.z;\n+\n \t\t\taddr->input[i].nb_elements =\n \t\t\t\tmetadata->input1[i].shape.w * metadata->input1[i].shape.x *\n \t\t\t\tmetadata->input1[i].shape.y * metadata->input1[i].shape.z;\n@@ -386,6 +392,13 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_\n \t\t\t\taddr->input[i].sz_q);\n \t\t} else {\n \t\t\tj = i - MRVL_ML_NUM_INPUT_OUTPUT_1;\n+\n+\t\t\taddr->input[i].nb_dims = 4;\n+\t\t\taddr->input[i].shape[0] = metadata->input2[j].shape.w;\n+\t\t\taddr->input[i].shape[1] = metadata->input2[j].shape.x;\n+\t\t\taddr->input[i].shape[2] = metadata->input2[j].shape.y;\n+\t\t\taddr->input[i].shape[3] = metadata->input2[j].shape.z;\n+\n \t\t\taddr->input[i].nb_elements =\n \t\t\t\tmetadata->input2[j].shape.w * metadata->input2[j].shape.x *\n \t\t\t\tmetadata->input2[j].shape.y * metadata->input2[j].shape.z;\n@@ -412,6 +425,8 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_\n \taddr->total_output_sz_d = 0;\n \tfor (i = 0; i < metadata->model.num_output; i++) {\n \t\tif (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {\n+\t\t\taddr->output[i].nb_dims = 1;\n+\t\t\taddr->output[i].shape[0] = metadata->output1[i].size;\n \t\t\taddr->output[i].nb_elements = metadata->output1[i].size;\n \t\t\taddr->output[i].sz_d =\n \t\t\t\taddr->output[i].nb_elements *\n@@ -426,6 +441,9 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_\n \t\t\t\t   model->model_id, i, addr->output[i].sz_d, addr->output[i].sz_q);\n \t\t} else {\n \t\t\tj = i - MRVL_ML_NUM_INPUT_OUTPUT_1;\n+\n+\t\t\taddr->output[i].nb_dims = 1;\n+\t\t\taddr->output[i].shape[0] = metadata->output2[j].size;\n \t\t\taddr->output[i].nb_elements = metadata->output2[j].size;\n \t\t\taddr->output[i].sz_d =\n \t\t\t\taddr->output[i].nb_elements *\n@@ -498,6 +516,7 @@ void\n cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)\n {\n \tstruct cn10k_ml_model_metadata *metadata;\n+\tstruct cn10k_ml_model_addr *addr;\n \tstruct rte_ml_model_info *info;\n \tstruct rte_ml_io_info *output;\n \tstruct rte_ml_io_info *input;\n@@ -508,6 +527,7 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)\n \tinfo = PLT_PTR_CAST(model->info);\n \tinput = PLT_PTR_ADD(info, sizeof(struct rte_ml_model_info));\n \toutput = PLT_PTR_ADD(input, metadata->model.num_input * sizeof(struct rte_ml_io_info));\n+\taddr = &model->addr;\n \n \t/* Set model info */\n \tmemset(info, 0, sizeof(struct rte_ml_model_info));\n@@ -529,24 +549,25 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)\n \t\tif (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {\n \t\t\trte_memcpy(input[i].name, metadata->input1[i].input_name,\n \t\t\t\t   MRVL_ML_INPUT_NAME_LEN);\n-\t\t\tinput[i].dtype = metadata->input1[i].input_type;\n-\t\t\tinput[i].qtype = metadata->input1[i].model_input_type;\n-\t\t\tinput[i].shape.format = metadata->input1[i].shape.format;\n-\t\t\tinput[i].shape.w = metadata->input1[i].shape.w;\n-\t\t\tinput[i].shape.x = metadata->input1[i].shape.x;\n-\t\t\tinput[i].shape.y = metadata->input1[i].shape.y;\n-\t\t\tinput[i].shape.z = metadata->input1[i].shape.z;\n+\t\t\tinput[i].nb_dims = addr->input[i].nb_dims;\n+\t\t\tinput[i].shape = addr->input[i].shape;\n+\t\t\tinput[i].type = metadata->input1[i].model_input_type;\n+\t\t\tinput[i].nb_elements = addr->input[i].nb_elements;\n+\t\t\tinput[i].size =\n+\t\t\t\taddr->input[i].nb_elements *\n+\t\t\t\trte_ml_io_type_size_get(metadata->input1[i].model_input_type);\n \t\t} else {\n \t\t\tj = i - MRVL_ML_NUM_INPUT_OUTPUT_1;\n+\n \t\t\trte_memcpy(input[i].name, metadata->input2[j].input_name,\n \t\t\t\t   MRVL_ML_INPUT_NAME_LEN);\n-\t\t\tinput[i].dtype = metadata->input2[j].input_type;\n-\t\t\tinput[i].qtype = metadata->input2[j].model_input_type;\n-\t\t\tinput[i].shape.format = metadata->input2[j].shape.format;\n-\t\t\tinput[i].shape.w = metadata->input2[j].shape.w;\n-\t\t\tinput[i].shape.x = metadata->input2[j].shape.x;\n-\t\t\tinput[i].shape.y = metadata->input2[j].shape.y;\n-\t\t\tinput[i].shape.z = metadata->input2[j].shape.z;\n+\t\t\tinput[i].nb_dims = addr->input[i].nb_dims;\n+\t\t\tinput[i].shape = addr->input[i].shape;\n+\t\t\tinput[i].type = metadata->input2[j].model_input_type;\n+\t\t\tinput[i].nb_elements = addr->input[i].nb_elements;\n+\t\t\tinput[i].size =\n+\t\t\t\taddr->input[i].nb_elements *\n+\t\t\t\trte_ml_io_type_size_get(metadata->input2[j].model_input_type);\n \t\t}\n \t}\n \n@@ -555,24 +576,25 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)\n \t\tif (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {\n \t\t\trte_memcpy(output[i].name, metadata->output1[i].output_name,\n \t\t\t\t   MRVL_ML_OUTPUT_NAME_LEN);\n-\t\t\toutput[i].dtype = metadata->output1[i].output_type;\n-\t\t\toutput[i].qtype = metadata->output1[i].model_output_type;\n-\t\t\toutput[i].shape.format = RTE_ML_IO_FORMAT_1D;\n-\t\t\toutput[i].shape.w = metadata->output1[i].size;\n-\t\t\toutput[i].shape.x = 1;\n-\t\t\toutput[i].shape.y = 1;\n-\t\t\toutput[i].shape.z = 1;\n+\t\t\toutput[i].nb_dims = addr->output[i].nb_dims;\n+\t\t\toutput[i].shape = addr->output[i].shape;\n+\t\t\toutput[i].type = metadata->output1[i].model_output_type;\n+\t\t\toutput[i].nb_elements = addr->output[i].nb_elements;\n+\t\t\toutput[i].size =\n+\t\t\t\taddr->output[i].nb_elements *\n+\t\t\t\trte_ml_io_type_size_get(metadata->output1[i].model_output_type);\n \t\t} else {\n \t\t\tj = i - MRVL_ML_NUM_INPUT_OUTPUT_1;\n+\n \t\t\trte_memcpy(output[i].name, metadata->output2[j].output_name,\n \t\t\t\t   MRVL_ML_OUTPUT_NAME_LEN);\n-\t\t\toutput[i].dtype = metadata->output2[j].output_type;\n-\t\t\toutput[i].qtype = metadata->output2[j].model_output_type;\n-\t\t\toutput[i].shape.format = RTE_ML_IO_FORMAT_1D;\n-\t\t\toutput[i].shape.w = metadata->output2[j].size;\n-\t\t\toutput[i].shape.x = 1;\n-\t\t\toutput[i].shape.y = 1;\n-\t\t\toutput[i].shape.z = 1;\n+\t\t\toutput[i].nb_dims = addr->output[i].nb_dims;\n+\t\t\toutput[i].shape = addr->output[i].shape;\n+\t\t\toutput[i].type = metadata->output2[j].model_output_type;\n+\t\t\toutput[i].nb_elements = addr->output[i].nb_elements;\n+\t\t\toutput[i].size =\n+\t\t\t\taddr->output[i].nb_elements *\n+\t\t\t\trte_ml_io_type_size_get(metadata->output2[j].model_output_type);\n \t\t}\n \t}\n }\ndiff --git a/drivers/ml/cnxk/cn10k_ml_model.h b/drivers/ml/cnxk/cn10k_ml_model.h\nindex 1f689363fc..4cc0744891 100644\n--- a/drivers/ml/cnxk/cn10k_ml_model.h\n+++ b/drivers/ml/cnxk/cn10k_ml_model.h\n@@ -409,6 +409,12 @@ struct cn10k_ml_model_addr {\n \n \t/* Input address and size */\n \tstruct {\n+\t\t/* Number of dimensions in shape */\n+\t\tuint32_t nb_dims;\n+\n+\t\t/* Shape of input */\n+\t\tuint32_t shape[4];\n+\n \t\t/* Number of elements */\n \t\tuint32_t nb_elements;\n \n@@ -421,6 +427,12 @@ struct cn10k_ml_model_addr {\n \n \t/* Output address and size */\n \tstruct {\n+\t\t/* Number of dimensions in shape */\n+\t\tuint32_t nb_dims;\n+\n+\t\t/* Shape of input */\n+\t\tuint32_t shape[4];\n+\n \t\t/* Number of elements */\n \t\tuint32_t nb_elements;\n \ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nindex 656467d891..e3faab81ba 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -321,8 +321,8 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)\n \tfprintf(fp, \"\\n\");\n \n \tprint_line(fp, LINE_LEN);\n-\tfprintf(fp, \"%8s  %16s  %12s  %18s  %12s  %14s\\n\", \"input\", \"input_name\", \"input_type\",\n-\t\t\"model_input_type\", \"quantize\", \"format\");\n+\tfprintf(fp, \"%8s  %16s  %12s  %18s  %12s\\n\", \"input\", \"input_name\", \"input_type\",\n+\t\t\"model_input_type\", \"quantize\");\n \tprint_line(fp, LINE_LEN);\n \tfor (i = 0; i < model->metadata.model.num_input; i++) {\n \t\tif (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {\n@@ -335,12 +335,10 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)\n \t\t\tfprintf(fp, \"%*s  \", 18, str);\n \t\t\tfprintf(fp, \"%*s\", 12,\n \t\t\t\t(model->metadata.input1[i].quantize == 1 ? \"Yes\" : \"No\"));\n-\t\t\trte_ml_io_format_to_str(model->metadata.input1[i].shape.format, str,\n-\t\t\t\t\t\tSTR_LEN);\n-\t\t\tfprintf(fp, \"%*s\", 16, str);\n \t\t\tfprintf(fp, \"\\n\");\n \t\t} else {\n \t\t\tj = i - MRVL_ML_NUM_INPUT_OUTPUT_1;\n+\n \t\t\tfprintf(fp, \"%8u  \", i);\n \t\t\tfprintf(fp, \"%*s  \", 16, model->metadata.input2[j].input_name);\n \t\t\trte_ml_io_type_to_str(model->metadata.input2[j].input_type, str, STR_LEN);\n@@ -350,9 +348,6 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)\n \t\t\tfprintf(fp, \"%*s  \", 18, str);\n \t\t\tfprintf(fp, \"%*s\", 12,\n \t\t\t\t(model->metadata.input2[j].quantize == 1 ? \"Yes\" : \"No\"));\n-\t\t\trte_ml_io_format_to_str(model->metadata.input2[j].shape.format, str,\n-\t\t\t\t\t\tSTR_LEN);\n-\t\t\tfprintf(fp, \"%*s\", 16, str);\n \t\t\tfprintf(fp, \"\\n\");\n \t\t}\n \t}\ndiff --git a/lib/mldev/mldev_utils.c b/lib/mldev/mldev_utils.c\nindex d2442b123b..ccd2c39ca8 100644\n--- a/lib/mldev/mldev_utils.c\n+++ b/lib/mldev/mldev_utils.c\n@@ -86,33 +86,3 @@ rte_ml_io_type_to_str(enum rte_ml_io_type type, char *str, int len)\n \t\trte_strlcpy(str, \"invalid\", len);\n \t}\n }\n-\n-void\n-rte_ml_io_format_to_str(enum rte_ml_io_format format, char *str, int len)\n-{\n-\tswitch (format) {\n-\tcase RTE_ML_IO_FORMAT_NCHW:\n-\t\trte_strlcpy(str, \"NCHW\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_NHWC:\n-\t\trte_strlcpy(str, \"NHWC\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_CHWN:\n-\t\trte_strlcpy(str, \"CHWN\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_3D:\n-\t\trte_strlcpy(str, \"3D\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_2D:\n-\t\trte_strlcpy(str, \"Matrix\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_1D:\n-\t\trte_strlcpy(str, \"Vector\", len);\n-\t\tbreak;\n-\tcase RTE_ML_IO_FORMAT_SCALAR:\n-\t\trte_strlcpy(str, \"Scalar\", len);\n-\t\tbreak;\n-\tdefault:\n-\t\trte_strlcpy(str, \"invalid\", len);\n-\t}\n-}\ndiff --git a/lib/mldev/mldev_utils.h b/lib/mldev/mldev_utils.h\nindex 5bc8020453..220afb42f0 100644\n--- a/lib/mldev/mldev_utils.h\n+++ b/lib/mldev/mldev_utils.h\n@@ -52,22 +52,6 @@ __rte_internal\n void\n rte_ml_io_type_to_str(enum rte_ml_io_type type, char *str, int len);\n \n-/**\n- * @internal\n- *\n- * Get the name of an ML IO format.\n- *\n- * @param[in] type\n- *\tEnumeration of ML IO format.\n- * @param[in] str\n- *\tAddress of character array.\n- * @param[in] len\n- *\tLength of character array.\n- */\n-__rte_internal\n-void\n-rte_ml_io_format_to_str(enum rte_ml_io_format format, char *str, int len);\n-\n /**\n  * @internal\n  *\ndiff --git a/lib/mldev/rte_mldev.h b/lib/mldev/rte_mldev.h\nindex fc3525c1ab..6204df0930 100644\n--- a/lib/mldev/rte_mldev.h\n+++ b/lib/mldev/rte_mldev.h\n@@ -863,47 +863,6 @@ enum rte_ml_io_type {\n \t/**< 16-bit brain floating point number. */\n };\n \n-/**\n- * Input and output format. This is used to represent the encoding type of multi-dimensional\n- * used by ML models.\n- */\n-enum rte_ml_io_format {\n-\tRTE_ML_IO_FORMAT_NCHW = 1,\n-\t/**< Batch size (N) x channels (C) x height (H) x width (W) */\n-\tRTE_ML_IO_FORMAT_NHWC,\n-\t/**< Batch size (N) x height (H) x width (W) x channels (C) */\n-\tRTE_ML_IO_FORMAT_CHWN,\n-\t/**< Channels (C) x height (H) x width (W) x batch size (N) */\n-\tRTE_ML_IO_FORMAT_3D,\n-\t/**< Format to represent a 3 dimensional data */\n-\tRTE_ML_IO_FORMAT_2D,\n-\t/**< Format to represent matrix data */\n-\tRTE_ML_IO_FORMAT_1D,\n-\t/**< Format to represent vector data */\n-\tRTE_ML_IO_FORMAT_SCALAR,\n-\t/**< Format to represent scalar data */\n-};\n-\n-/**\n- * Input and output shape. This structure represents the encoding format and dimensions\n- * of the tensor or vector.\n- *\n- * The data can be a 4D / 3D tensor, matrix, vector or a scalar. Number of dimensions used\n- * for the data would depend on the format. Unused dimensions to be set to 1.\n- */\n-struct rte_ml_io_shape {\n-\tenum rte_ml_io_format format;\n-\t/**< Format of the data */\n-\tuint32_t w;\n-\t/**< First dimension */\n-\tuint32_t x;\n-\t/**< Second dimension */\n-\tuint32_t y;\n-\t/**< Third dimension */\n-\tuint32_t z;\n-\t/**< Fourth dimension */\n-};\n-\n /** Input and output data information structure\n  *\n  * Specifies the type and shape of input and output data.\n@@ -911,12 +870,18 @@ struct rte_ml_io_shape {\n struct rte_ml_io_info {\n \tchar name[RTE_ML_STR_MAX];\n \t/**< Name of data */\n-\tstruct rte_ml_io_shape shape;\n-\t/**< Shape of data */\n-\tenum rte_ml_io_type qtype;\n-\t/**< Type of quantized data */\n-\tenum rte_ml_io_type dtype;\n-\t/**< Type of de-quantized data */\n+\tuint32_t nb_dims;\n+\t/**< Number of dimensions in shape */\n+\tuint32_t *shape;\n+\t/**< Shape of the tensor */\n+\tenum rte_ml_io_type type;\n+\t/**< Type of data\n+\t * @see enum rte_ml_io_type\n+\t */\n+\tuint64_t nb_elements;\n+\t/** Number of elements in tensor */\n+\tuint64_t size;\n+\t/** Size of tensor in bytes */\n };\n \n /** Model information structure */\ndiff --git a/lib/mldev/version.map b/lib/mldev/version.map\nindex 0706b565be..40ff27f4b9 100644\n--- a/lib/mldev/version.map\n+++ b/lib/mldev/version.map\n@@ -51,7 +51,6 @@ INTERNAL {\n \n \trte_ml_io_type_size_get;\n \trte_ml_io_type_to_str;\n-\trte_ml_io_format_to_str;\n \trte_ml_io_float32_to_int8;\n \trte_ml_io_int8_to_float32;\n \trte_ml_io_float32_to_uint8;\n",
    "prefixes": [
        "v3",
        "1/4"
    ]
}