New patent application published for: COMPUTING CHIPLET AND ELECTRONIC DEVICE
COMPUTING CHIPLET AND ELECTRONIC DEVICE
Abstract
The present disclosure relates to a data processing method and apparatus, an electronic device, and a storage medium. The method includes: on the basis of tensor information of a first tensor and access information of a second tensor to be accessed, determining address information of said second tensor, and on the basis of the address information of said second tensor, reading said second tensor from a global memory storing the first tensor into a local memory; and in response to the local memory receiving said second tensor, triggering an interrupt. The embodiments of the present disclosure can improve the efficiency and flexibility of tensor storage, and each time the local memory receives the second tensor, an interrupt can be triggered, achieving asynchronization of the tensor reading process.
Inventors:
GAO; Kun (Beijing, CN), WEN; Si (Beijing, CN), LI; Xiaosen (Beijing, CN)
Applicant:
Moore Threads Technology Co., Ltd. (Beijing, CN)
Family ID:
1000009520929
Appl. No.:
19/721337
Filed:
June 26, 2026
Claims
1. A data processing method, comprising: determining, based on tensor information of a first tensor and access information of a second tensor to be accessed, address information of the second tensor, wherein the second tensor includes any one of: block data of the first tensor, coverage data in the first tensor corresponding to any one or more elements of convolution kernel, data constituted by coverage data and constant value padding between individual elements in the coverage data, the tensor information of the first tensor includes data structure information of the first tensor and address information of the first tensor; reading, based on the address information of the second tensor, the second tensor from a global memory storing the first tensor to a local memory; and triggering an interrupt in response to the local memory receiving the second tensor.
2. The method according to claim 1, wherein in a case where the second tensor to be accessed is a block data of the first tensor, the access information comprises: a position of the second tensor in the first tensor; and a size of the second tensor, determining, based on tensor information of a first tensor and access information of a second tensor to be accessed, address information of the second tensor, comprising: determining, based on the tensor information of the first tensor, the position of the second tensor in the first tensor, and the size of the second tensor, the address information of the second tensor from addresses of the first tensor.
3. The method according to claim 2, further comprising: performing, based on the tensor information of the first tensor and the access information of the second tensor to be accessed, boundary checking on the second tensor, to obtain a checking result for the second tensor; and in a case where the checking result indicates that a first part of the second tensor is located inside the first tensor and a second part of the second tensor is located outside the first tensor, determining, based on the tensor information of the first tensor and the access information of the second tensor, address information of the first part of the second tensor, wherein the tensor information of the first tensor includes padding identifiers, and reading, based on the address information of the second tensor, the second tensor from a global memory storing the first tensor to a local memory, comprising: reading, based on the address information of the first part of the second tensor, the first part of the second tensor from the global memory storing the first tensor to the local memory; padding, based on the padding identifier, the second part of the second tensor, to obtain the second part of the second tensor; and writing the second part of the second tensor into the local memory.
4. The method according to claim 1, wherein in a case where the second tensor to be accessed is coverage data in the first tensor corresponding to any one or more elements in a convolution kernel, the access information comprises: an expanded matrix coordinate and a convolution kernel element coordinate, the expanded matrix being a matrix that is arranged in rows or columns by sequentially converting, in the first tensor, the coverage data corresponding to a receptive field of the convolution kernel into corresponding column vectors or row vectors based on description information, the description information comprising convolution description information and deconvolution description information, and determining, based on tensor information of a first tensor and access information of a second tensor to be accessed, address information of the second tensor, comprising: obtaining a mapping relationship between the expanded matrix and the first tensor; and determining, based on the tensor information of the first tensor, the mapping relationship, the expanded matrix coordinate, and the convolution kernel element coordinate, the address information of the second tensor from addresses of the first tensor.
5. The method according to claim 4, wherein determining, based on the tensor information of the first tensor, the mapping relationship, the expanded matrix coordinate, and the convolution kernel element coordinate, the address information of the second tensor from addresses of the first tensor, comprising: determining, based on the expanded matrix coordinate and the convolution kernel element coordinate, the second tensor to be accessed from the expanded matrix; determining, based on the mapping relationship between the expanded matrix and the first tensor, a plurality of elements in the first tensor corresponding to the second tensor; and determining address information of the plurality of elements in the first tensor corresponding to the second tensor as the address information of the second tensor.
6. The method according to claim 1, wherein reading, based on address information of the second tensor, the second tensor from a global memory storing the first tensor to a local memory, comprising: in a case where a size of the second tensor is greater than a read bandwidth, based on the address information of the second tensor, splitting a first memory access request for reading the second tensor from the global memory to the local memory into a plurality of second memory access requests, wherein each second memory access request is used to read split data of a different part of the second tensor from the global memory to the local memory; and based on the plurality of second memory access requests, writing serially a plurality of split data in the global memory that constitute the second tensor into the local memory.
7. The method according to claim 1, wherein the tensor information of the first tensor is stored in the global memory and the access information of the second tensor to be accessed is stored in a register.
8. The method according to claim 1, wherein the first tensor comprises feature data in a deep learning task, and the feature data comprises at least one of image feature data, speech feature data, or text feature data.
9. An electronic device, comprising: a processor; and a memory, the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to: determine, based on tensor information of a first tensor and access information of a second tensor to be accessed, address information of the second tensor, wherein the second tensor includes any one of: block data of the first tensor, coverage data in the first tensor corresponding to any one or more elements of convolution kernel, data constituted by coverage data and constant value padding between individual elements in the coverage data, the tensor information of the first tensor includes data structure information of the first tensor and address information of the first tensor; read, based on the address information of the second tensor, the second tensor from a global memory storing the first tensor to a local memory; and trigger an interrupt in response to the local memory receiving the second tensor.
10. A non-transitory computer program product, comprising a computer readable code or a computer readable storage medium carrying the computer readable code, wherein when the computer readable code runs in a processor of an electronic device, the processor in the electronic device is configured to: determine, based on tensor information of a first tensor and access information of a second tensor to be accessed, address information of the second tensor, wherein the second tensor includes any one of: block data of the first tensor, coverage data in the first tensor corresponding to any one or more elements of convolution kernel, data constituted by coverage data and constant value padding between individual elements in the coverage data, the tensor information of the first tensor includes data structure information of the first tensor and address information of the first tensor; read, based on the address information of the second tensor, the second tensor from a global memory storing the first tensor to a local memory; and trigger an interrupt in response to the local memory receiving the second tensor.
- Company
- Moore Threads Technology Co., Ltd.
- Keywords
- G06F3/0655, G06F3/0613, G06F3/0679