From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 02B4D45CE3 for ; Mon, 11 Nov 2024 07:32:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7D3740685; Mon, 11 Nov 2024 07:32:49 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2062.outbound.protection.outlook.com [40.107.96.62]) by mails.dpdk.org (Postfix) with ESMTP id 15C9940685 for ; Mon, 11 Nov 2024 07:32:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O/gRFx5sGbNUfH8vwH4Lh5uXctlD7lPl+uA75kXcgmc31syijKojBmLiqVYiYTOorZW/VaE3rcKu9HRETmiMJFXFTc93oH4Y6k0qp2wGbn4Oz5hjwxZkebj3VLrh9lIpozfJk/vAv18uRY25Iy0G4TFg+bG8PWB5NlByYglxZFUK754EZe4SKln89UB+a9AtLcMVZbzWCvHzbG56n5ihGmvJ/hhNCRUZT5lFluStltdh5xLby9Vlx70HVWD2XKpC4wIjYDR/uH5W8X/69goOSfZV1peMPJbWDrXglEK5YiElEnE+AaNOIGvzNgVn3TRWTBAaCbhCP1eQb5hwNF+sCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GwOCf9uqlPxeTtX93jlK/oMy9Ss66HVnxu9zmNzr/+Q=; b=dWRXoIV73eL3eVKgdrtviAsO5cuKxaZ9beyYa6un9g7gmvt4AFcmM4EB6F6p+Of7Bns5ZQaq97R6w9gQejrApZiL8uNfyc2GwrBCq9WOZeX72IpbLRFc/guVvuqhDhHzemph3+/9Kb8t19E/SHfsVEc41tapVoDMrL7ObKa3WQH25vsfwl2kdLLJY4nQQeXsMNKzdIOBycmNqlUtlYzOMtwbbeLOt6TJfaipZ3y0xIj5HOTTcBFJNkZ7ASB/sBjaSbJ2+uM5szi8VdMzlXXSBydkCgz6G7DHP6ForMW/zDsOzlLU/118tZf3IDVbhgKWGDa7J35/FV63JldaGgBxkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GwOCf9uqlPxeTtX93jlK/oMy9Ss66HVnxu9zmNzr/+Q=; b=g8kGIzMAppJRyY+bG8Z74XgodprZmsP4U5T9JhsazwC9yLAiksFv03f3PxaPdgnCL98wcg/1L7AreiGmW3/YcbtWfZOVjyNnPcnzk8wPk+CxnKShR5kD1rVrcGSEbaeHgSfBsh9QWr8CCTfWoaXSzK6zy4fHjZnQ8mh2vjJlOH6NEQKhVa+XNLXVWuf9Er+/1Fu7b7TzWtXfEif66oP+V3R51jlS47mmfjTjj3FJFwRwQ/kt8K01tiXRUEvJU0uikaR7W1R5LRRGap8yuFi4uFpYkl4Vo9f915CUP4ubqSOMS0v1ecLB1Wn+pCS0+2UsRzjxyHjiRI/6S/eg3RMpWg== Received: from BN9PR03CA0303.namprd03.prod.outlook.com (2603:10b6:408:112::8) by BY5PR12MB4274.namprd12.prod.outlook.com (2603:10b6:a03:206::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:32:41 +0000 Received: from BL02EPF00021F6E.namprd02.prod.outlook.com (2603:10b6:408:112:cafe::b0) by BN9PR03CA0303.outlook.office365.com (2603:10b6:408:112::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27 via Frontend Transport; Mon, 11 Nov 2024 06:32:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F6E.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:32:40 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:32:28 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:32:26 -0800 From: Xueming Li To: Srikanth Yalavarthi CC: , dpdk stable Subject: patch 'ml/cnxk: fix handling of TVM model I/O' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:19 +0800 Message-ID: <20241111062847.216344-34-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6E:EE_|BY5PR12MB4274:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fa90078-64d7-457a-19a3-08dd021aa4a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?DM1eaXPaXGH7PzWN7f+hfoWlk5K1VRzqAjuMJkMFhcDun0T8ylw8o5W7QHQJ?= =?us-ascii?Q?+e+5qV4MzGr8/l1j52FiAN0Ur6RSYxIQFczHvvyG0wv9I/DpZjWiSQuphp4L?= =?us-ascii?Q?FSoAKjtS5hmV8Zjw6eowxP7gyWN6cSyEGSE/NiQyqc15QCc58WqieyKbwTXE?= =?us-ascii?Q?wTwqwYW2H4cqNfIVVuNo4qgkaemarNlugglXN4nV7E+1dXh0fGio8GMyYNXK?= =?us-ascii?Q?xG+zAQ3KJvfZRBTnKVF3z3yvrdF13HRtPBdQ1oUjPDZ8Tdz5lFOWoyUXZM0E?= =?us-ascii?Q?i1SCzCKlekAJwFnffgM+P3zz9QjRd0qqvb8BZw9mGqNHuIc9HAl7dGB3XLIx?= =?us-ascii?Q?TCclX+rQhkFsyY0Fmx+/IzedkadiusO3F8WSJ/NkP+FepUUUPGafuA7mjica?= =?us-ascii?Q?YnYs4rk7R2ix2+3EXiQpusTwvkczTAIOMpCQ6zVyG4khWgzV9elPYorfLQNi?= =?us-ascii?Q?RWX5URiiPTPVf+iZlmHDFwnfC5k2LzVIDMQDPfPAhgxBtbhz5nwY5p/9i59G?= =?us-ascii?Q?g10loqkzA59Jtkf5F1i3ciBxBbv/dM9nt2maNUaPPZBohk3NQ3C/XohaFMTM?= =?us-ascii?Q?T7uE1UOd6IXQJXqZZ+006fute+++xdmSOU2aVHvnfkCC70XBQSrcLvGhSeNZ?= =?us-ascii?Q?fgxVRdG28OS1gHiYHtAWAUVoIwrCcvfAbxZnheYctA56VJKGBg6l5dJDJl6V?= =?us-ascii?Q?A69N3JNpJQ8PlddDCqs1sbOHyBuAN5bWBSiG5Q3hPRtNH8ocqEGETb+5AMKa?= =?us-ascii?Q?owi60YO16sCc0HnkrSwWE6YbcSukgZMvjqQvZYMHSg3lJIKh8oMZOjrqe720?= =?us-ascii?Q?HmX2yVP7JqSwnkv3paoivWwtRQI2M0CE+jRwQMvZYbCPsU54WkDP8XCh32Ur?= =?us-ascii?Q?SsHXR8AxpQOO3SEX1ipSTQvLK+CVlGVzTNQreZpPmwWiuwpDMICRWWGtSp9C?= =?us-ascii?Q?nj2oY6kbu6Lero+rNbVSt3s1SIq6GzCb64pXY6WmsOI1r2EAh72brxflUWss?= =?us-ascii?Q?6bsXhJC20X0ZRmmFzh7VHQkOHcNdI45/rv9Kj0+8aknC9Vobd0FySQ/QqQ2i?= =?us-ascii?Q?pxz11UKWwaEplvFYySO5JMuSsZJMD+QBaUjyA5yxv0tKkKizVx5UNM6mzHWT?= =?us-ascii?Q?qpjKns+ODT0wErBHmibww1dMa5dYkvIc2xLi2f+laN9gvlQOuz9TZGT6P4Dm?= =?us-ascii?Q?8GDym6Cnr7NWkb8SoKZ+MyL/uz+Wp8qZcZA/seqB4EpIyA8V1E5yAzsucG4m?= =?us-ascii?Q?FSpZ1UX/iKnX+zNPksu2hxCwlwJ/NKvPW2/xi7YORZhqXl743OhrZBxsfgJc?= =?us-ascii?Q?XCy5xJpEHlUGdF96jks9NrmN/OvnbPkvlMIWOebdo/vkCmn9Uagkq5P4Uyqq?= =?us-ascii?Q?Y+fXYnq2nLsp+7+bYZ8yAQeurijQJq8oW62EA22bZtPmtSsl1w=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:32:40.9357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa90078-64d7-457a-19a3-08dd021aa4a6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4274 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- >From e8a44520dc4a80da0f3d64f4fb9900820c783893 Mon Sep 17 00:00:00 2001 From: Srikanth Yalavarthi Date: Tue, 30 Jul 2024 22:41:03 -0700 Subject: [PATCH] ml/cnxk: fix handling of TVM model I/O Cc: Xueming Li [ 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 --- 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 + +[ upstream commit c4636d36bc2cc3a370200245da69006d6f5d9852 ] @@ -12 +14,0 @@ -Cc: stable@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: