patch 'ml/cnxk: fix handling of TVM model I/O' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:27:19 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e8a44520dc4a80da0f3d64f4fb9900820c783893
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From e8a44520dc4a80da0f3d64f4fb9900820c783893 Mon Sep 17 00:00:00 2001
From: Srikanth Yalavarthi <syalavarthi at marvell.com>
Date: Tue, 30 Jul 2024 22:41:03 -0700
Subject: [PATCH] ml/cnxk: fix handling of TVM model I/O
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit c4636d36bc2cc3a370200245da69006d6f5d9852 ]
Fixed incorrect handling of TVM models with single MRVL
layer. Set the I/O layout to packed and fixed calculation
of quantized and dequantized data buffer addresses.
Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
Fixes: df2358f3adce ("ml/cnxk: add structures for TVM model type")
Signed-off-by: Srikanth Yalavarthi <syalavarthi at marvell.com>
---
drivers/ml/cnxk/cnxk_ml_ops.c | 12 ++++++++----
drivers/ml/cnxk/mvtvm_ml_model.c | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index 7bd73727e1..8863633155 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1462,7 +1462,8 @@ cnxk_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_buf
d_offset = 0;
q_offset = 0;
for (i = 0; i < info->nb_inputs; i++) {
- if (model->type == ML_CNXK_MODEL_TYPE_TVM) {
+ if (model->type == ML_CNXK_MODEL_TYPE_TVM &&
+ model->subtype != ML_CNXK_MODEL_SUBTYPE_TVM_MRVL) {
lcl_dbuffer = dbuffer[i]->addr;
lcl_qbuffer = qbuffer[i]->addr;
} else {
@@ -1474,7 +1475,8 @@ cnxk_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_buf
if (ret < 0)
return ret;
- if (model->type == ML_CNXK_MODEL_TYPE_GLOW) {
+ if ((model->type == ML_CNXK_MODEL_TYPE_GLOW) ||
+ (model->subtype == ML_CNXK_MODEL_SUBTYPE_TVM_MRVL)) {
d_offset += info->input[i].sz_d;
q_offset += info->input[i].sz_q;
}
@@ -1516,7 +1518,8 @@ cnxk_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_b
q_offset = 0;
d_offset = 0;
for (i = 0; i < info->nb_outputs; i++) {
- if (model->type == ML_CNXK_MODEL_TYPE_TVM) {
+ if (model->type == ML_CNXK_MODEL_TYPE_TVM &&
+ model->subtype != ML_CNXK_MODEL_SUBTYPE_TVM_MRVL) {
lcl_qbuffer = qbuffer[i]->addr;
lcl_dbuffer = dbuffer[i]->addr;
} else {
@@ -1528,7 +1531,8 @@ cnxk_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_b
if (ret < 0)
return ret;
- if (model->type == ML_CNXK_MODEL_TYPE_GLOW) {
+ if ((model->type == ML_CNXK_MODEL_TYPE_GLOW) ||
+ (model->subtype == ML_CNXK_MODEL_SUBTYPE_TVM_MRVL)) {
q_offset += info->output[i].sz_q;
d_offset += info->output[i].sz_d;
}
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index 0dbe08e988..bbda907714 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -352,7 +352,7 @@ tvm_mrvl_model:
metadata = &model->mvtvm.metadata;
strlcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
- info->io_layout = RTE_ML_IO_LAYOUT_SPLIT;
+ info->io_layout = RTE_ML_IO_LAYOUT_PACKED;
}
void
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:06.803313506 +0800
+++ 0033-ml-cnxk-fix-handling-of-TVM-model-I-O.patch 2024-11-11 14:23:05.082192840 +0800
@@ -1 +1 @@
-From c4636d36bc2cc3a370200245da69006d6f5d9852 Mon Sep 17 00:00:00 2001
+From e8a44520dc4a80da0f3d64f4fb9900820c783893 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c4636d36bc2cc3a370200245da69006d6f5d9852 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -65 +67 @@
-index 3ada6f42db..3c5ab0d2e1 100644
+index 0dbe08e988..bbda907714 100644
@@ -68 +70 @@
-@@ -356,7 +356,7 @@ tvm_mrvl_model:
+@@ -352,7 +352,7 @@ tvm_mrvl_model:
More information about the stable
mailing list