Search

CN-121996146-A - Data processing method, device, chip and equipment

CN121996146ACN 121996146 ACN121996146 ACN 121996146ACN-121996146-A

Abstract

The application relates to the technical field of computers, and provides a data processing method, a device, a chip and equipment, wherein the method comprises the steps of reading data from a first storage space according to a data processing unit of a processor to obtain first data, the first data includes a plurality of target data having consecutive storage addresses, and the data storage addresses of the target data do not conform to the target byte alignment. And storing the first data into a second storage space as second data, and converting the second data to obtain converted second data. The converted second data is used as the carried data of the first data, and the converted second data comprises a plurality of filled target data, and the data storage address of the filled target data accords with the target byte alignment. The method and the device can ensure that the carried data meet the required target byte alignment, and can improve the data access efficiency and the data transmission bandwidth of the processor in the data carrying process.

Inventors

  • LU LU
  • ZHAO RONG
  • Zhu Songxiang
  • ZHU WANGYI

Assignees

  • 华为技术有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (13)

  1. 1. A method of data processing, the method performed by a processor, the method comprising: Reading data from a first storage space according to a data processing unit of the processor to obtain initial input data, wherein the initial input data comprises a plurality of target data with continuous storage addresses, the data processing unit is used for representing the byte number of the data read by the processor at one time, and the data storage addresses of the target data in the first storage space do not accord with target byte alignment; storing the initial input data into a second storage space as intermediate input data; And converting the intermediate input data in the second storage space to obtain converted input data, wherein the converted input data comprises a plurality of filled target data, the data storage addresses of the filled target data in the second storage space conform to target byte alignment, and the converted input data is used for executing calculation.
  2. 2. The method of claim 1, wherein converting the intermediate input data in the second storage space to converted input data comprises: performing matrix transposition on the intermediate input data in the second storage space to obtain transposed input data; Filling the data of the plurality of target data contained in the transposed input data to obtain filled input data, wherein the data length of the filled target data is an integer multiple of the target bytes; and performing matrix transposition on the filled input data to obtain the converted input data.
  3. 3. The method according to claim 1 or 2, characterized in that the method further comprises: Reading data from the first storage space according to a data processing unit of the processor to obtain an initial DFT calculation matrix, wherein the initial DFT calculation matrix comprises a plurality of elements which are arranged continuously, and data storage addresses of the elements in the first storage space do not accord with target byte alignment; storing the initial DFT calculation matrix into the second storage space as an intermediate DFT calculation matrix; Converting the intermediate DFT calculation matrix in the second storage space to obtain a converted DFT calculation matrix, wherein the converted DFT calculation matrix comprises a plurality of filled elements, and the data storage addresses of the filled elements in the second storage space accord with target byte alignment; and performing FFT calculation on the converted input data according to the converted DFT calculation matrix to obtain an FFT calculation result of the initial input data.
  4. 4. The method of claim 3, wherein said converting the intermediate DFT computation matrix in the second storage space to a converted DFT computation matrix comprises: Performing matrix transposition on the intermediate DFT calculation matrix in the second storage space to obtain a transposed DFT calculation matrix; Filling data of the plurality of elements contained in the transposed DFT calculation matrix to obtain a filled DFT calculation matrix, wherein the data length of the filled elements is an integer multiple of the target bytes; and performing matrix transposition on the filled DFT calculation matrix to obtain the converted DFT calculation matrix.
  5. 5. The method of claim 3 or 4, wherein said performing FFT computation on said converted input data comprises: And performing FFT calculation on the padded target data to obtain an FFT calculation result of the target data, wherein the FFT calculation result of the initial input data comprises the FFT calculation result of the target data.
  6. 6. The method of claim 5, wherein the target data comprises a plurality of complex data, and the FFT computation of the target data comprises real and imaginary computation of the target data; the performing FFT computation on the padded target data to obtain an FFT computation result of the target data includes: carrying out data separation on the filled target data to obtain real part data and imaginary part data of the filled target data; performing FFT (fast Fourier transform) calculation on the real part data and the imaginary part data of the filled object data to obtain a real part calculation result and an imaginary part calculation result of the object data; and combining the real part calculation result and the imaginary part calculation result of the target data to obtain the FFT calculation result of the target data.
  7. 7. The method of claim 6, wherein the real part calculation of the object data comprises a real part data matrix and the imaginary part calculation of the object data comprises an imaginary part data matrix; Combining the real part calculation result and the imaginary part calculation result of the target data to obtain an FFT calculation result of the target data, including: Matrix transposition is carried out on the real part calculation result of the target data to obtain a transposed real part calculation result; performing matrix transposition on the virtual part calculation result of the target data to obtain a transposed virtual part calculation result; combining the transposed real part calculation result and the transposed imaginary part calculation result to obtain a first intermediate FFT calculation result of the target data; performing matrix transposition on the first intermediate FFT calculation result to obtain a second intermediate FFT calculation result; And adjusting the row sequence of a plurality of rows included in the second intermediate FFT calculation result to obtain the FFT calculation result of the target data.
  8. 8. The method of claim 5, wherein performing FFT computation on the post-pad target data comprises a plurality of computation phases, a number i of which is related to a number N of data contained in the target data; The nth computing stage of the plurality of computing stages includes: Executing the nth calculation stage on the filled target data under the condition that N is smaller than i to obtain an initial calculation result of the nth calculation stage, wherein the initial calculation result is a matrix with a dimension of (N 0 ,n 1 ,n 2 ), and N 0 ×n 1 ×n 2 = N; respectively performing matrix transposition on a plurality of data blocks included in the initial calculation result to obtain a plurality of transposed data blocks; And obtaining a transposed calculation result of the initial calculation result according to the plurality of transposed data blocks, wherein the transposed calculation result is a matrix with the dimension of (n 1 ,n 0 ,n 2 ), and the transposed calculation result is used as the calculation result of the nth calculation stage.
  9. 9. A data processing apparatus, the apparatus comprising: The input data reading module is used for reading data from the first storage space according to a data processing unit of the processor to obtain initial input data, wherein the initial input data comprises a plurality of target data with continuous storage addresses, the data processing unit is used for representing the byte number of the data read by the processor at one time, the data storage addresses of the target data do not accord with target byte alignment, and the data processing unit of the processor is a target byte; The input data storage module is used for storing the initial input data into a second storage space to serve as intermediate input data; The input data conversion module is used for converting the intermediate input data in the second storage space to obtain converted input data, wherein the converted input data comprises a plurality of filled target data, the data storage addresses of the filled target data accord with target byte alignment, and the converted input data is used for executing calculation.
  10. 10. A computing device comprising a processor and a memory, the processor configured to execute instructions stored in the memory to cause the computing device to perform the method of any of claims 1-8.
  11. 11. A chip system comprising a processor and a power supply circuit for powering the processor, the processor for performing the operational steps of the method of any of claims 1-8.
  12. 12. A computer program product containing instructions that, when executed by at least one computing device, cause the at least one computing device to perform the method of any of claims 1-8.
  13. 13. A computer readable storage medium comprising computer program instructions which, when executed by a computing device, perform the method of any of claims 1-8.

Description

Data processing method, device, chip and equipment Technical Field The present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, chip, and device. Background The processor can read and process data in a data processing unit of a certain size when executing an instruction for accessing data or an instruction for processing data. In the case that the data processing unit of the processor is the target byte, if the data is stored in the storage space as the target byte alignment data, the processor can perform the target byte alignment access to read and process the data, and the efficiency of reading and processing the data by the processor is high. If the data is stored in the memory space as non-target byte alignment data, the processor cannot perform the target byte alignment access to read the data, and the processor is less efficient in reading and processing the data. In the situations of data handling and the like of a processor, which relate to reading and processing non-target byte alignment data, a data processing method needs to be provided to improve the efficiency of reading and processing the non-target byte alignment data when the processor performs tasks such as data handling and the like. Disclosure of Invention The application provides a data processing method, a device, a chip and equipment, which can improve the efficiency of a processor for reading and processing non-target byte alignment data in a data carrying scene. In a first aspect, a first data processing method is provided, the method being performed by a processor, the method comprising reading data from a first storage space according to a data processing unit of the processor, obtaining first data, the first data comprising a plurality of target data with consecutive storage addresses, the data storage addresses of the target data not conforming to a target byte alignment. The data processing unit is used to represent the number of bytes of data that the processor reads at a time (the number of bytes may be represented by a target byte). And the method further comprises the steps of storing the first data into a second storage space to serve as second data, and then converting the second data in the second storage space to obtain converted second data, wherein the converted second data serves as carried data of the first data. The converted second data comprises a plurality of filled target data, and the data storage address of the filled target data accords with the target byte alignment. The data processing method provided by the embodiment of the application realizes the data handling process of handling the first data with the non-target byte aligned from the first storage space to the second storage space and storing the first data with the non-target byte aligned as the handled data with the target byte aligned. In the data processing method provided by the embodiment of the application, the data are continuously read from the first storage space according to the data processing unit of the processor to obtain the first data, so that the processor can read the non-target byte aligned first data (including a plurality of target data) from the first storage space with the maximum data access efficiency. And after the first data is stored in the second storage space as second data, converting the second data (comprising a plurality of target data) into a required data layout, namely target byte alignment, in the second storage space. Therefore, the data access efficiency and the data transmission bandwidth of the processor in the data handling process can be improved while ensuring that the data after being handled meets the required target byte alignment (in the data processing method provided by the application, the data transmission bandwidth in the data handling process can be the maximum data transmission bandwidth of the processor, which is also called as the nominal bandwidth). In one possible implementation manner, the converting the second data in the second storage space to obtain converted second data includes performing matrix transposition on the second data in the second storage space to obtain transposed second data, performing data filling on a plurality of target data contained in the transposed second data to obtain filled second data, wherein the data length of the filled target data is an integer multiple of the target bytes, and performing matrix transposition on the filled second data to obtain converted second data. According to the data processing method provided by the embodiment of the application, first, matrix transposition is performed on second data (such as a matrix comprising n rows and m columns), then data filling is performed on a plurality of target data included in the transposed second data to obtain the filled second data, and then matrix transposition is performed on the filled second data to obtain converted second dat