A multi-channel DMA method for tensor data movement

By employing a multi-channel DMA method and utilizing a multi-dimensional tensor data structure to configure DMA, memory bank conflicts are handled, achieving efficient data transfer and automatic memory bandwidth allocation. This solves the problems of complex linked list structures and synchronization difficulties, thereby improving data transfer efficiency.

CN115495400BActive Publication Date: 2025-12-26SUZHOU YIZHU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211382776.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2025-12-26
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as complex linked list structures, large storage space requirements, and difficulty in synchronization when processing data transmission of multi-channel feature maps, resulting in low efficiency, especially in large-scale data transmission.

Method used

The multi-channel DMA method is adopted, which treats memory data as a multi-dimensional tensor data structure and configures DMA based on the multi-dimensional tensor data structure. The DMA is configured to scan in any dimension of the multi-dimensional tensor data structure, handle memory bank conflicts, skip conflict banks with priority, and automatically negotiate memory bandwidth allocation.

Benefits of technology

It achieves efficient multi-channel data transmission, reduces storage space requirements, simplifies the DMA configuration process, and improves data transmission efficiency and synchronization consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495400B_ABST
    Figure CN115495400B_ABST
Patent Text Reader

Abstract

The application provides a multi-channel DMA method for tensor data carrying, and the multi-channel DMA for tensor data carrying carries out the carrying process of three-dimensional tensor data which is displayed as a cubic structure in the memory by configuring channel parameters. The DMA channel parameters are set according to the length, width and height of the three-dimensional tensor data cubic structure, the scanning direction of the three-dimensional cubic structure and the required memory bank number are described, and the memory bandwidth is automatically divided. The three-dimensional tensor data is carried through the application scheme, without a linked list structure, so that the memory is saved, meanwhile, the multi-channel DMA can automatically skip the conflict memory bank to carry data and automatically synchronize the carrying signal; the configuration of the DMA only needs to be based on the structure characteristics of the cubic structure tensor data itself.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data transmission, and particularly relates to a multi-channel DMA method for tensor data. BACKGROUND

[0002] In current convolutional neural network-based computing, data needs to be moved for multi-channel feature maps, and the multi-channel feature maps are displayed as a cubic structure in memory. How to fully utilize the bandwidth of the internal memory to quickly read the multi-channel feature maps of the cubic structure becomes a design difficulty of neural network computing.

[0003] Tensor is a standard way of representing data in deep learning, which is an extension of a two-dimensional table (matrix) to a higher dimension. DMA (Direct Memory Access) is a mechanism for fast data transfer. Data transfer can be from an adapter card to memory, from memory to an adapter card, or from one piece of memory to another. A DMA channel is used to transfer data. The importance of DMA technology lies in that it does not require the participation of a CPU when data transfer is performed using it. Traditional DMA uses a linked list structure to move two-dimensional data in memory. When the width of the memory data to be moved is very large, multiple DMAs need to be established to complete the movement of multiple linked lists. For the multi-dimensional tensor data structure required by current neural network computing, the linked list will be very complex, and the storage space required by the linked list itself is also very large. Moreover, when multiple DMA channels are moving simultaneously, synchronization of the end of the movement needs to be completed by additional circuits. SUMMARY

[0004] To solve the above problems, the present application provides a multi-channel DMA method for tensor data movement.

[0005] A multi-channel DMA method for tensor data movement, comprising the following steps:

[0006] DMA configuration, regarding the data stored in the memory as a multi-dimensional tensor data structure, and performing DMA configuration based on the multi-dimensional tensor data structure, wherein the DMA configuration takes any one dimension of the multi-dimensional tensor data structure as a scanning direction;

[0007] Tensor data movement, the DMA controller moves the tensor data according to the scanning direction in the DMA configuration;

[0008] memory bank conflict handling, the tensor data is distributed on all memory banks, when multiple DMA perform different DMA configurations, detect whether each transfer will cause conflict on the same memory bank, if there is conflict, the low priority DMA skips the data in this bank, preferentially transfer the data of the cube structure on the free memory bank, until the conflicting memory bank is free, the low priority DMA will transfer the previously skipped data to the target.

[0009] Further, the multi-dimensional tensor data structure is a three-dimensional cube structure, wherein the first dimension is constituted by the number of memory stored in a single row of memory, regarded as the length of the cube, the second dimension is constituted by the number of rows of memory, regarded as the width of the cube, and the third dimension is constituted by the group (bank) of physical memory, regarded as the height of the cube.

[0010] Further, the scan direction includes:

[0011] Scan_first, the scan direction of the first dimension, which can be width, length or height;

[0012] Scan_second, the scan direction of the second dimension, which can be width, length or height.

[0013] Further, the DMA configuration further includes the required number of memory banks.

[0014] Further, a multi-channel DMA method for tensor data transfer further includes a memory bandwidth division step, and multiple DMAs automatically negotiate memory bandwidth division according to DMA configuration information.

[0015] Further, the DMA configuration further includes:

[0016] Line_skip, line skip;

[0017] Line_number, line number;

[0018] Height_skip, height skip;

[0019] Height_number, height;

[0020] Width_skip, width skip;

[0021] Width_number, width.

[0022] Further, each DMA physical channel can be shared by multiple DMA configurations, and multiple DMA configurations independently transfer according to requirements.

[0023] Further, the DMA carrying mode includes carrying from the length direction, the width direction or the height direction, and a completion signal is sent after each dimension carrying is completed, and an external synchronization module synchronizes the completion signals of the DMA channels to a consistent completion signal and sends the consistent completion signal to the next processing unit.

[0024] The application has the advantages that the application provides a multi-channel DMA for tensor data carrying, the DMA channel parameters are set according to the length, width and height of a three-dimensional tensor data cube structure, the scanning direction of the three-dimensional structure and the required memory bank number are described, and the memory bandwidth is automatically divided. The three-dimensional tensor data is carried by the application, without a linked list structure, memory is saved, the multi-channel DMA can automatically skip the conflict memory bank to carry data and automatically synchronize the carrying signals, and the configuration of the DMA only needs to be based on the structure characteristics of the cube structure tensor data itself, so that the difficulty is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 The application provides a data cube structure scanning schematic diagram of a multi-channel DMA method for tensor data carrying. DETAILED DESCRIPTION

[0026] In order to have a clearer understanding of the technical features, objects and effects of the application, the specific embodiments of the application will be described with reference to the drawings.

[0027] The application provides a multi-channel DMA method A for tensor data carrying, characterized in that the multi-channel DMA for tensor data carrying is configured by channel parameters, and the carrying process of three-dimensional tensor data displayed as a cube structure in the memory is realized.

[0028] In the embodiment, as shown in the figure, the data stored in the memory is regarded as a three-dimensional structure of a cube, the configuration of the DMA is configured according to the length, width and height of the cube, and the scanning direction of the three-dimensional structure and the required memory bank number are described, and the memory bandwidth is automatically divided according to the cube size configuration and other information by the multiple DMA channels. Figure 1

[0029] In the embodiment, each DMA physical channel can be shared by multiple configurations, the multiple configurations independently carry according to the requirements, the DMA carrying mode can be selected from the width direction, the height direction and the depth direction, a completion signal is sent after each dimension carrying is completed, and an external synchronization module synchronizes the completion signals of the channels to a consistent completion signal and sends the consistent completion signal to the next processing unit. ​

[0030] In one embodiment, the configuration of traditional DMA needs to configure the following information:

[0031] src_address data source start address;

[0032] dst_address data target start address;

[0033] transfer_number transfer number;

[0034] burst_number burst number (4, 8, 16, 32…);

[0035] number_type data type (8bit, 16bit, 32bit);

[0036] next_pointer next table item address.

[0037] In this configuration, when describing the tensor data transfer in three dimensions, a cube with three dimensions of length L, width W and height H needs to be described, and a single table item can describe the transfer of one dimension, such as length, and then WxH table items are linked together to complete the transfer of the cube. If a cube of L=100 W=100 H=100 is transferred, 10000 (WxH) table items are needed, each of which transfers L=100 numbers. When multiple DMAs transfer data using multiple configuration link tables, when a conflict occurs on the same memory bank, the low-priority DMA can only continue to transfer after the high-priority DMA transfer is completed.

[0038] In this embodiment, the configuration of DMA contains the following information:

[0039] src_address data source start address;

[0040] dst_address data target start address;

[0041] Number_type data type (8bit, 16bit, 32bit);

[0042] Line_skip row skip;

[0043] Height_skip height skip;

[0044] Height_number height;

[0045] Width_skip width skip;

[0046] Line_number Line number Width_number Width number

[0047] Scan_first: Scan direction of the first dimension, optional width, length or height;

[0048] Scan_second: Scan direction of the second dimension, optional width, length or height;

[0049] Only need to configure the above information, DMA will carry the tensor cube data from the specified direction, since each tensor cube is generally distributed on all the Memory Bank, when multiple DMA execute different configurations, will detect each time whether the transport will produce conflict in the same Memory Bank, if there is conflict, the low priority DMA will skip the data in this Bank, preferentially transport the data of the cube on the free Memory Bank, until the Bank of conflict is free, the low priority DMA will transport the previously skipped data to the target. Until all DMA are completed.

[0050] The application provides a multi-channel DMA method for tensor data transport, according to the length, width and height of a three-dimensional tensor data cube structure, setting a DMA channel parameter, describing the scanning direction of the three-dimensional structure and the required memory Bank number and automatically dividing the memory bandwidth. Through the three-dimensional tensor data transport in the application scheme, the link table structure is not needed, memory is saved, meanwhile, the multi-channel DMA can automatically skip the conflict Memory Bank to transport data and automatically synchronize the transport signal; according to the structure characteristics of the cube structure tensor data itself, the configuration of the DMA is simple and easy to understand, and the difficulty is reduced

[0051] The application discloses the basic principle and main features of the application and the advantages of the application. It should be understood by those skilled in the art that the application is not limited to the above-mentioned embodiments, and the above-mentioned embodiments and the description in the specification only illustrate the principle of the application. Without departing from the spirit and scope of the application, various changes and improvements can be made to the application, and these changes and improvements all fall within the scope of the application. The scope of protection of the application is defined by the appended claims and their equivalents.

Claims

1. A multi-channel DMA method for tensor data movement, characterized in that, The method comprises the following steps: DMA configuration, data stored in memory is regarded as a multi-dimensional tensor data structure, and DMA configuration is made based on the multi-dimensional tensor data structure, and the DMA configuration takes any one dimension of the multi-dimensional tensor data structure as a scanning direction; the multi-dimensional tensor data structure is a three-dimensional cubic structure, wherein the first dimension is composed of the number of single-row memory of a memory, regarded as the length of the cubic, the second dimension is composed of the number of rows of the memory, regarded as the width of the cubic, and the third dimension is composed of banks of the physical memory, regarded as the height of the cubic; Tensor data carrying, the DMA controller carries the tensor data according to the scanning direction in the DMA configuration; Memory bank conflict processing, the DMA configuration further comprises the number of required memory banks, when multiple DMAs execute different DMA configurations, it is detected whether conflict will occur on the same memory bank during each carrying, if there is conflict, the DMA with low priority skips the data on the bank, and the data of the cubic structure on the idle memory bank is preferentially carried until the conflicting memory bank is idle, and the DMA with low priority carries the previously skipped data to the target; Further comprising a memory bandwidth division step, multiple DMAs automatically negotiate memory bandwidth division according to DMA configuration information; each DMA physical channel can be shared by multiple DMA configurations, and multiple DMA configurations independently carry according to requirements; The DMA configuration further comprises: Line_skip, row skip; Line_number, row number; Height_skip, height skip; Height_number, height; Width_skip, width skip; Width_number, width.

2. The multi-channel DMA method for tensor data movement according to claim 1, wherein, The scanning direction comprises: Scan_first, the scanning direction of the first dimension, which can be width, length or height; Scan_second, the scanning direction of the second dimension, which can be width, length or height.

3. The multi-channel DMA method for tensor data movement according to claim 1, wherein, The DMA carrying mode comprises scanning carrying from the length direction, the width direction or the height direction, a completion signal is sent after each dimension carrying is completed, and an external synchronization module synchronizes the completion signals of the DMA channels into a consistent completion signal and sends the consistent completion signal to a next processing unit.

Citation Information

Patent Citations

  • Multichannel direct memory access (DMA) controller

    CN103793342A

  • Apparatus and method for coherent, accelerated conversion between data representations

    CN110659129A