Device and method for storing data and device for performing grouped convolution operation
By directly implementing data channel shuffling and storage at the hardware level, the problem of low efficiency caused by CPU/BPU intervention in the existing technology is solved, the processing efficiency of shuffled network data is improved, the instruction sequence is simplified, and the processor burden is reduced. .
Patent Information
- Application Number
- CN201910777752.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-21
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2039-08-21
AI Technical Summary
Existing technologies require the intervention of a central processing unit (CPU) or a brain processor (BPU) when processing shuffled network data, resulting in low channel shuffling and storage efficiency, which affects the acceleration efficiency of convolution operations.
By designing a device for storing data, including a control unit, a reading unit, an addressing unit and a writing unit, the channel shuffling and storage of data are directly implemented at the hardware level, avoiding the intervention of the CPU/BPU and software. Using this device Data alignment is used when reading and writing data in the memory to improve operating efficiency.
It achieves efficient data channel shuffling and storage, simplifies the software instruction sequence, reduces the burden on the CPU/BPU, improves processing efficiency, and improves the operating efficiency of convolution operations.
Smart Images

Figure CN112418413B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the technical field of artificial intelligence, and in particular to a device and method for storing data and a device for performing a grouped convolution operation. Background Art
[0002] The Shuffle Net is an efficient convolutional neural network model for terminals with limited computing power and strict power consumption requirements (e.g., mobile terminals). It promotes the flow of information between channels through channel shuffle based on the design concept of sparse connections such as group convolution. Summary of the invention
[0003] According to one aspect of the present disclosure, a device for storing data is provided. The device may include: a control unit configured to determine a first address of a specified tensor of at least two tensors in a first memory; a reading unit configured to read at least a portion of the data of the specified tensor on a specified channel from the first memory according to the first address; an addressing unit configured to determine a second address of the at least a portion of the data in a second memory according to an index of the specified channel indicated by the control unit in a set of all channels of the at least two tensors; and a writing unit configured to write the at least a portion of the data to the second address of the second memory.
[0004] According to another aspect of the present disclosure, a device for performing grouped convolution operations is also provided. The device may include a convolution operation circuit and the above-mentioned device for storing data.
[0005] According to another aspect of the present disclosure, a method for storing data is also provided. The method may include: determining a first address of a specified tensor of at least two tensors in a first memory; reading at least a portion of the data of the specified tensor on a specified channel from the first memory according to the first address; determining a second address of the at least a portion of the data in a second memory according to an index of the specified channel in a set of all channels of the at least two tensors; and writing the at least a portion of the data to the second address of the second memory.
[0006] According to another aspect of the present disclosure, a computer-readable storage medium is provided. The storage medium stores a computer program, and the computer program can be used to execute the above method.
[0007] According to another aspect of the present disclosure, an electronic device is further provided. The electronic device may include a processor and a memory for storing processor executable instructions, wherein the processor may be used to read the executable instructions from the memory and execute the executable instructions to implement the above method.
[0008] The device for storing data according to an embodiment of the present disclosure allows channel shuffling and storage of data to be implemented directly through hardware without the intervention of other processors or controllers such as a central processing unit (CPU) or a brain processing unit (BPU) and other software intervention, thereby improving the operational efficiency of channel shuffling and storage of data, and also simplifying the software instruction sequence and reducing the burden on processors or controllers such as the CPU / BPU. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0010] Figure 1 Examples of tensor data and examples of contiguous storage of tensor data are shown.
[0011] Figure 2 An example of a device for storing data according to an embodiment of the present disclosure is shown.
[0012] Figure 3 An example of a control unit in a storage device according to an embodiment of the present disclosure is shown.
[0013] Figure 4 An example of a device for storing data according to an embodiment of the present disclosure is shown.
[0014] Figure 5 An example of an apparatus for performing a grouped convolution operation according to an embodiment of the present disclosure is shown.
[0015] Figure 6 An example of a method of storing data according to an embodiment of the present disclosure is shown.
[0016] Figure 7 An example of a method of storing data according to an embodiment of the present disclosure is shown.
[0017] Figure 8 An example of an electronic device according to the present disclosure is shown. DETAILED DESCRIPTION
[0018] Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0019] Overview
[0020] In a common solution for processing shuffled network data, a CPU or a BPU is often used to process the channel shuffling operation. For example, the CPU or the BPU executes a predetermined program instruction so that the CPU or the BPU can read data from a memory, perform channel rearrangement / channel shuffling on the read data, and write the channel rearranged / channel shuffled data back into the memory. That is, in a common processing solution, the CPU / BPU and / or software intervention is required to implement channel shuffling, so the processing efficiency is not high.
[0021] In addition, conventional neural network accelerators are often designed to accelerate traditional convolution operations. As the processing object of the convolution operation, tensor data (also called feature data or feature map) can generally correspond to linear data, plane data, data cube or multidimensional data with one or more dimensions such as height, width, depth (i.e., number of channels) and quantity, and are stored in the memory in a continuous storage manner.
[0022] For example, Figure 1 As shown above the arrow in , an exemplary tensor data can be represented by a data cube with a height of 3, a width of 3, and a depth (number of channels) of 3, where each small cubic block (e.g., P 1,1,1 , P 1,2,1 etc.) represents a data point in the data cube. Figure 1 As shown, each data point may have a corresponding index or coordinate according to its corresponding height value, width value and depth value (i.e., the number of the channel in which it is located). For example, if it is specified that the H direction (i.e., the height direction) starts from the origin O and follows the corresponding arrow vertically downward along the drawing, the W direction (i.e., the width direction) starts from the origin O and follows the corresponding arrow horizontally to the right along the drawing, and the C direction (i.e., the channel direction) starts from the origin O and follows the corresponding arrow vertically to the drawing, then an example of the index or coordinate of each data point in the data cube may be as follows: Figure 1 shown.
[0023] like Figure 1 As shown below the arrow, the data points P on the three channels with the same height and width values 1,1,1 , P 1,1,2 and P1,1,3 are stored continuously in memory, and immediately after P 1,1,3 The data points P on the three channels with the same height and width are stored continuously. 1,2,1 , P 1,2,2 , P 1,2,3 ; and so on, until P 3,3,1 , P 3,3,2 and P 3,3,3 are stored continuously in memory.
[0024] According to this continuous storage method, the reading and writing of data will be discontinuous when the channels are shuffled, thus resulting in a significant reduction in the efficiency of data reading and writing, and affecting the operating efficiency of the entire convolution operation accelerator.
[0025] The technical solution disclosed in the present invention aims to solve or alleviate at least a part of the above-mentioned technical problems.
[0026] Exemplary Devices
[0027] Figure 2 An example of a device for storing data according to an embodiment of the present disclosure is shown. Figure 2 As shown, the device DEV comprises a control unit CU, a read unit RU, an addressing unit AU and a write unit WU.
[0028] The control unit CU may be configured to determine at least two tensors T 1 To T n (n is a natural number greater than or equal to 2) r (r is any natural number less than or equal to n) in the first memory M 1 The first address A in r .like Figure 1 As shown, from the first memory M 1 The first address A in r Start by storing the specified tensor T continuously. r In each channel C r,0 To C r,m (m is any natural number) on which some data D r,0 To D r,m .
[0029] The read unit RU may be configured to read the first address A according to the first address A. r , from the first memory M 1 At least read the specified tensor T 1 In the specified channel C r,s (s is any natural number less than or equal to m) r,s At least part of {D r,sAccording to different embodiments, the reading unit RU can read the tensor T each time. r The complete data, including the tensor T r In channel C r,0 Data on D r,0 , ..., in the specified channel C r,s Data on D r,s , ..., in channel C r,m Data on D r,m ; The reading unit RU can also read the tensor T each time r The data included in D r,s For example, read D r,s and D r,s+1 (not shown); the reading unit RU can also read the data D each time r,s Then read the complete data D multiple times to obtain the complete data r,s .
[0030] The addressing unit AU may be configured to address a specific channel C according to instructions from the control unit CU. r,s In the aforementioned at least two tensors T 1 To T n The set of all channels of i,j |i is a natural number less than or equal to n, j is a natural number less than or equal to m} r,s , determine at least part of the aforementioned data D r,s In the second memory M 2 The second address A' r’ .
[0031] The write unit WU is configured to write at least a portion of the aforementioned data D r,s Write to the second memory M 2 The second address A' r’ Place.
[0032] In each read and write operation of the device DEV, the read unit RU reads the first address A determined by the control unit CU. r , from the first memory M 1 Read at least the specified tensor T r In the specified channel C r,s Then, the write unit WU writes at least a portion of the data read by the read unit RU to the second memory M. 2 The second address A' r’ Where, the second address A' r’ It is determined by the addressing unit AU in the device DEV.
[0033] For example, for the data stored in the first memory M1 The tensor data T in 1 To T n , the control unit CU can determine each designated tensor in the order from 1 to n, and then instruct the reading unit RU to read the data of the current designated tensor in a data-aligned manner. For the current designated tensor read by the reading unit RU, the designated channel can be determined in the order from 1 to m, and then the data of the designated channel can be written to the second memory M via the writing unit WU, for example, in a data-aligned manner. 2 Thus, through multiple data reading and writing, the device DEV stores the data in the first memory M. 1 The tensor T in 1 To T n The channels are shuffled and rearranged, and stored in the second memory M again. 2 In which, the first memory M 1 The tensor T in r Part of the data D r,s Finally, it is stored in the second memory M 2 The second address A' r’ Place.
[0034] In this process, the device DEV completes the reading, shuffling and writing of channel data through its own hardware without the intervention of other CPU / BPU and / or software. Moreover, in this process, data can be read and written in a data-aligned manner, so that higher access efficiency can be obtained, thereby ensuring that the device DEV can have higher processing efficiency.
[0035] It should be understood that the actual operation process of the device DEV may not be limited to the above reference Figure 1 Described example. Depending on the desired shuffling strategy, the device DEV may implement channel shuffling of tensor data in any other appropriate control manner.
[0036] According to different embodiments, the control unit CU may be any suitable processor or controller developed based on, for example, a field programmable gate array or any other suitable circuit / component / module. Figure 3 As shown, the control unit CU may include a first counter CNT 1 , the second counter CNT 2 and the third counter CNT 3 and calculator cal.
[0037] For example, the first counter CNT 1 In response to a predetermined enable signal CU EN The new count value is provided to the second counter CNT. 2, and wait for the second counter CNT 2 Feedback to continue counting.
[0038] The second counter CNT 2 In response to the first counter CNT 1 The new count value is used to restart the counting, and when a predetermined maximum count value (for example, the maximum number of channels m for each tensor data mentioned above) is reached, the first counter CNT is counted. 1 Provide feedback.
[0039] On the other hand, the first counter CNT 1 The count value is also provided to the calculator CAL, and then the calculator CAL can calculate the count value according to the value from the first counter CNT. 1 The count value is used to calculate the first address A r For example, the calculator CAL may include a multiplier and is configured to convert the value from the first counter CNT 1 The count value is multiplied by each tensor data in the first memory M 1 The amount of storage space occupied by the .
[0040] The third counter CNT 3 In response to a predetermined enable signal CU EN and starts counting, and can have a second counter CNT 2 The same counting frequency makes the third counter CNT 3 The count value of can correspond to the specified tensor (according to the first counter CNT 1 The designated channel (determined by the count value of the second counter CNT 2 The count value determines the index ID in the set of all channels r,s .
[0041] like Figure 3 As shown, the first counter CNT 1 and the third counter CNT 3 It can also respond to the disable signal CU DIS In another embodiment, the counting can also be stopped according to the first memory M 1 The number of tensor data stored in and the number of channels of each tensor data determine the first to third counters CNT 1 、CNT 2 and CNT 3 The maximum count value of at least one counter in the first counter CNT 1 and the third counter CNT 3 The counting can be automatically stopped according to the corresponding maximum count value, so that the prohibition signal CU can be omitted. DIS .
[0042] It should be understood that Figure 3 This is only one example of the control unit CU. The control unit CU in the device DEV may not be limited to the above example. For example, instead of setting the third counter CNT 3 , you can also set another calculator, or use CAL, according to the first counter CNT 1 and the second counter CNT 2 The count value is used to calculate the index ID r,s .
[0043] According to different embodiments, the read unit RU may be a first memory M 1 The access controller may be independent of the first memory M 1 And can be used to control the first memory M 1 Any suitable circuitry for reading data.
[0044] Similarly, the write unit WU may be a second memory M 2 The access controller may be independent of the second memory M 2 And can be used to control the second memory M 2 Any suitable circuitry for writing data into the
[0045] According to different embodiments, the addressing unit AU may be developed based on, for example, a field programmable gate array or any other appropriate circuit / component / module, which can be used to address the address according to the index ID from the control unit. r,s To determine the second memory M 2 The second address A' r’ Any appropriate processor or controller can be used to meet the requirements of different channel shuffling strategies.
[0046] In one embodiment, the second address A' r’ can depend on the specified channel C r,s Index ID r,s Accordingly, in this embodiment, the addressing unit AU may be configured to determine the inverse sequence of the bit sequence corresponding to the binary value of the specified channel C. r,s Index ID r,s The inverse sequence of the bit sequence corresponding to the binary value ... r’ .
[0047] For example, suppose the tensor T 1 To T n There are 16 channels in total, specifying the tensor T r Designated channel C r,sIndex ID r,s is 13, and the corresponding binary value is 1101, and the inverse sequence of the corresponding bit sequence is 1011. Therefore, the addressing unit AU can determine the second address A' according to the binary data 1011. r’ , for example, you can directly use it as the second address A ' r’ , it can also be used to perform a predetermined calculation (eg, multiplication) with a predetermined base (eg, the size of each tensor data), and determine the second address A' according to the obtained calculation result r’ , and can also be based on various possible binary data and the second memory M 2 The predetermined mapping relationship between the addresses in the binary data 1011 determines the second address A' r’ For example, when the binary data corresponding to each reverse sequence is very scattered, each second address can be determined according to a predetermined mapping relationship or conversion relationship (for example, an order relationship determined according to the reverse sequence) so that the data of each channel can be centrally stored in the second memory M. 2 middle.
[0048] In this embodiment, the addressing unit AU may be a processor or controller developed based on, for example, a field programmable gate array or any other appropriate circuit / component / module. In another embodiment, the addressing unit AU may also include one or more logic gate elements and a shift register to obtain the inverse sequence of the bit sequence of the specified binary value. In another embodiment, the addressing unit AU may include a memory for storing the index ID r,s The addressing unit AU may further include a device such as a calculator (eg, a multiplier) and the like.
[0049] Use and specify channel C r,s Index ID r,s The inverse sequence of the bit sequence corresponding to the binary value of the address unit AU enables the address unit AU to efficiently and quickly determine the second address A' through a simple control logic and / or circuit structure. r’ , and can ensure a good channel shuffle effect. For example, assuming there are 16 channels in total, only the tensor T 1 Channel C in 1,1 , C 1,2 , C 1,3 , C 1,3 And the tensor T 2 Channel C in 2,1 , C 2,2 , C 2,3 , C2,3 For example, its index ID 1,1 、ID 1,2 、ID 1,3 、ID 1,4 and ID 2,1 、ID 2,2 、ID 2,3 、ID 2,4 can be 0, 1, 2, 3, 4, 5, 6, 7 respectively (in other examples, the index values can also be other appropriate values, such as 1, 2, 3, 4, 5, 6, 7, 8, etc.), and the corresponding inverse sequences are 0000, 1000, 0100, 1100, 0010, 1010, 0110, 1110 respectively. So, the tensor T 1 Channel C in 1,1 , C 1,2 , C 1,3 , C 1,3 Data on D 1,1 , D 1,2 , D 1,3 , D 1,3 And the tensor T 2 Channel C in 2,1 , C 2,2 , C 2,3 , C 2,3 Data on D 2,1 , D 2,2 , D 2,3 , D 2,3 In the second memory M 2 The storage order will become D 1,1 , D 2,2 , D 1,3 , D 2,3 , D 1,2 , D 2,2 , D 1,3 , D 2,3 , thus obtaining a good channel shuffling effect.
[0050] In one embodiment, the number of bits in the above bit sequence may depend on the tensor T 1 To T n For example, assuming there are 5 tensor data, that is, n=4, and each tensor data has 4 channels, that is, m=4, then the total number of all channels is n*m=20. Based on this total number of channels. For example, the number of bits in the above bit sequence can be greater than or equal to 5 (2 5 =32>20), such as 5, 8, 16, 32, 64, etc. For example, The number of bits in the bit sequence may be determined by using the result of . Other methods may also be used to determine the number of bits in the bit sequence, as long as the number of bits is sufficient to represent the indexes of all channels.
[0051] Generally speaking, for general or specific-purpose convolutional neural networks, the maximum value of the total number of channels can usually be predicted or determined in advance. Therefore, determining the number of bits based on the total number of all channels of the tensor can provide a reference for hardware design so that hardware components (e.g., registers) with appropriate number of bits or precision can be selected, so that the hardware can handle various situations in a simple and consistent manner, thereby ensuring that the device DEV has high processing performance.
[0052] like Figure 4 As shown, in one embodiment, the device DEV may further include a signal generating unit SU. The signal generating unit SU may be configured to generate a signal after determining that the tensor T is processed. 1 To T n Signals the end of channel shuffling for all tensors in .
[0053] exist Figure 4 In the example, the signal generating unit SU may respond to a signal from the control unit CU (eg, the prohibition signal CU in the previous example). DIS ) and sends a signal indicating the end of rearrangement. For example, in the above text including the third counter CNT 3 In the case of a control unit CU, the control unit CU can be configured to use a third counter CNT 3 When counting stops, a signal is sent to the signal generating unit SU. The signal generating unit SU can respond to the signal from the control unit CU, for example, when it is detected that the reading unit RU and the writing unit WU are not operating, or further respond to receiving the operation end signal from the reading unit RU and / or the writing unit WU and / or the addressing unit AU, etc., to send a signal indicating the end of the rearrangement.
[0054] Thus, other devices or components connected to the device DEV (for example, an array of multiplication and addition units for convolution operations, etc.) can start or continue operation in response to a signal indicating the end of channel rearrangement, so that the device DEV can operate in coordination with other devices or components (for example, an array of multiplication and addition units for convolution operations, etc.) to complete any desired functions such as convolution operations.
[0055] For example, Figure 4A device DEV′ for performing a grouped convolution operation according to an embodiment of the present disclosure is shown, and the device may include a convolution operation circuit CC and the device DEV in the above example. The convolution operation circuit CC may include a multiplication-addition unit array and may perform a convolution operation (e.g., a grouped convolution operation). The convolution operation circuit CC may provide each tensor data obtained by the operation to the device DEV so as to be stored in a first memory M in the device DEV. 1 In the example, each tensor data obtained by the operation can also be stored in the first memory M 1 Then, the device DEV may perform the channel rearrangement operation, and after the channel rearrangement is completed, a signal indicating the completion of the channel rearrangement is transmitted to the convolution operation circuit CC, so that the convolution operation circuit CC can perform the operation according to the data processed by the device DEV and stored in the second memory M. 2 Perform further operations / calculations on the data in.
[0056] exist Figure 1 In the example of 1 and the second memory M 2 is shown as being independent of the device DEV. In another embodiment, the first memory M 1 and the second memory M 2 At least one of the first memory M may also be included in the device DEV, for example 1 The second memory M is formed integrally with the reading unit RU, or the second memory M is formed integrally with the reading unit RU. 2 The first memory M is integrally formed with the write unit WU. According to different embodiments, the first memory M 1 and the second memory M 2 The first memory M may be two physically separated blocks or two groups of memories, or may be two different storage areas in a storage space defined by the same physical memory or the same group of physical memories. 1 and / or a second memory M 2 It may be any suitable type of memory having any suitable capacity, such as static random access memory, dynamic random access memory, flash memory or the like.
[0057] As described above, in each read and write operation of the device DEV, the reading unit RU reads the first address A determined by the control unit CU. r , from the first memory M 1 Read at least the specified tensor T r In the specified channel C r,s Then, the write unit WU writes at least a portion of the data read by the read unit RU to the second memory M. 2The second address A' r’ Where, the second address A' r’ It is determined by the addressing unit AU in the device DEV. In this process, the device DEV completes the reading, shuffling and writing of channel data through its own hardware without the intervention of another CPU / BPU and / or software. Moreover, in this process, data can be read and written in a data-aligned manner, so that higher access efficiency can be obtained, thereby ensuring that the device DEV can have higher processing efficiency.
[0058] Exemplary Methods
[0059] Figure 6 An example of a method for storing data according to an embodiment of the present disclosure is shown. In one embodiment, the method may be performed by the above-mentioned device DEV, or may correspond to an example of an operation process of the above-mentioned device DEV.
[0060] like Figure 6 As shown, the method may include:
[0061] S110, determine at least two tensors T 1 To T n The specified tensor T in r In the first memory M 1 The first address A in r ;
[0062] S120, according to the first address A r , from the first memory M 1 At least read the specified tensor T 1 In the specified channel C r,s Data on D r,s At least part of {D r,s};
[0063] S130, specify channel C r,s In the aforementioned at least two tensors T 1 To T n The set of all channels of i,j |i is a natural number less than or equal to n, j is a natural number less than or equal to m} r,s , determine at least part of the aforementioned data D r,s In the second memory M 2 The second address A' r ;as well as
[0064] S140, at least a portion of the aforementioned data D r,s Write to the second memory M 2 The second address A' r’ Place.
[0065] In one embodiment, the second address A' r can depend on the specified channel C r,s Index ID r,s In one embodiment, the number of bits in the bit sequence depends on the tensor T 1 To T n The total number of all channels.
[0066] like Figure 7 As shown, in one embodiment, the method may further include: step S150, controlling the signal generating unit to determine that the tensor T is processed 1 To T n Signals the end of channel shuffling for all tensors in .
[0067] According to the method according to the embodiment of the present disclosure, in each read and write operation, according to the first address A determined by the control unit CU r , from the first memory M 1 Read at least the specified tensor T r In the specified channel C r,s Then, at least a portion of the data read by the read unit RU is written into the second memory M. 2 The second address A' r’ In this process, no additional CPU / BPU and / or software intervention is required, and data can be read and written in a data-aligned manner, thereby achieving higher access efficiency and processing efficiency.
[0068] Exemplary Electronic Devices
[0069] Figure 8 An example of an electronic device according to an embodiment of the present disclosure is shown.
[0070] like Figure 8 As shown, the electronic device ED includes the device DEV according to the embodiment of the present disclosure as described above.
[0071] In addition, the electronic device ED may also include one or more additional processors (not shown), which may be central processing units (CPUs) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device ED to perform desired functions and / or cooperate with the device DEV to achieve desired functions.
[0072] like Figure 8As shown, the electronic device ED may further include a memory STR. The memory STR may store one or more computer program products and may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0073] The device DEV or the aforementioned other one or more processors may read and execute one or more computer program instructions stored in, for example, STR to implement the methods of the various embodiments of the present disclosure described above and / or other desired functions.
[0074] like Figure 8 As shown, in some embodiments, the electronic device ED may also include an input device INP and an output device OUTP, wherein these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown). According to different embodiments, the input device INP may include, for example, a keyboard, a mouse, etc., and the output device OUTP may include, for example, a display, a speaker, a printer, and a communication network and a remote output device connected thereto, etc., so as to output various information to the outside.
[0075] To simplify, Figure 8 Only some exemplary components in the electronic device ED are shown, and other components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device ED may also include any other appropriate components.
[0076] Exemplary computer program products and computer-readable storage media
[0077] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.
[0078] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, and the programming language may include an object-oriented programming language, such as Java, C++, etc., and a conventional procedural programming language, such as "C" or a similar programming language. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0079] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium, such as a computer-readable non-temporary storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the processor executes the steps in the method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0080] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0081] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0082] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0083] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0084] In this document, modifiers such as "first", "second", etc. without quantifiers are intended to distinguish different elements / components / circuits / modules / devices / steps, and are not used to emphasize the order, positional relationship, importance, priority, etc. In contrast, modifiers such as "first", "second", etc. with quantifiers can be used to emphasize the order, positional relationship, importance, priority, etc. of different elements / components / circuits / modules / devices / steps.
[0085] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0086] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A device for storing data for channel shuffling, comprising: a control unit configured to determine a first address of a designated tensor of at least two tensors in a first memory, each of the at least two tensors having a number of channels; a reading unit, configured to read at least a portion of data of the specified tensor on a specified channel from the first memory according to the first address; an addressing unit configured to determine a second address of the at least a portion of the data in the second memory according to an index of the designated channel indicated by the control unit in a set of all channels of the at least two tensors; as well as A writing unit is configured to write the at least a portion of the data to the second address of the second memory.
2. The device according to claim 1, wherein: The second address depends on the inverse sequence of a bit sequence corresponding to the binary value of the index of the specified channel.
3. The device according to claim 2, wherein: The number of bits in the bit sequence depends on the total number of all channels of the at least two tensors.
4. The device according to any one of claims 1 to 3, further comprising: The signal generating unit is configured to generate a signal indicating that the channel rearrangement is completed when it is determined that all tensors in the at least two tensors have been processed.
5. An apparatus for performing a grouped convolution operation, comprising: Convolution operation circuit; as well as A device according to any one of claims 1 to 4.
6. A method for storing data for channel shuffling, comprising: Determine a first address of a specified tensor of at least two tensors in a first memory, each of the at least two tensors having a number of channels; Read at least a portion of data of the specified tensor on a specified channel from the first memory according to the first address; Determine a second address of the at least a portion of the data in a second memory according to an index of the designated channel in a set of all channels of the at least two tensors; as well as The at least a portion of the data is written to the second address of the second memory.
7. The method according to claim 6, wherein: The second address depends on the inverse sequence of a bit sequence corresponding to the binary value of the index of the specified channel.
8. The method according to claim 7, wherein: The number of bits in the bit sequence depends on the total number of all channels of the at least two tensors.
9. The method according to any one of claims 6 to 8, further comprising: The signal generating unit is controlled to generate a signal indicating that the channel rearrangement is completed when it is determined that all tensors in the at least two tensors have been processed.
10. A computer-readable storage medium storing a computer program for executing the method according to any one of claims 6 to 9.
11. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory, and execute the executable instructions to implement the method according to any one of claims 6 to 9.
