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 44B4243857; Sun, 7 Jan 2024 16:28:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44F91402F2; Sun, 7 Jan 2024 16:28:25 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0834540263 for ; Sun, 7 Jan 2024 16:28:23 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 407Eu6FX026032 for ; Sun, 7 Jan 2024 07:28:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=LDF2mYxDWtGmb32hjuxaH/5IWDyinavc2kVKiHOro/M=; b=J/5 id1yCczaDNPyDuLX4ctPgWrhz9iCS1M2bh8vMtbRw4HwFpVSclVJiD2dN3WJut5A /QMCqDeQxEKnLAtVFzb/UOdEhXz1TEQ++28pFOnhX0eDCMFb/3/rVaw8eYBbxnMg k1r/97pxt0y4pBk4nTaK2FdsTZePwvYRXAfgaxA/6LISDYEcuIXs+SeaRdp/vCd0 e8AXbM+xf0v1f4ks920X/mUp/tuWu2htcbMkEFaLTVLpGpLKfdEmRtnT0SZ3x3/m gY/MmTlHhcbaCbjGmKxeEZax6RsVKCMbyU6P/A4ES9U+u8lqVXMf9Cuw5up5qBMT U17pXN2obinoiWBOi+Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3vf78n29ns-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 07 Jan 2024 07:28:23 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 7 Jan 2024 07:28:20 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sun, 7 Jan 2024 07:28:20 -0800 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id A3D1A3F70A1; Sun, 7 Jan 2024 07:28:20 -0800 (PST) From: Srikanth Yalavarthi To: Srikanth Yalavarthi CC: , , , Subject: [PATCH 3/3] ml/cnxk: add support for additional integer types Date: Sun, 7 Jan 2024 07:28:12 -0800 Message-ID: <20240107152813.2668-4-syalavarthi@marvell.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240107152813.2668-1-syalavarthi@marvell.com> References: <20240107152813.2668-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: qgIbeJMzvA-wm8ta814XaySNDr5U_MGl X-Proofpoint-GUID: qgIbeJMzvA-wm8ta814XaySNDr5U_MGl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added support quantization and dequantization of 32-bit and 64-bit integer types. Signed-off-by: Srikanth Yalavarthi --- drivers/ml/cnxk/cnxk_ml_io.c | 24 ++++++++++++++++++++++++ drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/drivers/ml/cnxk/cnxk_ml_io.c b/drivers/ml/cnxk/cnxk_ml_io.c index c78009ab0cd..4b0adc2ae47 100644 --- a/drivers/ml/cnxk/cnxk_ml_io.c +++ b/drivers/ml/cnxk/cnxk_ml_io.c @@ -40,6 +40,18 @@ cnxk_ml_io_quantize_single(struct cnxk_ml_io *input, uint8_t *dbuffer, uint8_t * case RTE_ML_IO_TYPE_UINT16: ret = rte_ml_io_float32_to_uint16(qscale, nb_elements, dbuffer, qbuffer); break; + case RTE_ML_IO_TYPE_INT32: + ret = rte_ml_io_float32_to_int32(qscale, nb_elements, dbuffer, qbuffer); + break; + case RTE_ML_IO_TYPE_UINT32: + ret = rte_ml_io_float32_to_uint32(qscale, nb_elements, dbuffer, qbuffer); + break; + case RTE_ML_IO_TYPE_INT64: + ret = rte_ml_io_float32_to_int64(qscale, nb_elements, dbuffer, qbuffer); + break; + case RTE_ML_IO_TYPE_UINT64: + ret = rte_ml_io_float32_to_uint64(qscale, nb_elements, dbuffer, qbuffer); + break; case RTE_ML_IO_TYPE_FP16: ret = rte_ml_io_float32_to_float16(nb_elements, dbuffer, qbuffer); break; @@ -82,6 +94,18 @@ cnxk_ml_io_dequantize_single(struct cnxk_ml_io *output, uint8_t *qbuffer, uint8_ case RTE_ML_IO_TYPE_UINT16: ret = rte_ml_io_uint16_to_float32(dscale, nb_elements, qbuffer, dbuffer); break; + case RTE_ML_IO_TYPE_INT32: + ret = rte_ml_io_int32_to_float32(dscale, nb_elements, qbuffer, dbuffer); + break; + case RTE_ML_IO_TYPE_UINT32: + ret = rte_ml_io_uint32_to_float32(dscale, nb_elements, qbuffer, dbuffer); + break; + case RTE_ML_IO_TYPE_INT64: + ret = rte_ml_io_int64_to_float32(dscale, nb_elements, qbuffer, dbuffer); + break; + case RTE_ML_IO_TYPE_UINT64: + ret = rte_ml_io_uint64_to_float32(dscale, nb_elements, qbuffer, dbuffer); + break; case RTE_ML_IO_TYPE_FP16: ret = rte_ml_io_float16_to_float32(nb_elements, qbuffer, dbuffer); break; diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c index 0dbe08e9889..e3234ae4422 100644 --- a/drivers/ml/cnxk/mvtvm_ml_model.c +++ b/drivers/ml/cnxk/mvtvm_ml_model.c @@ -150,6 +150,8 @@ mvtvm_ml_io_type_map(DLDataType dltype) return RTE_ML_IO_TYPE_INT16; else if (dltype.bits == 32) return RTE_ML_IO_TYPE_INT32; + else if (dltype.bits == 64) + return RTE_ML_IO_TYPE_INT64; break; case kDLUInt: if (dltype.bits == 8) @@ -158,6 +160,8 @@ mvtvm_ml_io_type_map(DLDataType dltype) return RTE_ML_IO_TYPE_UINT16; else if (dltype.bits == 32) return RTE_ML_IO_TYPE_UINT32; + else if (dltype.bits == 64) + return RTE_ML_IO_TYPE_UINT64; break; case kDLFloat: if (dltype.bits == 8) -- 2.42.0