Data processing method and device

By flexibly adjusting the number of bits in the exponent and mantissa of floating-point numbers, the problem of insufficient bandwidth utilization in existing technologies is solved, achieving more efficient quantization accuracy and bandwidth utilization.

CN121864880APending Publication Date: 2026-04-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing floating-point quantization schemes, the number of bits for the exponent and mantissa is fixed, which cannot be flexibly adapted to specific scenarios, resulting in insufficient bandwidth utilization.

Method used

By obtaining the available bandwidth and data distribution, the number of bits in the exponent and mantissa of the floating-point number can be flexibly adjusted to match the available bandwidth, and the quantization precision can be determined in combination with the data distribution.

Benefits of technology

It achieves an effective match between floating-point numbers and available bandwidth, improving quantization accuracy and bandwidth utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121864880A_ABST
    Figure CN121864880A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, and relates to the field of communication. In the method, an available bandwidth is obtained, the available bandwidth is used for determining a first numerical value and a second numerical value, and the first numerical value and the second numerical value are the bit number of an exponent bit and the bit number of a mantissa bit of a floating-point number respectively; acquiring first quantized data respectively corresponding to at least one piece of first data, wherein the bit number of exponential bits and the bit number of mantissa bits of the first quantized data are respectively a first numerical value and a second numerical value; according to the method, the bit number of the exponent bit and the bit number of the mantissa bit of floating point quantization can be flexibly adjusted, so that the available bandwidth can be effectively utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more specifically, to a data processing method and apparatus. Background Technology

[0002] Data compression aims to reduce data storage space and improve data transmission efficiency. Data compression is mainly divided into two categories based on the degree of information distortion after compression: lossless compression and lossy compression. Among lossy compression techniques, an important method is quantization compression. This technique maps data to a finite set of quantized values, thereby reducing the space occupied by the data. Currently, quantization schemes can be broadly divided into two categories: integer quantization and floating-point quantization. Floating-point quantization is used to quantize data into floating-point numbers. A floating-point number typically consists of three parts: a sign bit, an exponent bit, and a mantissa bit. The sign bit indicates whether the data is positive or negative; the number of bits in the exponent bit determines the range of values ​​that the floating-point number can represent; and the number of bits in the mantissa bit determines the value that the floating-point number can represent. Current floating-point quantization schemes, considering storage and computational needs, have relatively limited methods for determining the number of bits in the exponent and mantissa bits of a floating-point number, making them inflexible and unable to adapt to specific scenarios. Summary of the Invention

[0003] This application provides a data processing method and apparatus that can flexibly adjust the number of bits in the exponent and mantissa of a floating-point number, so that the available bandwidth can be effectively utilized, that is, the floating-point number can be adapted to the available bandwidth.

[0004] Firstly, a data processing method is provided, which can be applied to a first device. For example, the method can be executed by the first device, by a component of the first device (e.g., a processor, chip, or chip system), or by a logic module or software capable of implementing all or part of the functions of the first device. For example, the first device can be a terminal device or a base station.

[0005] The method includes: acquiring available bandwidth for determining a first value and a second value, the first value and the second value being the number of bits in the exponent and the number of bits in the mantissa of a floating-point number, respectively; acquiring at least one first quantized data corresponding to a first data, the number of bits in the exponent and the number of bits in the mantissa of the first quantized data being the first value and the second value, respectively.

[0006] According to the method provided in this application, at least one first data can be floating-point quantized. The number of bits of the exponent and the number of bits of the mantissa of the floating-point number used for floating-point quantization can be flexibly adjusted according to the available bandwidth, so that the available bandwidth can be effectively utilized, that is, the floating-point number can be adapted to the available bandwidth.

[0007] In one possible implementation, obtaining the available bandwidth for determining the first and second values ​​specifically includes: obtaining the available bandwidth and the distribution of the at least one first data, which are used to determine the first and second values.

[0008] This scheme can better guarantee quantization accuracy by further combining the distribution of at least one first data point to determine the first and second values.

[0009] In one possible implementation, the method further includes: outputting first quantized data and encoding information corresponding to the at least one first data, wherein the encoding information is used to indicate the first value and the second value.

[0010] This scheme can output the first quantization data and encoding information corresponding to the at least one first data to the second device, so that the second device can obtain the at least one first data according to the first quantization data and encoding information corresponding to the at least one first data.

[0011] In one possible implementation, obtaining the first quantized data corresponding to at least one first data specifically includes: obtaining at least one second data, which is obtained by preprocessing at least one first data corresponding to the at least one second data; and performing floating-point quantization on the at least one second data to obtain the first quantized data corresponding to the at least one first data.

[0012] Based on preprocessing, data can be matched with quantization points, making greater use of the resources of quantization points and thus further improving quantization accuracy.

[0013] In one possible implementation, the preprocessing is linear, or the preprocessing includes both linear and nonlinear processing.

[0014] Optionally, the encoding information may also indicate information related to preprocessing.

[0015] Optionally, the information related to preprocessing includes one or more of the following: the parameters of the linear function related to linear processing, the type of the nonlinear function related to nonlinear processing, the parameters of the nonlinear function, or the order between linear and nonlinear processing.

[0016] For example, the linear function may include a linear function for linear processing of positive numbers and a linear function for linear processing of negative numbers. By performing linear processing separately in the positive and negative number intervals, the quantization points can be better matched with the data.

[0017] For example, the nonlinear function may include a nonlinear function for nonlinear processing of positive numbers and a nonlinear function for nonlinear processing of negative numbers. By performing nonlinear processing separately in the positive and negative number intervals, the quantization points can be better matched with the data.

[0018] In one possible implementation, the at least one first data is one set of data from a plurality of sets of data to be transmitted.

[0019] Based on this scheme, for each set of data in multiple sets of data, the number of exponent bits and mantissa bits for floating-point quantization of the set of data can be determined using the scheme provided in this application, thereby obtaining a quantization scheme that is compatible with the set of data.

[0020] In one possible implementation, the encoded information also includes a group identifier corresponding to the at least one first data.

[0021] Based on the group identifier, the data to which the encoded information is directed can be determined, and the data is the at least one first data.

[0022] In one possible implementation, the multiple sets of data to be transmitted correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers, and the encoding information indicates N and the layer identifier of the i-th layer.

[0023] The structural units inherent in the data to be transmitted are referred to as "layers" in this embodiment. Within each layer, the data can be divided into at least one group based on its size. For each group of data, the number of exponent bits and mantissa bits for floating-point quantization can be determined using the scheme provided in this application, thereby obtaining a quantization scheme suitable for that group of data. Simultaneously, based on the encoding information, the layer to which the encoding information is applied and the number of groups N included in that layer can be determined.

[0024] In one possible implementation, the at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates the positive or negative status of the first quantized data; or the at least one first data includes only positive numbers or only negative numbers, and the first quantized data does not include a sign bit.

[0025] Based on this scheme, when the at least one first data includes only positive numbers or only negative numbers, bit overhead is saved by not carrying a sign bit in the first quantized data.

[0026] In one possible implementation, the at least one first data includes only positive numbers or only negative numbers, the first quantized data does not include a sign bit, and the encoded information includes a first bit field that indicates the positive or negative status of the at least one first data.

[0027] In one possible implementation, before acquiring the first quantized data corresponding to at least one first data, the method further includes: determining a third value based on available bandwidth, or based on available bandwidth and the distribution of the at least one first data, wherein the third value is the number of bits of a floating-point number; determining a first value based on first information, wherein the first value is less than the third value, wherein the first information includes one or more of the following: quantization performance of the verification data, preset information, and the distribution of the at least one first data; and determining a second value based on the third value and the first value.

[0028] Based on this scheme, the number of bits in the floating-point number can be determined first, and then the number of bits in the mantissa can be determined based on the number of bits in the exponent of the floating-point number. Since the number of bits in the floating-point number is determined according to the available bandwidth, the number of bits in the floating-point number can be adapted to the available bandwidth.

[0029] In one possible implementation, the second value, based on the third value and the first value, includes: determining whether to set a sign bit based on the at least one first data, the sign bit indicating the positive or negative status of the first quantized data; and determining the second value based on the third value, the first value, and whether to set a sign bit.

[0030] In one possible implementation, determining whether to set a sign bit based on the at least one first data includes: setting a sign bit if the at least one first data includes both positive and negative numbers; and not setting a sign bit if the at least one first data includes only positive numbers or only negative numbers.

[0031] Based on this scheme, in scenarios where at least one first data includes only positive numbers or only negative numbers, not setting a sign bit can save bit overhead.

[0032] In one possible implementation, a sign bit is set, and the third value is the sum of the first value, the number of bits of the sign bit, and the second value; if no sign bit is set, the number of bits of the floating-point number is the sum of the first value and the second value.

[0033] Secondly, a data processing method is provided that can be applied to a second device. For example, this method can be executed by the second device itself, by a component of the second device (such as a processor, chip, or chip system), or by a logic module or software capable of implementing all or part of the functions of the second device. For example, the second device can be a terminal device or a base station.

[0034] The method includes: acquiring encoding information, which indicates a first value and a second value, wherein the first value and the second value are the number of bits in the exponent and the number of bits in the mantissa of a floating-point number, respectively; acquiring at least one first quantized data, wherein the number of bits in the exponent and the number of bits in the mantissa of the first quantized data are the first value and the second value, respectively; and acquiring at least one first data corresponding to the at least one first quantized data based on the encoding information and the at least one first quantized data.

[0035] According to the method provided in this application, the second device can obtain the number of bits of the exponent and the number of bits of the mantissa of the floating-point number used by the first device to perform floating-point quantization on at least one first data. Based on the obtained information, the second device can obtain at least one first data corresponding to at least one first quantized data.

[0036] In one possible implementation, obtaining at least one first data corresponding to the at least one first quantization data based on the encoding information and at least one first quantization data includes: obtaining at least one second data based on the encoding information and the at least one first quantization data, wherein the at least one second data is obtained by preprocessing the at least one first data; and obtaining the at least one first data based on the at least one second data.

[0037] In this scheme, the real numbers represented by the at least one first quantized data can be obtained through the encoded information. The at least one second data is obtained by preprocessing the at least one first data. Therefore, the second device can obtain the at least one first data by performing the opposite operation to the preprocessing on the at least one second data.

[0038] In one possible implementation, the preprocessing is linear, or the preprocessing includes both linear and nonlinear processing.

[0039] In one possible implementation, the encoded information also indicates information related to the preprocessing.

[0040] In one possible implementation, the information related to the preprocessing includes one or more of the following: the parameters of the linear function related to the linear processing, the type of the nonlinear function related to the nonlinear processing, the parameters of the nonlinear function, or the order between the linear and nonlinear processing.

[0041] In one possible implementation, the at least one first data is one set of data from a plurality of sets of data to be transmitted.

[0042] In one possible implementation, the encoded information also includes at least one group identifier corresponding to the first data.

[0043] In one possible implementation, the multiple sets of data to be transmitted correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers, and the encoding information indicates N and the layer identifier of the i-th layer.

[0044] In one possible implementation, the at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates the positive or negative status of the first quantized data; or the at least one first data includes only positive numbers or only negative numbers, and the first quantized data does not include a sign bit.

[0045] In one possible implementation, the at least one first data includes only positive numbers or only negative numbers, the first quantized data does not include a sign bit, and the encoded information includes a first bit field that indicates the positive or negative status of the at least one first data.

[0046] The beneficial effects of the second aspect can be referred to the description of the first aspect, and will not be repeated in the second aspect.

[0047] Thirdly, an apparatus is provided. In one possible design, the apparatus has the function of implementing the first aspect described above. For example, the apparatus includes modules, units, or means corresponding to the operations involved in the first aspect. These modules, units, or means can be implemented by software, hardware, or a combination of software and hardware.

[0048] Fourthly, an apparatus is provided. In one possible design, the apparatus has the function of implementing the second aspect above. For example, the apparatus includes modules, units, or means corresponding to the operations involved in the second aspect above. These modules, units, or means can be implemented by software, by hardware, or by a combination of software and hardware.

[0049] Fifthly, this application provides an apparatus comprising an interface circuit and one or more processors. The one or more processors are coupled to a memory. The memory stores part or all of a computer program or instructions necessary for implementing the functions described in the first aspect above. The one or more processors are executable to carry out the computer program or instructions, causing the apparatus to implement the methods in any possible design or implementation of the first aspect above when executed. The interface circuit is used to implement communication functions within the apparatus and / or communication functions between the apparatus and other apparatuses or components.

[0050] In one possible design, the processor is used to communicate with other devices or components through the interface circuit.

[0051] In one possible design, the device may also include the memory.

[0052] Sixthly, this application provides an apparatus comprising an interface circuit and one or more processors. The one or more processors are coupled to a memory. The memory stores part or all of a computer program or instructions necessary for implementing the functions described in the second aspect above. The one or more processors are executable to carry out the computer program or instructions, causing the apparatus to implement the methods in any possible design or implementation of the second aspect above. The interface circuit is used to implement communication functions within the apparatus and / or communication functions between the apparatus and other apparatuses or components.

[0053] In one possible design, the processor is used to communicate with other devices or components through the interface circuit.

[0054] In one possible design, the device may also include the memory.

[0055] The apparatus in the fifth or sixth aspect mentioned above may be a terminal device, or a communication module in a terminal device, or a chip in a terminal device that is responsible for communication functions, such as a modem chip (also known as a baseband chip) or a system-on-chip (SoC) or system-in-package (SIP) chip containing a modem module.

[0056] The apparatus described in the fifth or sixth aspect above may be a network device, a communication module within a network device, or a chip within a network device responsible for communication functions, such as a modem chip (also known as a baseband chip) or a SoC or SIP chip containing a modem module. The network device may be a radio access network (RAN) device or a core network device.

[0057] In a seventh aspect, this application provides a communication system including a first device and a second device. The first device may be the device provided in the third or fifth aspect. The second device may be the device provided in the fourth or sixth aspect. The first device can perform the method provided in the first aspect, and the second device can perform the method provided in the second aspect.

[0058] Eighthly, this application provides a computer-readable storage medium storing computer-readable instructions that, when read and executed by a computer, cause the method in any of the above aspects or any possible implementations of the above aspects to be performed.

[0059] Ninthly, this application provides a computer program product that, when read and executed by a computer, causes the method in any of the above aspects or any possible implementation of the above aspects to be executed.

[0060] In a tenth aspect, an apparatus is provided, including a processor that, when executing a program or instructions, causes a method in any of the foregoing aspects or any possible implementations of the foregoing aspects to be performed.

[0061] Eleventhly, a chip is provided, including a processor for calling and running a computer program from memory, such that the method in any of the preceding aspects or any possible implementation of the aspect is executed. Attached Figure Description

[0062] Figure 1 This is a schematic block diagram of a communication system provided in an embodiment of this application;

[0063] Figure 2 This is a schematic diagram of a 2-bit quantization scheme in an integer quantization scheme on the data axis;

[0064] Figure 3 This is a schematic diagram of a floating-point number represented by a bit string;

[0065] Figure 4 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0066] Figure 5 This is an exemplary schematic diagram illustrating the matching of data and quantized points provided in the embodiments of this application;

[0067] Figure 6 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0068] Figure 7 These are schematic diagrams illustrating two formats of encoded information provided in embodiments of this application;

[0069] Figure 8 These are schematic diagrams illustrating two other formats of encoded information provided in the embodiments of this application;

[0070] Figures 9 to 11 This is a flowchart illustrating data processing according to the method provided in the embodiments of this application;

[0071] Figure 12 and Figure 13 A schematic diagram showing the corresponding quantization performance obtained from simulations based on different quantization schemes is presented;

[0072] Figure 14 This is a schematic block diagram of an apparatus provided in an embodiment of this application;

[0073] Figure 15 This is a schematic block diagram of another device provided in the embodiments of this application. Detailed Implementation

[0074] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0075] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Additionally, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or the order of execution, and that the words "first" and "second" do not necessarily imply that they are different.

[0076] In the various method embodiments of this application, the order of the sequence numbers does not imply the order of execution. The execution order should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0077] It is understood that in this application, descriptions such as "under the circumstances," "if," "when," and "if..." can be used interchangeably. Furthermore, these descriptions all refer to the corresponding actions that will be taken under certain objective circumstances, and are not time-limited, nor do they require any judgment action during implementation, nor do they imply any other limitations.

[0078] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Correspondingly, the apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.

[0079] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. In the various embodiments of this application, and in the various implementation methods / methods / implementations within each embodiment, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments and between the various implementation methods / methods / implementations within each embodiment are consistent and can be mutually referenced. The technical features in different embodiments and the various implementation methods / methods / implementations within each embodiment can be combined according to their inherent logical relationships to form new embodiments, implementation methods, methods, or implementation approaches. The embodiments described below do not constitute a limitation on the scope of protection of this application.

[0080] The technical solutions provided in this application can be applied to various communication systems, such as: 5th generation (5G) or new radio (NR) systems, long term evolution (LTE) systems, LTE frequency division duplex (FDD) systems, LTE time division duplex (TDD) systems, short-range wireless communication systems (such as wireless fidelity (Wi-Fi)), and other mobile communication systems that may emerge in the future.

[0081] Figure 1 A schematic block diagram of a communication system applicable to this application is shown. Figure 1 As shown, the communication system may include a first device 110 and a second device 120, and signals / data can be transmitted between the first device 110 and the second device 120. It should be understood that the communication system may also include more devices.

[0082] The first device 110 and the second device 120 can be terminal equipment, radio access network (RAN) equipment, or core network equipment. For example, both the first device 110 and the second device 120 can be terminal equipment; or the first device 110 can be a terminal equipment and the second device 120 can be a RAN equipment.

[0083] In this application's embodiments, the terminal device refers to a device that provides voice and / or data connectivity to the user. The terminal device can also be called user equipment (UE), mobile station (MS), mobile terminal (MT), terminal, etc. Terminal devices can be widely used in various scenarios, such as device-to-device (D2D), vehicle-to-everything (V2X) communication, machine-type communication (MTC), Internet of Things (IoT), virtual reality, augmented reality, industrial control, autonomous driving, telemedicine, smart grids, smart furniture, smart offices, smart wearables, smart transportation, smart cities, etc. For example, a terminal device can be a mobile phone, tablet computer, computer with wireless transceiver capabilities, wearable device, vehicle, drone, helicopter, airplane, ship, robot, robotic arm, smart home device, transportation vehicle with wireless communication capabilities, communication module, etc. The embodiments of this application do not limit the device form of the terminal device. Terminal devices typically contain communication modules, circuits, or chips that perform corresponding communication functions. The terminal device is also configured with program instructions for performing corresponding communication functions.

[0084] The RAN device in this application embodiment is a device deployed in a radio access network to provide wireless communication functions for terminal devices. The RAN device can be, for example, a base station, an evolved NodeB (eNodeB), an access point (AP), a transmission reception point (TRP), a transmission point (TP), a next-generation NodeB (gNB), a base station in a future mobile communication system, or an access node in a WiFi system. The RAN device can also be, for example, a macro base station, a micro base station, an indoor station, a relay node, a donor node, or a wireless controller in a cloud radio access network (CRAN) scenario. Optionally, the RAN device can also be a server, a wearable device, a vehicle, or an in-vehicle device. For example, the RAN device in vehicle-to-everything (V2X) technology can be a roadside unit (RSU). All or part of the functions of the RAN device in this application can also be implemented through software functions running on hardware, or through virtualization functions instantiated on a platform (e.g., a cloud platform). The RAN device may also include communication modules, circuits, or chips that perform corresponding communication functions. The RAN device may also be configured with program instructions for performing these communication functions, as well as corresponding program instructions. The RAN device in this application may also be a logic node, logic module, or software capable of implementing all or part of the RAN device functions.

[0085] In one possible scenario, RAN equipment can be a central unit (CU), a distributed unit (DU), a CU-control plane (CP), a CU-user plane (UP), or a radio unit (RU), etc. CUs and DUs can be separate entities or included in the same network element, such as a baseband unit (BBU). RUs can be included in radio equipment or radio units, such as remote radio units (RRUs), active antenna units (AAUs), or remote radio heads (RRHs). In different systems, CUs (or CU-CPs and CU-UPs), DUs, or RUs may have different names, but their meanings will be understood by those skilled in the art. For example, in an open radio access network (ORAN) system, a CU can also be called an O-CU (open CU), a DU can also be called an O-DU, a CU-CP can also be called an O-CU-CP, a CU-UP can also be called an O-CU-UP, and an RU can also be called an O-RU. Any of the CU (or CU-CP, CU-UP), DU, and RU units in this application can be implemented through software modules, hardware modules, or a combination of software and hardware modules. It should be understood that this application does not limit the specific technology or specific device form used in the RAN equipment.

[0086] The core network equipment in this application embodiment may be an authentication server function (AUSF), network exposure function (NEF), policy control function (PCF), unified data management (UDM), unified data repository (UDR), network repository function (NRF), application function (AF), access and mobility management function (AMF), session management function (SMF), or user plane function (UPF) network element, etc. This application embodiment does not limit the specific technology or equipment form used in the core network equipment.

[0087] To facilitate understanding of the embodiments of this application, the concepts involved in the embodiments of this application will be introduced first.

[0088] Data compression technology is an indispensable part of the information society, aiming to reduce data storage space, improve data transmission efficiency, and play a vital role in protecting information security. Data compression is mainly divided into two categories based on the degree of information distortion after compression: lossless compression and lossy compression. Lossless compression technology can completely recover the original data after decompression and is suitable for fields with extremely high data fidelity requirements, such as medical imaging, security systems, and remote sensing data. Common lossless compression algorithms include Huffman coding, arithmetic coding, run-length encoding, and dictionary encoding. Lossy compression technology, on the other hand, loses some of the original information during compression and is suitable for scenarios with relatively lower data fidelity requirements, such as digital images and videos. This compression scheme can effectively reduce file size, but a balance needs to be struck between compression ratio and data quality.

[0089] In lossy compression techniques, an important method is quantization compression, which maps data to a finite quantization value, thereby reducing the size of the data.

[0090] Quantization techniques were initially applied to the digitization of analog signals, such as pulse code modulation. With the development of computer technology, quantization began to be used for image and video compression. In recent years, with the rise of deep learning and artificial intelligence, quantization techniques have achieved new developments. It is used for the compression of neural network models to reduce storage and computational requirements. Specific methods include quantization-aware training (QAT), quantization-aware fine-tuning (QAF), and post-training quantization (PTQ).

[0091] Currently, the quantization schemes commonly used in academia and industry can be broadly divided into two categories, and other schemes can essentially be classified into these two categories: integer quantization and floating-point quantization.

[0092] Integer quantization refers to a scheme that converts high-precision data into integers for storage. Typically, the quantized integer bits are evenly spaced to maximize the utilization of the quantization range. Figure 2 This is a schematic diagram of a 2-bit quantization scheme on the data axis, which requires mapping all data to four values: 0, 1, 2, and 3. In practice, the quantization points can be flexibly selected according to the range of the data.

[0093] Floating-point quantization refers to a scheme for converting data storage into floating-point numbers. A floating-point number can include a sign bit, an exponent bit (also called the exponent, index, or exponent itself), and a mantissa bit (also called the mantissa), or it can include only the exponent and mantissa bits (i.e., excluding the sign bit, for example, when the floating-point number indicates a purely positive or purely negative number). The sign bit is 1 bit, representing the positive or negative sign of the data; for example, 0 represents positive and 1 represents negative. Both the exponent and mantissa bits are several bits. The number of exponent bits determines the range of values ​​that the floating-point number can represent, and the number of mantissa bits determines the value that the floating-point number can represent. The quantization points in floating-point quantization are not uniformly distributed on the real number line, which better adapts to situations where parameters are concentrated in a certain area.

[0094] Combination Figure 3 The floating-point numbers shown illustrate the method of mapping floating-point numbers from bit strings to real numbers. Generally, the actual value K of a floating-point number represented by a bit string is:

[0095]

[0096] Where s is the bit value of the sign bit. Figure 3If the sign bit is "0", then s = 0.

[0097] n a b is the real number represented by the exponent, and b is an offset. Figure 3 If the median digit is "01011", then n a =2 4 *0+2 3 *1+2 2 *0+2 1 *1+2 0 *1 = 11. For example, b = 2. r-1 -1, where r is the number of bits in the exponent. Figure 3 r = 5.

[0098] n b The value represented by the mantissa. Figure 3 If the middle and last digits are "0101101100010", then: n b =2 -1 *0+2 -2 *1+2 -3 *0+2 -4 *1+2 -5 *1+2 -6 *0+2 -7 *1+2 -8 *1+2 -9 *0+2 -10 *0+2 -11 *0+2 -12 *1+2 -13 *0 = 0.355712890625.

[0099] In addition, the letter E is usually used to represent the exponent and the letter M to represent the mantissa. Figure 3 The floating-point number scheme shown can be called the E5M13 scheme.

[0100] The Institute of Electrical and Electronics Engineers (IEEE) defines floating-point data representation methods such as double-precision floating-point (FP)64 and single-precision FP32, and also defines a half-precision FP16 floating-point data representation method suitable for use in computer graphics environments. In each precision floating-point data representation method, the number of bits (i.e., bit width) of different bits (also called fields) is fixed. For example, FP16 includes 1 sign bit, 5 exponent bits, and 10 mantissa bits; FP32 includes 1 sign bit, 8 exponent bits, and 23 mantissa bits; and FP64 includes 1 sign bit, 11 exponent bits, and 52 mantissa bits. It is evident that the number of bits in current quantization schemes for floating-point numbers is relatively limited, and even the number of exponent and mantissa bits is fixed. Such schemes may not be suitable for specific scenarios. For example, in some scenarios, high-precision data formats like FP64 are not needed, but the precision of FP32 may be insufficient.

[0101] In view of this, this application provides a data processing method that can flexibly adjust the number of bits in the exponent and mantissa of floating-point quantization, so as to effectively utilize the available bandwidth.

[0102] The method provided in this application will be described in detail below with reference to the accompanying drawings. It is understood that the flowcharts and embodiments provided in this application mainly illustrate the method using the first and second devices as the execution entities, but this application does not limit the execution entity of the method. For example, the first / second device in the flowcharts and embodiments can also be a chip, chip system, or processor that supports the first / second device in implementing the method, or it can be a logic module or software capable of implementing all or part of the functions of the first / second device, etc.

[0103] Figure 4 This is a schematic flowchart of a data processing method provided in this application. The method 400 may include steps S410 and S420, which are described below.

[0104] S410, the first device acquires available bandwidth.

[0105] The available bandwidth is used to determine a first value and a second value, which are the number of bits in the exponent and the number of bits in the mantissa of the floating-point number, respectively. For ease of understanding, the number of bits in the exponent and the number of bits in the mantissa determined by the available bandwidth will be denoted as P and Q, respectively, in the following text.

[0106] It is understood that the available bandwidth is the available bandwidth of the first device. For example, the available bandwidth of the first device may be the bandwidth that the first device can use when transmitting data to the second device.

[0107] Specifically, any one of the first data can be quantized into a floating-point number. At the same time, P and Q can be determined based on the available bandwidth (i.e., the number of bits of the exponent and the number of bits of the mantissa of the floating-point number can be determined based on the available bandwidth). Then, any one of the first data can be floating-point quantized into a floating-point number with an exponent of P bits and a mantissa of Q bits.

[0108] In one possible implementation, the distribution of at least one first data point can also be obtained in S410, and the distribution of the at least one first data point and the available bandwidth can be used to determine P and Q.

[0109] For ease of understanding and description, the number of bits used in the floating-point numbers in the embodiments of this application will be referred to as the third value, which will be represented by W in the following text. That is, any of the at least one first data can be represented as a floating-point number using W bits. For example, if the first data includes first first data, second first data, ..., Nth first data (where N is a positive integer), and W = 3, then the aforementioned first first data, second first data, ..., Nth first data can be represented as a floating-point number using 3 bits. It is understood that the above examples are only for the convenience of those skilled in the art and do not constitute a unique limitation on the possible situations in this application. In practice, W can be any positive integer, and the first data can also include only the first first data, or only the first first data and the second first data.

[0110] In one possible implementation, W = P + Q + 1, where 1 is the number of bits for the sign bit. The sign bit is used to indicate whether the data (e.g., the first data or the first quantized data below) is positive or negative.

[0111] In another possible implementation, when the at least one first data includes both positive and negative numbers (i.e., when both positive and negative numbers exist in the at least one first data), W = P + Q + 1, where 1 is the number of sign bits; when the at least one first data includes only positive numbers or only negative numbers (i.e., when all of the at least one first data is negative or all of the first data is positive), W = P + Q. Furthermore, when the at least one first data includes only positive numbers or only negative numbers, whether the number represented by a given floating-point number is positive or negative can be indicated in other ways (e.g., determined interactively between the sender and receiver, or indicated additionally through information), which will be described in detail below and will not be discussed here.

[0112] In some embodiments, W can be determined first, for example, based on available bandwidth, or based on the distribution of available bandwidth and the at least one first data, and then P and Q can be determined based on W. The following provides an example of how W can be determined based on available bandwidth, or based on the distribution of available bandwidth and the at least one first data.

[0113] For example, in one possible implementation, when available bandwidth allows, it can be utilized as much as possible to quantize the first data with as many bits as possible, i.e., W can be as large as possible. For instance, if the available bandwidth allows 1000 bits to quantize the first data, then W can be 1000.

[0114] In another possible implementation, W can be determined based on the available bandwidth and the distribution of the at least one first data point. For example, if the actual need is to conserve bandwidth resources, then W can be determined based on the available bandwidth and the distribution of the at least one first data point.

[0115] In one example, W can be determined based on the correspondence between data distribution and the number of floating-point bits under different available bandwidths, as well as the available bandwidth of the first device and the distribution of the at least one first data. For example, Table 1 shows the correspondence between data distribution and the number of floating-point bits when the available bandwidth is less than or equal to 100M. Table 2 shows the correspondence between data distribution and the number of floating-point bits when the available bandwidth is greater than 100M and less than or equal to 300M. In Tables 1 and 2, H represents the interval length, where interval length = maximum data value - minimum data value.

[0116] Table 1

[0117]

[0118]

[0119] Table 2

[0120] Data distribution H≤1 1<H≤4 4<H≤10 10<H≤100 100<H≤1000 H>1000 Number of bits in a floating-point number 12 14 16 18 20 22 or 24

[0121] For example, if the difference between the maximum and minimum values ​​of the data in at least one first data (i.e., the difference between the largest and smallest first data) is greater than 4 and less than or equal to 10, then W = 16 if the available bandwidth of the first device is 210M, and W = 8 if the available bandwidth of the first device is 100M.

[0122] It should be understood that in Tables 1 and 2 above, “<” can be replaced with “≤”, and correspondingly, “≤” can be replaced with “<”, and “>” can be replaced with “≥”.

[0123] It should be noted that in this application, P and Q can also be determined directly based on the available bandwidth or based on the available bandwidth and the distribution of the at least one first data. For example, the correspondence between data distribution and P and Q under different available bandwidths can be predefined. Then, P and Q can be determined based on the available bandwidth of the first device and the data distribution of the at least one first data. For example, assuming that when the available bandwidth is greater than 100M and less than or equal to 300M, the correspondence between data distribution and P and Q indicates that when the difference between the maximum and minimum data values ​​is greater than 4 and less than or equal to 10, P = 10 and Q = 6. Then, if the available bandwidth of the first device is 210M, and the difference between the maximum and minimum data values ​​in the at least one first data is greater than 4 and less than or equal to 10, then P = 10 and Q = 6 can be determined.

[0124] In another example, the correspondence between data distribution and the number of floating-point bits can be defined through pre-configuration or protocol agreement, as shown in Table 1. If the number of floating-point bits determined based on the distribution of at least one first data and the correspondence can match the available bandwidth, i.e., when the number of floating-point bits is W, the first device can normally transmit at least one first quantized data based on W, obtained by floating-point quantization of the at least one first data. In this case, the number of floating-point bits can be W.

[0125] It is understood that different data have different sensitivities. In some embodiments, the number of bits in a floating-point number can be flexibly adjusted based on the performance of the test data. For example, the test data in the embodiments of this application can be a pre-stored value or several first data in the at least one first data, and this application does not limit it in this way.

[0126] For example, we can first calculate the quantization precision of the test data after quantizing the data when the number of bits of the floating-point number takes different values, and then determine the value of the number of bits of the floating-point number with the highest quantization precision as W.

[0127] In this application, data sensitivity refers to the impact of data fluctuations within a certain range on the final evaluation criterion (quantization accuracy). For example, for neural network parameters, some neural networks experience relatively small / acceptable accuracy loss due to quantization under a certain quantization scheme, making that quantization scheme suitable. However, for another neural network, even with a similar data distribution, that quantization scheme may cause significant errors. Therefore, W can be determined based on the performance of the test data to obtain a more suitable quantization scheme.

[0128] After determining W based on the available bandwidth, or based on the distribution of the available bandwidth and at least one first data, in one possible implementation, the number of bits for the exponent, i.e. P, can be determined first, and then the number of bits for the mantissa, i.e. Q, can be determined based on W and P.

[0129] In one example, first information can be obtained, and P can be determined based on the first information. For example, the first information may include any one or more of the following: the quantization performance of the test data, preset information, and the distribution of the at least one first data point. The following example illustrates how to determine the number of bits P of the exponent based on the first information.

[0130] For example, P can be determined based on the quantization performance of the test data. For instance, the quantization precision of the test data can be calculated when the number of exponent bits takes multiple different values, and the value of the exponent bit with the highest quantization precision is determined as P. It should be understood that all of these different values ​​are less than W. For example, the test data can be a pre-stored numerical value or several first data points from the at least one first data point; this application does not limit this.

[0131] For example, P can be determined based on preset information. For instance, the preset information could be a preset value for P, such as P = 6. Alternatively, the preset information could be the relationship between the number of bits in a floating-point number and the number of bits in the exponent, such as W = f(P), where f(P) is a function related to P, for example, W = f(P) = P / 2.

[0132] For example, P can be determined based on the distribution of the at least one first data point. For instance, P can be determined based on the proportion of the 10% of first data points with the smallest absolute value and / or the proportion of the 10% of first data points with the largest absolute value. Table 3, for example, shows a correspondence between a data distribution and the number of exponent bits. In Table 3, for any column, if only one of the second and third rows, or both, is satisfied, the number of exponent bits is the value shown in the first row.

[0133] Table 3

[0134]

[0135]

[0136] For example, if the percentage of the 10% of the first data with the smallest absolute value is 12%, then P = 2; or, if the percentage of the 10% of the first data with the largest absolute value is 8%, then P = 2; or, if the percentage of the 10% of the first data with the smallest absolute value is 12%, and the percentage of the 10% of the first data with the largest absolute value is 8%, then P = 2.

[0137] For example, Table 3 could be a correspondence between the data distribution and the number of exponent bits when the bit value of a floating-point number belongs to a certain range. For instance, when the bit value of a floating-point number is greater than 8 and less than or equal to 12, the correspondence between the data distribution and the number of exponent bits is shown in Table 3. Assuming W = 9, P can be determined based on Table 3.

[0138] It should be understood that in Table 3 above, “<” can be replaced with “≤”, and correspondingly, “≤” can be replaced with “<”, “>” can be replaced with “≥”, and “≥” can be replaced with “>”.

[0139] In one possible implementation, before or after determining P, it can be determined whether to set the sign bit based on at least one first data, and then Q can be determined based on W, P and whether the sign bit is set.

[0140] For example, if the at least one first data includes both positive and negative numbers, a sign bit is set; if the at least one first data includes only positive numbers or only negative numbers, a sign bit is not set.

[0141] Furthermore, if a sign bit is set, then W = P + Q + 1, where 1 bit is the sign bit; if no sign bit is set, then W = P + Q. Therefore, Q can be determined based on W, P, and whether or not a sign bit is set.

[0142] S420, obtain the first quantized data corresponding to the at least one first data, wherein the number of bits of the exponent and the number of bits of the mantissa of the first quantized data are P and Q, respectively.

[0143] Understandably, any first quantized data is a bit string, comprising an exponent bit and a mantissa bit, where the number of exponent bits is P and the number of mantissa bits is Q. In one example, if the at least one first data contains both positive and negative numbers, then the first quantized data corresponding to any first data consists of a sign bit, an exponent bit, and a mantissa bit. If the at least one first data is all negative or all positive, then the first quantized data corresponding to any first data can consist of an exponent bit and a mantissa bit. In an alternative scheme, if the at least one first data is all negative or all positive, then the first quantized data corresponding to any first data can still consist of a sign bit, an exponent bit, and a mantissa bit, in which case the sign bit can be left empty.

[0144] According to the method provided in this application, the number of bits of the exponent and the number of bits of the mantissa of a floating-point number can be flexibly adjusted according to the available bandwidth, so that the available bandwidth can be effectively utilized, that is, the floating-point number can be adapted to the available bandwidth.

[0145] In one possible implementation, S420 may specifically include: acquiring at least one second data, which is obtained by preprocessing at least one first data corresponding to the at least one second data; and performing floating-point quantization on the at least one second data to obtain first quantized data corresponding to the at least one first data respectively.

[0146] Specifically, based on P and Q obtained in S410, the quantization interval can be obtained, which is the range of values ​​that a floating-point number with P bits for the exponent and Q bits for the mantissa can represent. In one possible implementation, if all at least one first data point is within the quantization interval, each first data point can be directly encoded as a floating-point number with P bits for the exponent and Q bits for the mantissa. In another possible implementation, if at least some of the at least one first data point is not within the quantization interval, each of the at least one first data point can be preprocessed, and then the preprocessed data corresponding to each first data point can be encoded as a floating-point number with P bits for the exponent and Q bits for the mantissa. In yet another possible implementation, regardless of whether all at least one first data point is within the quantization interval, each of the at least one first data point can be preprocessed, and then the preprocessed data corresponding to each first data point can be encoded as a floating-point number with P bits for the exponent and Q bits for the mantissa. It should be understood that at least one piece of data obtained by encoding in any of the above implementation methods is the at least one first quantized data. In the embodiments of this application, encoding can also be called floating-point quantization, which converts data into a bit string representing a floating-point number.

[0147] In some embodiments, the preprocessing can be linear.

[0148] The purpose of linear processing is to match data (e.g., at least one initial data point) with quantization points so that the data lies within the quantization interval. A quantization point is the set of all quantized values ​​that can be mapped to. For example, Figure 5 An exemplary schematic diagram of data matching with quantization points is shown. It can be seen that for data that is not within the quantization range, linear processing can be used to map the data into the quantization range.

[0149] Linear processing can be achieved using a relevant linear function. For example, this linear function can be expressed as the following formula (1):

[0150] f linear (x)=kx+b (1)

[0151] Based on any input data x, the corresponding f can be obtained. iinear The value of (x) can be determined, and then f can be used. linearThe value of (x) is encoded as a floating-point number with P bits for the exponent and Q bits for the mantissa.

[0152] For example, the precision of the parameters of the linear function (i.e., k and b in formula (1)) can be preset, agreed upon by a protocol, or indicated by the second device to the first device. The values ​​of k and b in formula (1) can be determined according to the precision of the parameters of the linear function.

[0153] For example, linear processing can be performed separately in the positive and negative number intervals. For instance, when there are both positive and negative numbers in the data (e.g., the at least one first data point), the parameters of the linear function related to the linear processing can be different in the positive and negative number intervals. That is, for both positive and negative numbers in the data (e.g., the at least one first data point), linear scaling can be performed using formula (1), but the k and b values ​​corresponding to positive numbers and negative numbers can be different.

[0154] For example, the parameters of a linear function can be pre-configured or specified through a protocol.

[0155] For example, the parameters of a linear function can be determined by the first device.

[0156] For example, linear processing can match data with the maximum and minimum values ​​of a quantization interval, or it can match certain typical values. Taking matching data with the maximum and minimum values ​​of a quantization interval as an example, and using a positive interval as an example, assume the data (e.g., at least one first data point) is distributed along the positive half-axis at [min...]. + ,max + The range of floating-point numbers is [fmin] + fmax + Therefore, formula (2) can be used to transform the input data x:

[0157]

[0158] Similarly, for the negative interval, f can be obtained using a formula similar to formula (2). linear (x).

[0159] Based on formula (2), the parameters (values) of the linear function shown in formula (1) can be obtained. For example, k and b in formula (1) are obtained by substituting min... + ,max + fmin + and fmax + After taking the values ​​of , we obtain k and b. Alternatively, k and b can be determined by formula (2) and the precision of the parameters of the specified linear function. For example, by substituting min into formula (2)+ ,max + fmin + and fmax + The value of f is obtained. linear (x) = 5.321x + 0.1452, k and b in formula (1) can be 5.321 and 0.1452 respectively, or, according to the specified precision of the parameters of the linear function, k and b in formula (1) can be 5.3 and 0.1 respectively.

[0160] In other embodiments, preprocessing may include linear processing and nonlinear processing, with the nonlinear processing positioned such that the linear processing occurs before or after the nonlinear processing. The nonlinear function associated with the nonlinear processing may be denoted as f in the following text. nl (x).

[0161] Linear processing preceding nonlinear processing means that the first data is linearly processed, and then the data obtained from the linear processing is nonlinearly processed. Afterwards, the data obtained from the nonlinear processing can be encoded as a floating-point number with P bits for the exponent and Q bits for the mantissa.

[0162] Linear processing following nonlinear processing means that the first data is subjected to nonlinear processing, and then the data obtained from the nonlinear processing is subjected to linear processing. Afterwards, the data obtained from the linear processing can be encoded into a floating-point number with P bits for the exponent and Q bits for the mantissa.

[0163] For information on linear processing, please refer to the description above. It should be understood that if linear processing precedes nonlinear processing, the input to the linear function is the first data, and the input to the nonlinear function is the data obtained from the linear processing; if linear processing follows nonlinear processing, the input to the nonlinear function is the first data, and the input to the linear function is the data obtained from the nonlinear processing.

[0164] For example, nonlinear processing can be performed separately in the positive and negative number intervals. For instance, when at least one first data point contains both positive and negative numbers, the type and parameters (values) of the nonlinear function used for the positive numbers can be different from those used for the negative numbers. For example, the types of nonlinear functions corresponding to positive and negative numbers can be different, or the types of nonlinear functions corresponding to positive and negative numbers can be the same but the parameter values ​​can be different.

[0165] For example, the type and / or parameters of the nonlinear function can be preset or specified by a protocol.

[0166] For example, the type of the nonlinear function and / or the parameters of the nonlinear function can be determined by the first device.

[0167] For example, the first device can determine the type and / or parameters of the nonlinear function based on the quantization performance of the test data or pre-generated data. Specifically, the first device can quantize the test data or pre-generated data using various candidate nonlinear functions (such as the functions shown in Table 4 below) to determine the candidate nonlinear function with the highest quantization accuracy as the final nonlinear function to be used. The pre-generated data can be data obtained in advance based on simulation systems, random data, etc.

[0168] Below is a specific example used to determine the type and parameters of a nonlinear function. Nonlinear functions are mainly divided into two categories: those that make numbers closer to zero more compact, and those that make numbers farther from zero more compact. The following example uses the positive semi-axis. Suppose the data is distributed along the positive semi-axis at [min...]. + ,max + Between [a certain point in time], the median (M) of the parameter that accounts for the top 50% and bottom 50% of the total is used to determine the percentage. It should be understood that if linear processing precedes nonlinear processing, the statistical data is the data obtained from linear processing; if linear processing follows nonlinear processing, the statistical data is the first data. The floating-point number range is [fmin]. + fmax + The median (M') of the floating-point numbers that account for the top 50% and bottom 50% of the total is used to determine the percentage. If α > β, a nonlinear function that makes the numbers closer to zero more compact can be used (such as the nonlinear functions with indices 2 and 4 shown in Table 4); conversely, a nonlinear function that makes the numbers farther from zero more compact can be used (such as the nonlinear functions with indices 0, 1, and 3 shown in Table 4). The parameter of the nonlinear function is A.

[0169] The index 0-tanh (hyperbolic tangent) indicates that the type of nonlinear function is:

[0170] f nl (x)=max + *tanh(Ax)

[0171] The index 1-sigmoid nonlinear function is of the following type:

[0172] f nl (x)=max + *sigmoid(Ax)

[0173] Index 2 - Power functions, the type of nonlinear functions is:

[0174] fnl (x)=max +(1-A) *x A

[0175] Index 3 - Trigonometric functions, the types of nonlinear functions are:

[0176]

[0177] Index 4 - Exponential functions, the types of nonlinear functions are:

[0178] f nl (x)=max + *exp(A(x-max + ))

[0179] In one example, an empirical method can be used to adjust the median M to the median of the quantized point, i.e., parameter A satisfies:

[0180] f nl (M)=min + +β(max + -min + )

[0181] It should be understood that the type and parameters of the nonlinear function corresponding to negative numbers can be obtained using a similar method.

[0182] Table 4

[0183] index <![CDATA[Type of non-linear function (f nl (x))]]> The parameter (A) of a nonlinear function 0 Hyperbolic Tangent A>0 1 sigmoid A>0 2 power function A>1 3 Trigonometric functions 0<A<1 4 Exponential function A>0 …… …… ……

[0184] It should be understood that the above-described nonlinear functions and methods for obtaining nonlinear functions are merely illustrative examples and should not constitute any limitation on this application.

[0185] Traditional methods suffer from a mismatch between quantization points and data, such as multiple data points corresponding to a single quantization point, leading to low quantization accuracy. Linear processing can match quantization points with data, ensuring quantization accuracy. Furthermore, nonlinear processing can make greater use of quantization point resources, further improving quantization accuracy.

[0186] Figure 6 Based on Figure 4 The illustrated method provides a schematic flowchart of a data processing method. This method 600 may include steps S610 to S640, which are described below.

[0187] S610 to S620 are the same as S410 to S420, and can be referenced from S410 to S420.

[0188] S630, the first device outputs the first quantized data and encoding information corresponding to the at least one first data respectively.

[0189] Accordingly, the second device acquires the first quantization data and encoding information corresponding to the at least one first data, the encoding information being used to indicate P and Q.

[0190] In S630, after the first device obtains the first quantized data corresponding to the at least one first data, it can output the obtained at least one first quantized data and encoding information to the second device. Accordingly, the second device can acquire the at least one first quantized data and encoding information.

[0191] The encoded information is used to indicate P and Q. For example, the encoded information may include P and Q, or it may include an index that indicates P and Q. Exemplarily, the at least one first quantized data and the encoded information may be sent simultaneously or at different times; for example, the encoded information may be sent first, followed by the at least one first quantized data.

[0192] In one possible implementation, the encoded information may further include a first bit field that indicates whether the at least one first data point is positive or negative. For example, the first bit field may be 1 bit.

[0193] For example, if the at least one first data includes only positive numbers or only negative numbers, the first quantized data corresponding to any first data may not include a sign bit. In this case, the encoded information may include a first bit field, and the second device can determine whether the first quantized data is positive or negative based on the first bit field in the encoded information. For example, if the first bit field is 0, it represents a positive number; otherwise, it represents a negative number. If the at least one first data includes both positive and negative numbers, the first quantized data may include a sign bit, and in this case, the encoded information may not include the first bit field.

[0194] In the above-described case, the encoded information can also indicate the format of the encoded information. Thus, the second device can determine whether the encoded information includes the first bit field based on the encoded information. For example, the format of the encoded information can be indicated by 1 bit. For instance, when the 1 bit is 0, it indicates that the encoded information includes the first bit field; when the 1 bit is 1, it indicates that the encoded information does not include the first bit field; or the meanings of "0" and "1" can be opposite.

[0195] Of course, it can also be stipulated that regardless of whether the at least one first data includes only positive or negative numbers, or only negative numbers, or whether the at least one first data includes both positive and negative numbers, the first quantized data always includes a sign bit. In this case, the encoded information may not include the first bit field. The encoded information may not indicate the format of the encoded information. Alternatively, if the at least one first data includes only positive or only negative numbers, the first quantized data corresponding to any first data may not include a sign bit, and the encoded information may not include the first bit field. Whether the at least one first data is positive or negative can be notified in other ways, such as by sending a message to the second device in advance to inform it whether the at least one first data corresponding to the at least one first quantized data to be sent by the first device is positive or negative.

[0196] In one possible implementation, the encoded information can also indicate information related to preprocessing.

[0197] For example, if the first data has been preprocessed, or if the second device cannot know the information related to the preprocessing in advance, the information related to the preprocessing can be indicated to the second device.

[0198] In one example, where preprocessing includes linear processing, the information related to the preprocessing may include the parameters of the linear function related to the linear processing. It should be understood that the parameters of the linear function related to the linear processing are k and b in the above formula (1).

[0199] For example, if the preprocessing includes linear processing, and the at least one first data includes both positive and negative numbers, the preprocessing-related information may include the parameters of the linear function corresponding to the positive numbers and the parameters of the linear function corresponding to the negative numbers; if the at least one first data includes only positive numbers, the preprocessing-related information may include the parameters of the linear function corresponding to the positive numbers; if the at least one first data includes only negative numbers, the preprocessing-related information may include the parameters of the linear function corresponding to the negative numbers.

[0200] In one example, where the preprocessing also includes nonlinear processing, the information related to the preprocessing may also include the parameters of the nonlinear function and / or the type of the nonlinear function related to the nonlinear processing.

[0201] For example, if the preprocessing includes nonlinear processing, and the at least one first data includes both positive and negative numbers, the preprocessing-related information may include the parameters of the nonlinear function corresponding to the positive numbers and the parameters of the nonlinear function corresponding to the negative numbers; if the at least one first data includes only positive numbers, the preprocessing-related information may include the parameters of the nonlinear function corresponding to the positive numbers; if the at least one first data includes only negative numbers, the preprocessing-related information may include the parameters of the nonlinear function corresponding to the negative numbers.

[0202] For example, the type of the nonlinear function can be an index value, such as an index value in Table 4. For instance, the at least one first data point can include both positive and negative numbers, and the encoding information can include the index value corresponding to the type of the nonlinear function for positive numbers and the index value corresponding to the type of the nonlinear function for negative numbers.

[0203] In one example, where preprocessing includes nonlinear processing, the encoded information can also indicate the order between the nonlinear and linear processing. The order between the nonlinear and linear processing can also be described as the position of the nonlinear processing. For example, if the order between the nonlinear and linear processing is not predefined, the second device can be instructed on the order between the nonlinear and linear processing. For instance, the encoded information could indicate that the nonlinear processing precedes the linear processing, or it could indicate that the nonlinear processing follows the linear processing.

[0204] In summary, the description of the encoded information, Figure 7 Two formats of encoded information are illustrated schematically. Where the at least one first data item consists only of positive numbers or only of negative numbers, the encoded information can adopt... Figure 7 The format shown in (a) is used. When at least one first data point includes both positive and negative numbers, the encoded information can adopt... Figure 7 The format shown in (b) is correct. It should be understood that... Figure 7 The "linear function in positive (negative) intervals" shown refers to the linear function corresponding to positive (negative) numbers. Figure 7 The same applies to other similar content.

[0205] It should be understood that, in practice, depending on the specific circumstances, the encoded information may include... Figure 7 (a) or Figure 7 The content shown in (b) of the document.

[0206] In some embodiments, the at least one first data is one set of data among multiple sets of data to be transmitted.

[0207] In other words, the data to be transmitted is divided into multiple groups. For any one of these groups, the steps in method 400 or method 600 can be executed. It should be understood that the number of bits in the exponent and the number of bits in the mantissa may be the same or different for different groups of data.

[0208] In a scenario where the at least one first data is one set of data among multiple sets of data to be transmitted, the encoding information may optionally include a group identifier corresponding to the at least one first data, that is, the encoding information may also include a group identifier of the group to which the at least one first data belongs.

[0209] Accordingly, the second device can determine, based on the group identifier in the encoded information, that the encoded information is for the at least one first data, rather than for other data.

[0210] This application does not limit how the second device determines whether the received data is the at least one first data. For example, the identifier can be carried at the beginning or end of the at least one first data to indicate that the data is the at least one first data.

[0211] In addition, if the encoded information does not carry the group identifier corresponding to the at least one first data, the first device may output the encoded information first and then output the at least one first quantized data, while the second device considers the encoded information adjacent to the at least one first quantized data to be used to obtain the at least one first data.

[0212] In one possible implementation, the multiple sets of data to be transmitted correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers. Accordingly, the encoding information can indicate N and the layer identifier of the i-th layer.

[0213] The structural units inherent in the data to be transmitted are referred to as "layers" in this embodiment, for example, the data to be transmitted is data from various layers of a neural network. Within each layer, the data can be divided into at least one group based on the data volume. For each group of data, the steps in method 400 or method 600 can be executed. Assuming that the at least one first data is a group of N data from the i-th layer among multiple layers, the encoding information can indicate N and include the layer identifier of the i-th layer. Accordingly, the second device can determine the layer to which the encoding information is targeted and the number of groups N included in that layer based on the encoding information.

[0214] This application does not limit how the data to be transmitted is layered or how each layer of data is grouped. For example, dimensional information for layering the data and the size of the data in each group can be pre-configured.

[0215] In summary, the descriptions of grouping and layers, Figure 7 Two other formats of encoded information are illustrated schematically. Where the at least one first data item consists only of positive numbers or only of negative numbers, the encoded information can adopt... Figure 8 The format shown in (a) is used. When at least one first data point includes both positive and negative numbers, the encoded information can adopt... Figure 8 The format shown in (b) is correct. It should be understood that... Figure 8 The shown and Figure 7 The same content can be found in the previous text. Figure 7 The description.

[0216] S640, the second device obtains the at least one first data corresponding to the at least one first quantization data based on the encoding information and the at least one first quantization data.

[0217] The second device can acquire the at least one first data based on the encoded information and the at least one first quantized data by performing the opposite operation to the first device.

[0218] In one possible implementation, the second device can obtain the at least one first data by decoding the at least one first quantized data.

[0219] For example, see Figure 9 The flowchart shown illustrates that on the first device side, for any given first data, the first data is input to the encoder, which encodes it into corresponding first quantized data. On the second device side, a decoder can decode the first quantized data into corresponding first data based on P and Q. It should be understood that the decoder performs the opposite operation to the encoder.

[0220] In one possible implementation, in S640, the second device can first obtain at least one second data based on the encoding information and the at least one first quantized data. That is, the second device can first decode the at least one first quantized data according to the encoding information to obtain the second data corresponding to each first quantized data. Then, the second device obtains the at least one first data based on the obtained at least one second data, which is obtained by preprocessing the at least one first data. In other words, the second device can obtain the first data corresponding to each second data by performing the opposite operation to the preprocessing on each of the at least one second data. The preprocessing is described above and will not be repeated here.

[0221] For example, see Figure 10 The flowchart shown illustrates that, on the first device side, for any first data, linear processing is first performed on the first data, that is, taking the first data as x, and calculating the linear function f related to the linear processing. linear The value of (x) is used to obtain the second data; the second data is input into the encoder, which encodes the second data into the first quantized data. On the second device side, the decoder can decode the first quantized data into the second data based on P and Q; then, by performing the inverse process of linear processing, that is, using the second data as x, the inverse function of the linear function related to the linear processing is calculated. The value obtained is the corresponding first data.

[0222] For example, see Figure 11In the flowchart shown in (a), on the first device side, for any first data, the first data is first subjected to linear processing, that is, the first data is taken as x, and the linear function f related to the linear processing is calculated. linear The value of (x) is obtained, and the resulting value is called intermediate data; then, nonlinear processing is performed on the intermediate data, that is, the intermediate data is used as x, and the linear function f related to the nonlinear processing is calculated. nl The value of (x) is used to obtain the second data; the second data is input into the encoder, which encodes the second data into the first quantized data. On the second device side, the decoder can decode the first quantized data into the second data based on P and Q; then, by performing the inverse processing of the second data, i.e., using the second data as x, the inverse function of the nonlinear function related to the nonlinear processing is calculated. The value obtained is the intermediate data; finally, the intermediate data is processed in the opposite way to the linear processing, that is, the intermediate data is used as x to calculate the inverse function of the linear function related to the linear processing. The value obtained is the corresponding first data.

[0223] For example, see Figure 11 In the flowchart shown in (b), on the first device side, for any first data, the first data is first subjected to nonlinear processing, that is, the first data is taken as x, and the linear function f related to the nonlinear processing is calculated. nl The value of (x) is obtained, and the resulting value is called intermediate data; then, linear processing is performed on the intermediate data, that is, the intermediate data is used as x, and the linear function f related to the linear processing is calculated. linear The value of (x) is used to obtain the second data; then, the second data is input into the encoder, which encodes the second data into the first quantized data. On the second device side, the decoder can decode the first quantized data into the second data based on P and Q; then, by performing the inverse processing of the second data, i.e., using the second data as x, the inverse function of the linear function related to the linear processing is calculated. The value obtained is the intermediate data; finally, the intermediate data is processed in the opposite way to the nonlinear processing, that is, the intermediate data is used as x to calculate the inverse function of the nonlinear function related to the nonlinear processing. The value obtained is the corresponding first data.

[0224] According to the method provided in this application, the number of bits in the exponent and mantissa of floating-point quantization can be flexibly adjusted based on available bandwidth or based on available bandwidth and data distribution, thereby making effective use of available bandwidth. Furthermore, by performing linear processing on the data, or linear and nonlinear processing, the quantization bit resources can be utilized to a greater extent, improving transmission accuracy.

[0225] Figure 12 and Figure 13 This diagram illustrates the quantization performance obtained from simulations using different quantization schemes. The data to be transmitted is the parameters of the autoencoder used to recover channel state information (CSI). The autoencoder uses a common convolutional neural network. The compressor consists of a single convolutional network, a batch normalization (BN) network connected to a fully connected network, and a single fully connected network followed by seven convolutional networks and a BN layer. The quantization object is the decompressor, and the network quantization evaluation metric is cosine similarity. Let the input CSI matrix be H = [h1,…,h]. n ], restore the CSI matrix as The method for calculating cosine similarity is as follows:

[0226]

[0227] See Figure 12 and Figure 13 Method 1 (E5Float) is a floating-point scheme with an exponent of 5; Method 2 (Dynamic Int) is an integer quantization scheme with dynamically adjusted bit count; Method 3 (Dynamic Float) is the data processing method provided in this application. The horizontal axis represents the average number of bits, which includes the overhead of the encoded information. The average number of bits is the sum of the number of bits of the Z floating-point numbers and the total overhead of the encoded information, divided by Z. Under 32-bit floating-point quantization, the cosine similarity is 0.9902. See simulation results. Figure 12 For quantization performance with an average bit count of 6-16, the following... Figure 13 The quantization performance is shown for an average bit count of 10⁻¹⁶. It is evident that the scheme provided in this application exhibits better quantization performance with the same bit count, i.e., higher cosine similarity. Furthermore, at a cosine similarity around 0.9902, the scheme provided in this application requires fewer bits compared to 32-bit floating-point quantization.

[0228] This application also provides a data processing method that does not limit how the number of exponent bits and mantissa bits are determined; for example, traditional methods can be used to determine the number of exponent bits and mantissa bits. For any data to be transmitted, it can be sequentially processed linearly, nonlinearly, and encoded to obtain the corresponding quantized data. The order of the linear and nonlinear processing can be reversed.

[0229] For example, when the methods described above are not applicable due to limitations in data storage, traditional methods can be used to determine the number of exponent bits and mantissa bits, followed by linear processing, nonlinear processing, and encoding to obtain the quantized data. The order of the linear and nonlinear processing can be reversed.

[0230] The method provided in this application has been described above; the apparatus provided in this application will be described below.

[0231] Figure 14 A possible exemplary block diagram of the apparatus involved in an embodiment of this application is shown. For example... Figure 14 As shown, the device 2000 may include modules or units for implementing the methods described in the embodiments above. In one possible design, the device 2000 includes a processing unit 2200. Optionally, the device 2000 may also include a communication unit 2100. Optionally, the device 2000 may also include a storage unit 2300 for storing device program code and / or data.

[0232] In one possible design, the device 2000 can implement the functions of the first device in the above embodiments. For example, the device 2000 can be the first device or a module, circuit or chip in the first device.

[0233] In one embodiment, the processing unit 2200 is configured to: use the available bandwidth to determine a first value and a second value, the first value and the second value being the number of bits in the exponent and the number of bits in the mantissa of a floating-point number, respectively; and acquire at least one first quantized data corresponding to a first data, the number of bits in the exponent and the number of bits in the mantissa of the first quantized data being the first value and the second value, respectively.

[0234] Optionally, the processing unit 2200 is specifically used to: obtain the available bandwidth and the distribution of the at least one first data, wherein the available bandwidth and the distribution of the at least one first data are used to determine the first value and the second value.

[0235] Optionally, the processing unit 2200 is specifically configured to: acquire at least one second data, wherein the at least one second data is obtained by preprocessing the at least one first data corresponding to the at least one second data; and perform floating-point quantization on the at least one second data to obtain first quantized data corresponding to the at least one first data respectively.

[0236] Optionally, the communication unit 2100 is configured to output first quantized data and encoding information corresponding to the at least one first data, wherein the encoding information is used to indicate the first value and the second value. For example, the operation of outputting the first quantized data and encoding information corresponding to the at least one first data can also be performed by the processing unit 2200.

[0237] Optionally, the at least one first data is one set of data from a plurality of data sets to be transmitted.

[0238] Optionally, the encoding information may further include a group identifier corresponding to the at least one first data.

[0239] Optionally, the multiple sets of data correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers. The encoding information indicates N and the layer identifier of the i-th layer.

[0240] Optionally, the at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates the positive or negative status of the first quantized data; or the at least one first data includes only positive numbers or only negative numbers, and the first quantized data does not include the sign bit.

[0241] Optionally, the preprocessing is linear processing, or the preprocessing includes both linear and nonlinear processing.

[0242] Optionally, the precoding information further includes one or more of the following: parameters of the linear function related to linear processing, the type of the nonlinear function related to nonlinear processing, parameters of the nonlinear function, or the order between the linear processing and the nonlinear processing; wherein the linear processing and the nonlinear processing are used to preprocess the at least one first data.

[0243] Optionally, the processing unit 2200 is further configured to: determine a third value based on the available bandwidth, or based on the available bandwidth and the distribution of the at least one first data, wherein the third value is the number of bits of the floating-point number; determine the first value based on first information, wherein the first value is less than the third value, wherein the first information includes one or more of the following: quantization performance of the verification data, preset information, and the distribution of the at least one first data; and determine a second value based on the third value and the first value.

[0244] Optionally, the processing unit 2200 is specifically configured to: determine whether to set a sign bit based on the at least one first data, the sign bit indicating the positive or negative status of the first quantized data; and determine the second value based on the third value, the first value, and whether the sign bit is set.

[0245] Optionally, the processing unit 2200 is specifically configured to: set the sign bit when the at least one first data includes both positive and negative numbers; or not set the sign bit when the at least one first data includes only positive numbers or only negative numbers.

[0246] Optionally, the sign bit is set, and the third value is the sum of the first value, the number of bits of the sign bit, and the second value; if the sign bit is not set, the third value is the sum of the first value and the second value.

[0247] In one possible design, the device 2000 can implement the functions of the second device in the above embodiments. For example, the device 2000 can be the second device or a module, circuit or chip in the second device.

[0248] In one embodiment, the processing unit 2200 is configured to: acquire encoding information, the encoding information indicating a first value and a second value, the first value and the second value being the number of bits in the exponent and the number of bits in the mantissa of a floating-point number, respectively; acquire at least one first quantized data, the number of bits in the exponent and the number of bits in the mantissa of the first quantized data being the first value and the second value, respectively; and acquire at least one first data corresponding to the at least one first quantized data based on the encoding information and the at least one first quantized data.

[0249] Optionally, the processing unit 2200 is specifically configured to: obtain at least one second data based on the encoding information and the at least one first quantization data; obtain the at least one first data based on the at least one second data, wherein the at least one second data is obtained by preprocessing the at least one first data.

[0250] Optionally, the at least one first data is one set of data from a plurality of data sets to be transmitted.

[0251] Optionally, the encoding information may further include a group identifier corresponding to the at least one first data.

[0252] Optionally, the multiple sets of data correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers. The encoding information indicates N and the layer identifier of the i-th layer.

[0253] Optionally, the at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates the positive or negative status of the first quantized data; or the at least one first data includes only positive numbers or only negative numbers, and the first quantized data does not include the sign bit.

[0254] Optionally, the preprocessing is linear processing, or the preprocessing includes both linear and nonlinear processing.

[0255] Optionally, the encoding information may also indicate one or more of the following: the parameters of the linear function associated with the linear processing, the type of the nonlinear function associated with the nonlinear processing, the parameters of the nonlinear function, or the order between the linear processing and the nonlinear processing.

[0256] It is understood that the division of units in the above-described device is merely a logical functional division. One function can correspond to one functional unit, or two or more functions can be integrated into one functional unit. In actual implementation, all or some units can be integrated onto a single physical entity, or distributed across different physical entities. Furthermore, the aforementioned functional units can be implemented in hardware, software, or a combination of both. Whether a function is executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for specific applications, but such implementations should not be considered beyond the scope of this application.

[0257] In one example, the functional unit in any of the above devices may be one or more integrated circuits configured to implement the above methods, such as: one or more application-specific integrated circuits (ASICs), or one or more central processing units (CPUs), one or more microcontroller units (MCUs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.

[0258] In one example, storage unit 2300 may include random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory and / or registers, etc.

[0259] Figure 15 A schematic block diagram of another device 3000 provided in an embodiment of this application is shown. This device 3000 may be a first device or a second device, or it may be a chip, chip system, or processor, etc., that supports the first or second device in implementing the above-described methods. This device 3000 can be used to implement the methods described in the above-described method embodiments; for details, please refer to the descriptions in the above-described method embodiments.

[0260] The device 3000 may include one or more processors 3100, which may also be referred to as processing units, and can implement certain control functions. The processor 3100 may be a general-purpose processor or a dedicated processor, such as a baseband processor or a central processing unit. The baseband processor can be used to process communication protocols and communication data, while the central processing unit can be used to control the device (e.g., base station, baseband chip, user, user chip, DU or CU, etc.), execute software programs, and process data from the software programs.

[0261] In an alternative design, the processor 3100 may also store instructions and / or data that can be executed by the processor 3100 to cause the device 3000 to perform the methods described in the above method embodiments.

[0262] In another alternative design, the device 3000 may include a communication interface 3200 for implementing receiving and transmitting functions. For example, the communication interface 3200 may be a transceiver circuit, interface, interface circuit, or transceiver. The transceiver circuit, interface, interface circuit, or transceiver for implementing receiving and transmitting functions may be separate or integrated. The aforementioned transceiver circuit, interface, interface circuit, or transceiver may be used for reading and writing code / data, or it may be used for transmitting or relaying signals.

[0263] Optionally, the device 3000 may include one or more memories 3300, which may store instructions that can be executed on the processor 3100, causing the device 3000 to perform the methods described in the above method embodiments. Optionally, the memory 3300 may also store data. Optionally, the processor 3100 may also store instructions and / or data. The processor 3100 and the memory 3300 may be configured separately or integrated together.

[0264] The processor, processor system, application processor, baseband processor, processor circuit, or processor core involved in the embodiments of this application can be collectively referred to as a processor. The processor may include one or more of the following: central processing unit (CPU), digital signal processor (DSP), microprocessor unit (MPU), microcontroller unit (MCU), graphics processing unit (GPU), field programmable gate array (FPGA), artificial intelligence processor (AI processor), or neural processing unit (NPU).

[0265] The memory involved in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0266] This application also provides a computer program product, including computer program instructions that, when executed, cause the various steps or processes performed by the first or second device in any of the above method embodiments to be executed.

[0267] This application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed, cause the various steps or processes performed by the first or second device in any of the above method embodiments to be executed.

[0268] This application also provides a chip, including a processor, for calling and running a computer program or instructions from a memory, such that the various steps or processes performed by the first or second device in any of the above method embodiments are executed.

[0269] This application also provides a communication system that includes at least one of a first device or a second device.

[0270] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.

[0271] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0272] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0273] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0274] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data processing method, characterized in that, The method is applied to a first device, including: Obtain available bandwidth, which is used to determine a first value and a second value, wherein the first value and the second value are the number of bits of the exponent and the number of bits of the mantissa of the floating-point number, respectively. Obtain at least one first quantized data corresponding to a first data, wherein the number of bits in the exponent and the number of bits in the mantissa of the first quantized data are the first value and the second value, respectively.

2. The method as described in claim 1, characterized in that, The step of obtaining available bandwidth, wherein the available bandwidth is used to determine the first value and the second value, specifically includes: The available bandwidth and the distribution of at least one first data are obtained, and the available bandwidth and the distribution of at least one first data are used to determine the first value and the second value.

3. The method as described in claim 1 or 2, characterized in that, The acquisition of the first quantized data corresponding to at least one first data point specifically includes: Obtain at least one second data, wherein the at least one second data is obtained by preprocessing the at least one first data corresponding to the at least one second data; The at least one second data is subjected to floating-point quantization to obtain the first quantized data corresponding to the at least one first data respectively.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Output the first quantized data and encoding information corresponding to the at least one first data, wherein the encoding information is used to indicate the first value and the second value.

5. The method as described in claim 4, characterized in that, The at least one first data is one set of data among multiple sets of data to be transmitted.

6. The method as described in claim 5, characterized in that, The encoded information also includes a group identifier corresponding to at least one of the first data.

7. The method as described in claim 6, characterized in that, The multiple sets of data correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers. The encoding information indicates N and the layer identifier of the i-th layer.

8. The method according to any one of claims 4-7, characterized in that, The at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates the positive or negative status of the first quantized data; The first data includes only positive numbers or only negative numbers, and the first quantization data does not include the sign bit.

9. The method as described in claim 3, characterized in that, The preprocessing is linear processing, or the preprocessing includes both linear and nonlinear processing.

10. The method as described in claim 4, characterized in that, The precoding information further includes one or more of the following: parameters of the linear function related to linear processing, the type of the nonlinear function related to nonlinear processing, the parameters of the nonlinear function, or the order between the linear processing and the nonlinear processing; wherein the linear processing and the nonlinear processing are used to preprocess the at least one first data.

11. The method according to any one of claims 1-10, characterized in that, Before acquiring the first quantized data corresponding to at least one first data point, the method further includes: A third value is determined based on the available bandwidth, or based on the distribution of the available bandwidth and the at least one first data, wherein the third value is the number of bits of the floating-point number; Based on the first information, the first value is determined, and the first value is less than the third value. The first information includes one or more of the following: the quantitative performance of the test data, preset information, and the distribution of the at least one first data. The second value is determined based on the third value and the first value.

12. The method as described in claim 11, characterized in that, Determining the second value based on the third value and the first value includes: Whether to set a sign bit is determined based on the at least one first data, wherein the sign bit indicates the positive or negative status of the first quantized data; The second value is determined based on the third value, the first value, and whether the sign bit is set.

13. The method as described in claim 12, characterized in that, Determining whether to set the sign bit based on the at least one first data includes: The at least one first data includes both positive and negative numbers, and the sign bit is set; The at least one first data includes only positive numbers or only negative numbers, and the sign bit is not set.

14. The method as described in claim 13, characterized in that, The sign bit is set, and the third value is the sum of the first value, the number of bits of the sign bit, and the second value; Without setting the sign bit, the third value is the sum of the first value and the second value.

15. A data processing method, characterized in that, The method is applied to a second device, including: Obtain encoding information, which is used to indicate a first value and a second value, wherein the first value and the second value are the number of bits of the exponent and the number of bits of the mantissa of the floating-point number, respectively. Acquire at least one first quantized data, wherein the number of bits in the exponent and the number of bits in the mantissa of the first quantized data are the first value and the second value, respectively; Based on the encoding information and the at least one first quantization data, obtain at least one first data corresponding to the at least one first quantization data.

16. The method as described in claim 15, characterized in that, The step of obtaining at least one first data corresponding to the at least one first quantization data based on the encoding information and the at least one first quantization data includes: Based on the encoding information and the at least one first quantization data, at least one second data is obtained; The at least one first data is obtained based on the at least one second data, wherein the at least one second data is obtained by preprocessing the at least one first data.

17. The method as described in claim 15 or 16, characterized in that, The at least one first data is one set of data among multiple sets of data to be transmitted.

18. The method as described in claim 17, characterized in that, The encoded information also includes a group identifier corresponding to at least one of the first data.

19. The method as described in claim 18, characterized in that, The multiple sets of data correspond to multiple layers, and each layer includes at least one set of data from the multiple sets of data. The at least one first set of data is a set of data from N sets of data in the i-th layer of the multiple layers, where i and N are both positive integers. The encoding information indicates N and the layer identifier of the i-th layer.

20. The method according to any one of claims 15-19, characterized in that, The at least one first data includes both positive and negative numbers, and the first quantized data includes a sign bit, wherein the sign bit indicates whether the first quantized data is positive or negative; the at least one first data includes only positive numbers or only negative numbers, and the first quantized data does not include the sign bit.

21. The method as described in claim 16, characterized in that, The preprocessing is linear processing, or the preprocessing includes both linear and nonlinear processing.

22. The method as described in claim 21, characterized in that, The encoded information also indicates one or more of the following: the parameters of the linear function associated with the linear processing, the type of the nonlinear function associated with the nonlinear processing, the parameters of the nonlinear function, or the order between the linear processing and the nonlinear processing.

23. An apparatus, characterized in that, It includes units for performing the steps of the method as claimed in any one of claims 1-14 or any one of claims 15-22.

24. An apparatus, characterized in that, The device includes a processor coupled to a memory for storing programs or instructions that, when executed by the processor, cause the device to perform the method as claimed in any one of claims 1-14 or any one of claims 15-22.

25. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, the method as described in any one of claims 1-14 or any one of claims 15-22 is performed.

26. A computer program product, characterized in that, It includes computer program instructions that, when executed, cause the method as claimed in any one of claims 1-14 or any one of claims 15-22 to be performed.

27. A chip, characterized in that, Includes a processor for calling and running a computer program from memory, such that the method as described in any one of claims 1-14 or any one of claims 15-22 is performed.