Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/120252/?format=api
https://patches.dpdk.org/api/patches/120252/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20221129082109.6809-9-syalavarthi@marvell.com/", "project": { "id": 1, "url": "https://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": "<20221129082109.6809-9-syalavarthi@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221129082109.6809-9-syalavarthi@marvell.com", "date": "2022-11-29T08:21:06", "name": "[v2,09/12] app/mldev: enable support for inference batches", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "66b0d2506fc3697f9a1b6973b034e6931f0e73a6", "submitter": { "id": 2480, "url": "https://patches.dpdk.org/api/people/2480/?format=api", "name": "Srikanth Yalavarthi", "email": "syalavarthi@marvell.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20221129082109.6809-9-syalavarthi@marvell.com/mbox/", "series": [ { "id": 25915, "url": "https://patches.dpdk.org/api/series/25915/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=25915", "date": "2022-11-29T08:20:58", "name": "[v2,01/12] app/mldev: implement test framework for mldev", "version": 2, "mbox": "https://patches.dpdk.org/series/25915/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/120252/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/120252/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 9AB5EA0093;\n\tTue, 29 Nov 2022 09:21:56 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5F6A442D3A;\n\tTue, 29 Nov 2022 09:21:24 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 4A2B542BD9\n for <dev@dpdk.org>; Tue, 29 Nov 2022 09:21:18 +0100 (CET)", "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 2AT7sjLx020517 for <dev@dpdk.org>; Tue, 29 Nov 2022 00:21:17 -0800", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3m3k6wac9h-3\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 29 Nov 2022 00:21:17 -0800", "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.2;\n Tue, 29 Nov 2022 00:21:16 -0800", "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.2 via Frontend\n Transport; Tue, 29 Nov 2022 00:21:16 -0800", "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id C29E53F7086;\n Tue, 29 Nov 2022 00:21:15 -0800 (PST)" ], "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-type; s=pfpt0220; bh=Xi7pl1cHzE0Utv0E3WfPGCb+I0qTnvjBaMMOww/JGCE=;\n b=Hk/EoUynpc2xDIuXQlz4+ONO2xbrIL2YQMCYHjmzWkVPujW7/pONAf8fzRLPiPgko2EF\n P4md7a9qbJ0UWCd0W167Ypspy3+KbCoTDJbMbjAUhJfO/0ZjqWs6BU94AxvMaj7CGk0E\n UU80j7unfYQn0Pweh2Vb75WVghbq+xCNiAmdPbgYcq9+lwWjb7IyhUtUu4ipo689pCED\n fYILVKeJWHACl2jF8ZGG+0hVtNFdpu9MFT45lB0LUK+kcNrskA3bW0X3lzGYZ0bdPuwp\n Lz91thMKprR+PEmEHrYUY2Qvpl+yIAbIOgKEF5Aohb+a4IRQYw2i0k/YKAMFIhujSuqq dg==", "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>", "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>", "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>", "Subject": "[PATCH v2 09/12] app/mldev: enable support for inference batches", "Date": "Tue, 29 Nov 2022 00:21:06 -0800", "Message-ID": "<20221129082109.6809-9-syalavarthi@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20221129082109.6809-1-syalavarthi@marvell.com>", "References": "<20221129070746.20396-2-syalavarthi@marvell.com>\n <20221129082109.6809-1-syalavarthi@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-GUID": "MK5p6DbAeBnRitO_Ps9r8-tGQ4orOCeN", "X-Proofpoint-ORIG-GUID": "MK5p6DbAeBnRitO_Ps9r8-tGQ4orOCeN", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-11-29_06,2022-11-28_02,2022-06-22_01", "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": "Enabled support to execute multiple batches of inferences\nper each enqueue request. Input and reference for the test\nshould be appropriately provided for multi-batch run. Number\nof batches can be specified through \"--batches\" option.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n app/test-mldev/ml_options.c | 15 ++++++++++++---\n app/test-mldev/ml_options.h | 2 ++\n app/test-mldev/test_inference_common.c | 22 +++++++++++++---------\n app/test-mldev/test_model_common.c | 6 ++++++\n app/test-mldev/test_model_common.h | 1 +\n 5 files changed, 34 insertions(+), 12 deletions(-)", "diff": "diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c\nindex d5182a1701..331ec1704c 100644\n--- a/app/test-mldev/ml_options.c\n+++ b/app/test-mldev/ml_options.c\n@@ -33,6 +33,7 @@ ml_options_default(struct ml_options *opt)\n \topt->burst_size = 1;\n \topt->queue_pairs = 1;\n \topt->queue_size = 1;\n+\topt->batches = 0;\n \topt->debug = false;\n }\n \n@@ -176,6 +177,12 @@ ml_parse_queue_size(struct ml_options *opt, const char *arg)\n \treturn parser_read_uint16(&opt->queue_size, arg);\n }\n \n+static int\n+ml_parse_batches(struct ml_options *opt, const char *arg)\n+{\n+\treturn parser_read_uint16(&opt->batches, arg);\n+}\n+\n static void\n ml_dump_test_options(const char *testname)\n {\n@@ -196,7 +203,8 @@ ml_dump_test_options(const char *testname)\n \t\t \"\\t\\t--repetitions : number of inference repetitions\\n\"\n \t\t \"\\t\\t--burst_size : inference burst size\\n\"\n \t\t \"\\t\\t--queue_pairs : number of queue pairs to create\\n\"\n-\t\t \"\\t\\t--queue_size : size fo queue-pair\\n\");\n+\t\t \"\\t\\t--queue_size : size fo queue-pair\\n\"\n+\t\t \"\\t\\t--batches : number of batches of input\\n\");\n \t\tprintf(\"\\n\");\n \t}\n }\n@@ -220,7 +228,8 @@ static struct option lgopts[] = {\n \t{ML_TEST, 1, 0, 0},\t {ML_DEVICE_ID, 1, 0, 0}, {ML_SOCKET_ID, 1, 0, 0},\n \t{ML_MODELS, 1, 0, 0},\t {ML_FILELIST, 1, 0, 0}, {ML_REPETITIONS, 1, 0, 0},\n \t{ML_BURST_SIZE, 1, 0, 0}, {ML_QUEUE_PAIRS, 1, 0, 0}, {ML_QUEUE_SIZE, 1, 0, 0},\n-\t{ML_DEBUG, 0, 0, 0},\t {ML_HELP, 0, 0, 0},\t {NULL, 0, 0, 0}};\n+\t{ML_BATCHES, 1, 0, 0},\t {ML_DEBUG, 0, 0, 0},\t {ML_HELP, 0, 0, 0},\n+\t{NULL, 0, 0, 0}};\n \n static int\n ml_opts_parse_long(int opt_idx, struct ml_options *opt)\n@@ -232,7 +241,7 @@ ml_opts_parse_long(int opt_idx, struct ml_options *opt)\n \t\t{ML_SOCKET_ID, ml_parse_socket_id}, {ML_MODELS, ml_parse_models},\n \t\t{ML_FILELIST, ml_parse_filelist}, {ML_REPETITIONS, ml_parse_repetitions},\n \t\t{ML_BURST_SIZE, ml_parse_burst_size}, {ML_QUEUE_PAIRS, ml_parse_queue_pairs},\n-\t\t{ML_QUEUE_SIZE, ml_parse_queue_size},\n+\t\t{ML_QUEUE_SIZE, ml_parse_queue_size}, {ML_BATCHES, ml_parse_batches},\n \t};\n \n \tfor (i = 0; i < RTE_DIM(parsermap); i++) {\ndiff --git a/app/test-mldev/ml_options.h b/app/test-mldev/ml_options.h\nindex 6bfef1b979..d23e842895 100644\n--- a/app/test-mldev/ml_options.h\n+++ b/app/test-mldev/ml_options.h\n@@ -22,6 +22,7 @@\n #define ML_BURST_SIZE (\"burst_size\")\n #define ML_QUEUE_PAIRS (\"queue_pairs\")\n #define ML_QUEUE_SIZE (\"queue_size\")\n+#define ML_BATCHES (\"batches\")\n #define ML_DEBUG (\"debug\")\n #define ML_HELP\t (\"help\")\n \n@@ -41,6 +42,7 @@ struct ml_options {\n \tuint16_t burst_size;\n \tuint16_t queue_pairs;\n \tuint16_t queue_size;\n+\tuint16_t batches;\n \tbool debug;\n };\n \ndiff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c\nindex d680d68f3d..4e29f6c7eb 100644\n--- a/app/test-mldev/test_inference_common.c\n+++ b/app/test-mldev/test_inference_common.c\n@@ -56,7 +56,7 @@ ml_enqueue_single(void *arg)\n \t\tgoto retry;\n \n \top->model_id = t->model[fid].id;\n-\top->nb_batches = t->model[fid].info.batch_size;\n+\top->nb_batches = t->model[fid].nb_batches;\n \top->mempool = t->op_pool;\n \n \top->input.addr = req->input;\n@@ -168,7 +168,7 @@ ml_enqueue_burst(void *arg)\n \n \tfor (i = 0; i < ops_count; i++) {\n \t\targs->enq_ops[i]->model_id = t->model[fid].id;\n-\t\targs->enq_ops[i]->nb_batches = t->model[fid].info.batch_size;\n+\t\targs->enq_ops[i]->nb_batches = t->model[fid].nb_batches;\n \t\targs->enq_ops[i]->mempool = t->op_pool;\n \n \t\targs->enq_ops[i]->input.addr = args->reqs[i]->input;\n@@ -363,6 +363,11 @@ test_inference_opt_dump(struct ml_options *opt)\n \tml_dump(\"queue_pairs\", \"%u\", opt->queue_pairs);\n \tml_dump(\"queue_size\", \"%u\", opt->queue_size);\n \n+\tif (opt->batches == 0)\n+\t\tml_dump(\"batches\", \"%u (default)\", opt->batches);\n+\telse\n+\t\tml_dump(\"batches\", \"%u\", opt->batches);\n+\n \tml_dump_begin(\"filelist\");\n \tfor (i = 0; i < opt->nb_filelist; i++) {\n \t\tml_dump_list(\"model\", i, opt->filelist[i].model);\n@@ -531,8 +536,8 @@ ml_request_initialize(struct rte_mempool *mp, void *opaque, void *obj, unsigned\n \treq->niters = 0;\n \n \t/* quantize data */\n-\trte_ml_io_quantize(t->cmn.opt->dev_id, t->model[t->fid].id,\n-\t\t\t t->model[t->fid].info.batch_size, t->model[t->fid].input, req->input);\n+\trte_ml_io_quantize(t->cmn.opt->dev_id, t->model[t->fid].id, t->model[t->fid].nb_batches,\n+\t\t\t t->model[t->fid].input, req->input);\n }\n \n int\n@@ -550,7 +555,7 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, int16_t f\n \tint ret;\n \n \t/* get input buffer size */\n-\tret = rte_ml_io_input_size_get(opt->dev_id, t->model[fid].id, t->model[fid].info.batch_size,\n+\tret = rte_ml_io_input_size_get(opt->dev_id, t->model[fid].id, t->model[fid].nb_batches,\n \t\t\t\t &t->model[fid].inp_qsize, &t->model[fid].inp_dsize);\n \tif (ret != 0) {\n \t\tml_err(\"Failed to get input size, model : %s\\n\", opt->filelist[fid].model);\n@@ -558,9 +563,8 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, int16_t f\n \t}\n \n \t/* get output buffer size */\n-\tret = rte_ml_io_output_size_get(opt->dev_id, t->model[fid].id,\n-\t\t\t\t\tt->model[fid].info.batch_size, &t->model[fid].out_qsize,\n-\t\t\t\t\t&t->model[fid].out_dsize);\n+\tret = rte_ml_io_output_size_get(opt->dev_id, t->model[fid].id, t->model[fid].nb_batches,\n+\t\t\t\t\t&t->model[fid].out_qsize, &t->model[fid].out_dsize);\n \tif (ret != 0) {\n \t\tml_err(\"Failed to get input size, model : %s\\n\", opt->filelist[fid].model);\n \t\treturn ret;\n@@ -705,7 +709,7 @@ ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int\n \t\treturn;\n \n \tt->nb_used++;\n-\trte_ml_io_dequantize(t->cmn.opt->dev_id, model->id, t->model[req->fid].info.batch_size,\n+\trte_ml_io_dequantize(t->cmn.opt->dev_id, model->id, t->model[req->fid].nb_batches,\n \t\t\t req->output, model->output);\n }\n \ndiff --git a/app/test-mldev/test_model_common.c b/app/test-mldev/test_model_common.c\nindex 5368be17fe..51260c0789 100644\n--- a/app/test-mldev/test_model_common.c\n+++ b/app/test-mldev/test_model_common.c\n@@ -75,6 +75,12 @@ ml_model_load(struct ml_test *test, struct ml_options *opt, struct ml_model *mod\n \t\treturn ret;\n \t}\n \n+\t/* Update number of batches */\n+\tif (opt->batches == 0)\n+\t\tmodel->nb_batches = model->info.batch_size;\n+\telse\n+\t\tmodel->nb_batches = opt->batches;\n+\n \tmodel->state = MODEL_LOADED;\n \n \treturn 0;\ndiff --git a/app/test-mldev/test_model_common.h b/app/test-mldev/test_model_common.h\nindex c45ae80853..dfbf568f0b 100644\n--- a/app/test-mldev/test_model_common.h\n+++ b/app/test-mldev/test_model_common.h\n@@ -33,6 +33,7 @@ struct ml_model {\n \tuint8_t *output;\n \n \tstruct rte_mempool *io_pool;\n+\tuint32_t nb_batches;\n };\n \n int ml_model_load(struct ml_test *test, struct ml_options *opt, struct ml_model *model,\n", "prefixes": [ "v2", "09/12" ] }{ "id": 120252, "url": "