|WARNING| pw125066 [PATCH v2 1/1] mldev: split bfloat16 routines to separate files

qemudev at loongson.cn qemudev at loongson.cn
Mon Mar 13 12:50:20 CET 2023


Test-Label: loongarch-compilation
Test-Status: WARNING
http://dpdk.org/patch/125066

_apply patch failure_

Submitter: Srikanth Yalavarthi <syalavarthi at marvell.com>
Date: Mon, 13 Mar 2023 05:03:06 -0700
DPDK git baseline: Repo:dpdk
  Branch: main
  CommitID: baf13c3135d0c5998fff7edc23fb89412dc89246

Apply patch set 125066 failed:

Checking patch lib/mldev/meson.build...
error: while searching for:
        'mldev_utils.c',
)

if dpdk_conf.has('RTE_ARCH_ARM64')
    sources += files('mldev_utils_neon.c')
else
    sources += files('mldev_utils_scalar.c')
endif

headers = files(
        'rte_mldev.h',
)

error: patch failed: lib/mldev/meson.build:7
error: lib/mldev/meson.build: patch does not apply
Checking patch lib/mldev/mldev_utils_neon.c...
Checking patch lib/mldev/mldev_utils_neon_bfloat16.c...
Checking patch lib/mldev/mldev_utils_scalar.c...
error: while searching for:
 * Copyright (c) 2022 Marvell.
 */

#include <errno.h>
#include <math.h>
#include <stdint.h>

#include "mldev_utils.h"

/* Description:
 * This file implements scalar versions of Machine Learning utility functions used to convert data
 * types from higher precision to lower precision and vice-versa.
 */

#ifndef BIT
#define BIT(nr) (1UL << (nr))
#endif

#ifndef BITS_PER_LONG
#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
#endif

#ifndef GENMASK_U32
#define GENMASK_U32(h, l) (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
#endif

/* float32: bit index of MSB & LSB of sign, exponent and mantissa */
#define FP32_LSB_M 0
#define FP32_MSB_M 22
#define FP32_LSB_E 23
#define FP32_MSB_E 30
#define FP32_LSB_S 31
#define FP32_MSB_S 31

/* float32: bitmask for sign, exponent and mantissa */
#define FP32_MASK_S GENMASK_U32(FP32_MSB_S, FP32_LSB_S)
#define FP32_MASK_E GENMASK_U32(FP32_MSB_E, FP32_LSB_E)
#define FP32_MASK_M GENMASK_U32(FP32_MSB_M, FP32_LSB_M)

/* float16: bit index of MSB & LSB of sign, exponent and mantissa */
#define FP16_LSB_M 0
#define FP16_MSB_M 9
#define FP16_LSB_E 10
#define FP16_MSB_E 14
#define FP16_LSB_S 15
#define FP16_MSB_S 15

/* float16: bitmask for sign, exponent and mantissa */
#define FP16_MASK_S GENMASK_U32(FP16_MSB_S, FP16_LSB_S)
#define FP16_MASK_E GENMASK_U32(FP16_MSB_E, FP16_LSB_E)
#define FP16_MASK_M GENMASK_U32(FP16_MSB_M, FP16_LSB_M)

/* bfloat16: bit index of MSB & LSB of sign, exponent and mantissa */
#define BF16_LSB_M 0
#define BF16_MSB_M 6
#define BF16_LSB_E 7
#define BF16_MSB_E 14
#define BF16_LSB_S 15
#define BF16_MSB_S 15

/* bfloat16: bitmask for sign, exponent and mantissa */
#define BF16_MASK_S GENMASK_U32(BF16_MSB_S, BF16_LSB_S)
#define BF16_MASK_E GENMASK_U32(BF16_MSB_E, BF16_LSB_E)
#define BF16_MASK_M GENMASK_U32(BF16_MSB_M, BF16_LSB_M)

/* Exponent bias */
#define FP32_BIAS_E 127
#define FP16_BIAS_E 15
#define BF16_BIAS_E 127

#define FP32_PACK(sign, exponent, mantissa)                                                        \
	(((sign) << FP32_LSB_S) | ((exponent) << FP32_LSB_E) | (mantissa))

#define FP16_PACK(sign, exponent, mantissa)                                                        \
	(((sign) << FP16_LSB_S) | ((exponent) << FP16_LSB_E) | (mantissa))

#define BF16_PACK(sign, exponent, mantissa)                                                        \
	(((sign) << BF16_LSB_S) | ((exponent) << BF16_LSB_E) | (mantissa))

/* Represent float32 as float and uint32_t */
union float32 {
	float f;
	uint32_t u;
};

int
rte_ml_io_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
{

error: patch failed: lib/mldev/mldev_utils_scalar.c:2
error: lib/mldev/mldev_utils_scalar.c: patch does not apply
Checking patch lib/mldev/mldev_utils_scalar.h...
Checking patch lib/mldev/mldev_utils_scalar_bfloat16.c...



More information about the test-report mailing list