Convolutional Neural Network Operations
Dual dot product instructions on SIMD units concurrently execute convolution and transition operations in CNNs, addressing the inefficiency of transition operations and improving processing efficiency.
Patent Information
- Application Number
- JP2024518136
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-09-29
- Filing Date
- 2022-09-16
- Publication Date
- 2024-09-12
AI Technical Summary
Transition operations in multi-layer processing architectures, such as convolutional neural networks (CNNs), consume significant time compared to computational operations, necessitating techniques to enhance execution efficiency.
Implementing dual dot product instructions executed simultaneously on SIMD units, which perform convolution and transition operations in a single computer cycle, utilizing vector general-purpose registers (VGPRs) to store and access data across lanes for parallel execution.
Significantly reduces the computational time required for transition operations by performing convolution and transition steps concurrently, enhancing the overall efficiency of CNN processing.
Smart Images

Figure 2024533636000001
Abstract
Description
[Technical field]
[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Patent Application No. 17 / 489,734, filed September 29, 2021, and is incorporated by reference as if fully set forth herein. [Background technology]
[0002] Various computational tasks involve the processing of multi-dimensional data in multiple stages. For example, a convolutional neural network (CNN) is typically composed of an architecture of multiple layers. At each layer, a computational operation, such as a convolution operation on an input image, may be applied to the input of the layer. In such cases, the resulting convolved image (or intermediate image) may be further processed by transitional operations to generate the output of the layer. The transitional operations may include reformatting, rectifying, and / or clamping the intermediate image to prepare it for processing by the next layer. However, these transitional operations consume a significant amount of time relative to the time it takes to perform the computational operation itself (e.g., a convolution). Techniques are needed to increase the efficiency of the execution of the transitional operations used by multi-layer processing architectures.
[0003] A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings, in which: [Brief description of the drawings]
[0004] [Figure 1A] 1 is a block diagram of an example device according to which one or more features of the present disclosure may be implemented. [Figure 1B] 1B is a block diagram of an example system illustrating an accelerator usable by the device of FIG. 1A, according to which one or more features of the present disclosure may be implemented. [Diagram 2] FIG. 1 illustrates an example dot product operation performed by a lane of a wave in a single instruction, multiple data (SIMD) unit, according to which one or more features of the present disclosure may be implemented. [Diagram 3] FIG. 1 illustrates an example layer process of a CNN, according to which one or more features of the present disclosure may be implemented. [Figure 4] FIG. 5 illustrates an example dual dot product instruction including a folding operation (FIG. 4) and a transition operation (FIG. 5) according to which one or more features of the present disclosure may be implemented. [Diagram 5] 5A-5C illustrate example dual dot product instructions including a folding operation (FIG. 4) and a transition operation (FIG. 5) according to which one or more features of the present disclosure may be implemented. [Figure 6] FIG. 1 illustrates an example dot product operation performed by a lane of a wave in a SIMD unit, according to which one or more features of the present disclosure may be implemented. [Figure 7] FIG. 13 illustrates another example dual dot product instruction, according to which one or more features of the present disclosure may be implemented. [Figure 8] 1 is a flowchart of an example method for application of a dual dot product instruction, according to which one or more features of the present disclosure may be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0005] Disclosed herein are systems and methods that use transition operations, e.g., dot product operations including convolution operations applied to input data of a layer of a CNN to generate a layer output of the CNN. The dot product instructions disclosed herein may be executed simultaneously on two elements of input data to generate dual output data, i.e., dual dot product instructions. The dual dot product instructions may be executed in one computer cycle and may be executed by lanes of waves executed in parallel by a SIMD unit. These lanes utilize vector general purpose registers (VGPRs) to store data required for the execution of their respective dot product instructions. As disclosed herein, each lane may also access data stored in the VGPR of another lane to execute the dot product instruction.
[0006] Aspects disclosed herein describe a method for performing operations on a SIMD unit. The method may include loading, by a lane of a wave executing on the SIMD unit, input data into a VGPR of the lane, and then performing, by the lane, a dot product operation to generate output data during one computer cycle. The performed dot product operation may include convolving a data element of the input data to generate an intermediate data element, and applying one or more transition operations to the intermediate data element to generate an output data element of the output data. The method may further include performing, by the lane, a second dot product operation during one computer cycle. The second dot product operation may include convolving a second data element of the input data to generate a second intermediate data element, and applying one or more transition operations to the second intermediate data element to generate a second output data element of the output data.
[0007] Also, aspects disclosed herein describe a circuit for performing operations on a SIMD unit. The circuit may include at least one processor and a memory that stores instructions. The instructions, when executed by the at least one processor, may cause the circuit to load, by a lane of a wave executing on the SIMD unit, input data into a VGPR of the lane, and perform, by the lane, a dot product operation in one computer cycle to generate output data. The dot product operation performed may include convolving a data element of the input data to generate an intermediate data element, and applying one or more transition operations to the intermediate data element to generate an output data element of the output data. Furthermore, the instructions may cause the circuit to perform, by the lane, a second dot product operation in one computer cycle. The second dot product operation may include convolving a second data element of the input data to generate a second intermediate data element, and applying one or more transition operations to the second intermediate data element to generate a second output data element of the output data.
[0008] Further aspects disclosed herein describe a non-transitory computer-readable storage medium comprising instructions executable by at least one processor to execute a method for performing operations on a SIMD unit. The method can include, by a lane of a wave executing on the SIMD unit, loading input data into a VGPR of the lane, and performing, by the lane, a dot product operation to generate output data during one computer cycle. The performed dot product operation can include convolving a data element of the input data to generate an intermediate data element, and applying one or more transition operations to the intermediate data element to generate an output data element of the output data. The method can further include performing, by the lane, a second dot product operation during one computer cycle. The second dot product operation can include convolving a second data element of the input data to generate a second intermediate data element, and applying one or more transition operations to the second intermediate data element to generate a second output data element of the output data.
[0009] 1A is a block diagram of an example device 100A based on which one or more features of the present disclosure may be implemented. The device 100A may be, for example, a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, or a tablet computer. The device 100A includes a processor 102, an accelerated processing unit (APU) 116, a memory 104, a storage 106, one or more input devices 108, and one or more output devices 110. The device 100A may also include an input driver 112 and an output driver 114. In one aspect, the device 100A may include additional components not shown in FIG. 1.
[0010] The processor 102 may include a central processing unit (CPU) or one or more cores of a CPU. The APU 116, which represents a graphics processing unit (GPU), may include one or more cores of an APU. The processor 102 and the APU 116 may be located on the same die or on separate dies. The memory 104 may be located on the same die as the processor 102, but may be located separately from the processor 102. The memory 104 may include volatile or non-volatile memory (e.g., random access memory (RAM), dynamic RAM, cache, or a combination thereof).
[0011] Storage 106 may include fixed or removable storage (e.g., hard disk drive, solid state drive, optical disk, flash drive). Input device 108 may include, for example, a keyboard, a keypad, a touch screen, a touch pad, a detector, a microphone, an accelerometer, a gyroscope, a biometric scanner, or a network connection (e.g., a wireless local area network card for receiving wireless IEEE 802 signals). Output device 110 may include, for example, a display, a speaker, a printer, a haptic feedback device, one or more lights, an antenna, or a network connection (e.g., a wireless local area network card for transmitting wireless IEEE 802 signals).
[0012] The input driver 112 communicates with the processor 102 and the input device 108 and facilitates receiving input from the input device 108 to the processor 102. The output driver 114 communicates with the processor 102 and the output device 110 and facilitates sending output from the processor 102 to the output device 110. In one aspect, the input driver 112 and the output driver 114 are optional components and the device 100A can operate in the same manner without the input driver 112 and the output driver 114 being present.
[0013] APU 116 may be configured to receive computational and graphics rendering commands from processor 102, process those computational and graphics rendering commands, and / or provide output to a display (output device 110). As described in more detail below, APU 116 may include one or more parallel processing units configured to perform computations, for example, according to the SIMD paradigm. Thus, although various functions are described herein as being performed by or in conjunction with APU 116, in various alternative examples, functions described as being performed by APU 116 may additionally or alternatively be performed by other computing devices having similar capabilities that are not driven by a host processor (e.g., processor 102) and that may be configured, for example, to provide graphics output to a display. A processing system may be configured to perform the functions described herein regardless of whether the processing system is capable of performing processing tasks according to the SIMD paradigm.
[0014] FIG. 1B is a block diagram of an example system 100B usable by the device of FIG. 1A, according to which one or more features of the present disclosure may be implemented. FIG. 1B illustrates in further detail the execution of processing tasks on the APU 116. The processor 102 may maintain one or more modules in the memory 104 for execution by the processor 102. The modules include an operating system 120, a kernel mode driver 122, and an application 126. These modules may control various aspects of the operation of the processor 102 and the APU 116. For example, the operating system 120 may provide system calls, i.e., application programming interfaces (APIs), that may be used by the application 126 to interface directly with hardware. The kernel mode driver 122 may control the operation of the APU 116, for example, by providing APIs to the application 126 running on the processor 102 to access various functions of the APU 116. Kernel mode driver 122 may also include a just-in-time compiler that compiles programs for execution by processing components of APU 116 (such as SIMD unit 138, described in more detail below).
[0015] APU 116 can execute commands and programs for graphics and non-graphics operations, including either parallel or sequential, and either sequential or non-sequential processing. APU 116 can be used to perform graphics pipeline operations, such as operations that process pixels and / or geometric calculations (e.g., rendering an image on a display (output device 110)) based on commands received from processor 102. APU 116 can also perform processing operations unrelated to graphics operations, such as operations related to video, physics simulations, computational fluid dynamics, or other tasks, based on commands received from processor 102.
[0016] APU 116 may include workgroup processors (WGPs) 132.1-132.M, where each WGP, e.g., 132.1, may have one or more SIMD units, e.g., 138.1.1-138.1.N, that may perform operations at the request of processor 102 in parallel according to the SIMD paradigm. The SIMD paradigm allows multiple processing elements to share a single program control flow unit and program counter, and thus execute the same program on different data. In one example, each SIMD unit, e.g., 138.1.1, may include 64 lanes (i.e., threads), where each lane executes the same instruction simultaneously with other lanes in the SIMD unit, but executes that instruction on different data. Lanes may be switched off with prediction when not all lanes are required to execute a given instruction. Prediction may also be used to execute programs with branching control flows. Specifically, for programs with conditional branches or other instructions where control flow is based on calculations made by individual lanes, prediction of lanes corresponding to currently not executed control flow paths and serial execution of different control flow paths allows arbitrary control flow. In one embodiment, each of WGPs 132.1-132.M may have a local cache. In another embodiment, multiple WGPs may share a cache.
[0017] The basic unit of execution in a WGP (e.g., 132.1) is the work item. Typically, each work item represents a single instantiation of a program that can be executed in parallel on a particular lane. Work items can be executed simultaneously as a "wavefront" (or "wave") on a single SIMD, e.g., 138.1.1. One or more waves can be executed in a workgroup, with each wave containing a collection of work items designated to execute the same program. A workgroup is executed by executing each of the waves that make up the workgroup. Also, waves may be executed sequentially on a single SIMD unit, or may be executed partially or fully in parallel on different SIMD units 138.1-138.N. Thus, a wave can be thought of as a collection of work items that can be executed simultaneously on a single SIMD unit (e.g., 138.1.1). Thus, if commands received from processor 102 indicate that a particular program should be parallelized to the extent that the program cannot be executed simultaneously on a single SIMD unit, then the program may be divided into waves that can be parallelized on two or more SIMD units (e.g., 138.1.1-138.1.N), serialized on the same SIMD unit (e.g., 138.1.1), or both parallelized and serialized, as appropriate. Scheduler 136 may be configured to perform operations associated with scheduling the various waves on the different WGPs 132.1-132.M and their respective SIMD units.
[0018] The parallelism provided by WGPs 132.1-132.M is well suited for graphics-related operations such as, for example, operations on pixel values (e.g., filter operations), operations on geometric data (e.g., vertex transformations), and other graphics-related operations. For example, an application 126 executing on processor 102 may include computations performed by APU 116. Application 126 may issue processing commands to APU 116 using an API provided by kernel mode driver 122. The processing commands are then provided to scheduler 136. Scheduler 136 converts the processing commands into computational tasks that are assigned to WGPs 132.1-132.M for parallel execution.
[0019] FIG. 2 illustrates an exemplary dot product operation 200 performed by a lane of a wave in a SIMD unit, based on which one or more features of the present disclosure may be implemented. The operations of two lanes 220.1-220.2 of wave 210 are illustrated in FIG. 2. The lanes can access 64 VGPRs 230, each register may hold, for example, 4 bytes. Typically, some of the VGPRs of a lane (e.g., 230.1-230.3) may be used by the lane to store input data on which the operation is performed, and other registers (e.g., 230.63) may be used by the lane to store the results of the operation. The data stored in the VGPRs 230 of a lane of a wave may be any multi-dimensional data on which parallel operations are performed by the lane. For example, VGPR 230.2 of lane 220.1 may hold four adjacent pixels of an image, with each pixel value represented by a byte. In another example, VGPR 230.2 in lane 220.1 may hold four components of a pixel, each component corresponding to a channel of the image (e.g., the three channels of the RGB (Red, Blue, Green) color model plus a transparency channel), with each component value represented by a byte. In the former example, successive VGPRs 230.1-230.3 in lane 1 220.1 may hold a 4x3 pixel block of an image. The next 4x3 pixel block in the image may be held by VGPRs 230.1-230.3 in lane 2 220.2.
[0020] In one aspect, the lanes may be used to perform convolution operations on an image. A convolution operation involves multiplying a block of pixels of the image with a kernel of weights. For example, an image may be convolved with a 3×3 kernel 240, i.e., for each pixel, a dot product is applied between an element of the kernel and a 3×3 pixel block centered on the location of the pixel in the image. Thus, if lane 1 220.1 is to perform a convolution operation on pixel I(x,y) 250 of image I, lane 220.1 must first access kernel 240 and a 3×3 pixel block centered on pixel 250. These data may be loaded (typically by the respective WGP 132) into the lane's VGPR to allow for fast access during the operation. For example, as described above, an image region of 4×3×3 pixels may be stored in lane 1's VGPRs 230.1-230.3. For example, to convolve pixel I(x,y) 250, a 3×3 pixel block 260 centered on pixel 250 is multiplied with kernel w 240 using the following dot product operation:
[0021]
number
[0022] FIG. 3 illustrates an example layer process of a CNN based on which one or more features of the present disclosure may be implemented. In general, the input of the layer 320 may be a multidimensional array of integers or floating-point numbers, such as a three-dimensional (3D) volume or a two-dimensional (2D) matrix. As illustrated in FIG. 3, the input 310 of the layer 320 is one channel of a 2D image, where each pixel of the image may be an 8-bit integer. The output 380 of the layer 320 is another 2D image, which may be of the same size or a different size. Operators typically applied to the input of the layer 320 include a convolution operator 340 and transition operators, such as a reformatting operator 350, a rectification operator 360, and a clamp operator 370. Thus, for each pixel 315 of the input image 310, the convolution operator applies a dot product between a pixel block 316 at the center of the pixel 315 and a kernel 330, resulting in a corresponding convolved pixel. Such dot products may be performed by lanes, as described with reference to FIG. 2. A transition operation is performed on each of the convolved pixels of the image 310 to generate an output image 380 (which is fed to the next layer of the CNN) as follows: After each pixel, e.g. 315, is convolved 340, it may be reformatted 350. For example, a convolved pixel may be 2 -14 The reformatted pixel may then be multiplied by , scaled to the smallest representable floating point (FP16), and a bias (FP16 value) may be added to it. The reformatted pixel may then be rectified (360). For example, a rectified linear unit (ReLU) may be used, where if the input to the rectifier is negative, the output is set to 0, otherwise the output is the same as the input. In another example, a leaky rectified linear unit (LReLU) may be used, where if the input to the rectifier is negative, the output is divided by 4, otherwise the output is the same as the input. The rectified pixel may then be clamped (370) to set its value within a range, for example, within the range of -127 to 128 for an 8-bit signed integer. The clamped pixel becomes the output pixel 385.
[0023] As mentioned above, the transition operations (reformat 350, rectify 360, and clamp 370) that convert the output of the convolution operation 340 into an output 380 that is ready for processing by the next layer of the CNN consume significant computation time comparable, if not more, than the time it takes to perform the convolution 340. Disclosed herein are instructions designed to perform the convolution and transition operations in one computer cycle. Figures 4 and 5 together show an instruction, the dual dot product instruction, designed to perform the convolution operation (Figure 4) and the transition operation (Figure 5) on two pixels of an image in one computer cycle, as described in detail below.
[0024] 4 and 5 illustrate example dual dot product instructions, including a convolution operation (FIG. 4) and a transition operation (FIG. 5), according to which one or more features of the present disclosure may be implemented. FIG. 4 illustrates a dual dot product instruction for two adjacent pixels, i.e., pixel I, stored in the second and third bytes of VGPR 450. 22 and Pixel I 23 (circled in Figure 4). 22 and I 23 To facilitate the convolution of the data, the data stored in the VGPRs 440, 450, and 460 includes two 3×3 pixel blocks. The first pixel block (pixel {I 11 , I 12 , I 13 , I 21 , I 22 , I 23 , I 31 , I 32 , I 33}) is pixel I 22 The second pixel block (pixels {I 12 , I 13 , I 14 , I 22 , I 23 , I 24 , I 32 , I 33 , I 34}) is pixel I 23The three dot product units 415, 425, 435 are used to perform dot product operations on the first, second, and third lines of the first pixel block, respectively. The sum of these dot products is the sum of the pixel I 22 Similarly, three dot product units 410, 420, 430 are used to perform dot product operations on the first, second, and third lines of the second pixel block, respectively. The sum of these dot products is 23 It should be noted that the dot product units 410, 415, 420, 425, 430, and 435 use the weights of the 3×3 kernel {w11, w12, w13, w21, w22, w23, w31, w32, and w33}. For example, the dot product unit 410 output is w11·I 12 +w12·I 13 +w13·I 14 It is.
[0025] As shown in Figure 5, pixel I 22 The convolution result 480 and pixel I 23 A transition operation is further applied to the convolution result 470 of pixel I 22 The convolution result 510 and pixel I 23 The convolution result 540 of pixel I may be reformatted (515, 545), rectified (520, 550), and clamped (530, 560). 22 The convolved values 510 of can be reformatted into floating point format. 22 The integer value of may be right shifted by 14 bits to allow for a 14-bit fraction. The bias value 505 (e.g., a floating point number) is added to the reformatted I 22 The bias value can be either a constant value or a value stored in the VGPR of the respective lane. Similarly, the pixel I 23The convolved values of 540 may be reformatted and a bias value 535 may be added to it. The reformatted values may then be rectified (520, 550) by applying shift operators 522, 552 and ReLU (or LReLU) operators 525, 555. The rectified values may then be clamped (530, 560), resulting in output pixels 580, 590 that are stored in the destination VGPR 570.
[0026] 6 illustrates an example dot product operation performed by a lane of a wave in a SIMD unit, based on which one or more features of the present disclosure may be implemented. 21 or I 24 6 illustrates a convolution operation of wave-1 620.1 through wave-2 650. In general, the number of waves required to process an image is the number of pixels to be processed in the image divided by the size of the wave. The size of the wave is the number of lanes (e.g., 64) times the number of pixels each lane is assigned to process (e.g., 4 pixels). Two waves are shown in FIG. 6. Each wave is assigned to process a segment of an image line. For example, wave-1 610 processes a first segment of 256 pixels, and wave-2 650 processes a second segment of 256 pixels. Each lane of a wave (i.e., the illustrated lanes 620.1 through 620.64 of wave-1 610 and lane-1 660.1 of wave-2 650) processes four pixels of an image line. For example, lane-1 620.1 is assigned to process pixels 1 through 4 of image line 630.2, and lane-2 620.2 is assigned to process pixels 5 through 8 of image line 630.2.
[0027] For example, as described with respect to FIG. 2, to convolve a pixel, a lane needs access to a pixel block centered on the pixel. Thus, a lane stores in its VGPR not only the four pixels for which the convolution must be calculated (in image line 630.2), but also the four pixels above (in image line 630.1) and the four pixels below (in image line 630.3). However, the pixel block required by a lane to convolve a boundary pixel includes pixels not stored by the respective lane. For example, to convolve pixel 4 of line 630.2, lane 1 620.1 needs access to pixel 5 of image lines 630.1, 630.2, and 630.3. In one aspect, a lane (such as lane 1 620.1) can access pixel data stored in the VGPR of another lane in the wave (such as the VGPR of lane 2 620.2 of wave 1 610).
[0028] Similarly, to convolve pixel 256 of line 630.2, lane 64 620.64 requires access to pixel 257 of image lines 630.1, 630.2, and 630.3. However, because pixels 256 are at the end of the image segment assigned to wave 1 610, these pixels are not accessible to lane 64. Thus, in one aspect, instead of loading the missing right column of pixel block 645 from memory (i.e., loading pixels 257 of image lines 630.1, 630.2, and 630.3), lane 64 620.64 can pad the right column of pixel block 645 with pixels 256 of image lines 630.1, 630.2, and 630.3 (as indicated by arrow 646 in FIG. 6 ). This padding eliminates the need to load data from memory into the VGPR of lane 64, but taints the convolution results of boundary pixels, such as pixel 256 of image line 630.2. One solution is to maintain a two-pixel overlap between the first and second segments assigned to two adjacent waves. For example, as shown in FIG. 6, pixels 255 and 256 of lane-64 of wave-1 are also loaded and processed by lane-1 of wave-2. If padding is also performed to complete pixel block 680 needed to calculate the convolution of pixel 255 in image line 670.2 (as indicated by arrow 686 in FIG. 6), the convolution result of this pixel will also be tainted. Note, however, that pixel 255 of line 630.2 and pixel 256 of line 670.2 are not boundary pixels in their respective lanes 64 620.64 and lane 1 660.1, and therefore their respective convolution results are valid. In one embodiment, lane 1 and lane 64 can switch convolution results.That is, lane 64 can replace its tainted convolution result for 256 (in line 630.2) with the valid result for 256 calculated by lane 1 (in line 630.2) (695), and lane 1 can replace its tainted convolution result for 255 (in line 670.2) with the valid result for 255 calculated by lane 64 (in line 670.2) (690).
[0029] FIG. 7 illustrates another exemplary dual dot product instruction based on which one or more features of the present disclosure may be implemented. The dual dot product instruction illustrated in FIG. 7 also includes a transition operation as illustrated in FIG. 5. In one aspect, the instruction illustrated in FIG. 7 may be applied to perform a dot product on a 2-by-4 data matrix. For example, the instruction may be applied to a convolution across channels of an image (i.e., a point-wise convolution). FIG. 7 illustrates performing a dual convolution on an image having eight channels. Thus, the channels of a first pixel are stored in a first VGPR 715, denoted 1(1), 1(2), 1(3), and 1(4), and a second VGPR 725, denoted 1(5), 1(6), 1(7), and 1(8). The channels of the second pixel are stored in a first VGPR 735, denoted 2(1), 2(2), 2(3), and 2(4), and a second VGPR 745, denoted 2(5), 2(6), 2(7), and 2(8). Four dot product units 710, 720, 730, 740 are used to perform dual dot product operations. Two units 710, 720 perform the dot product of the first pixel with the kernel, i.e., summation of w1·1(1), w2·1(2), w3·1(3), w4·1(4), w5·1(5), w6·1(6), w7·1(7), and w8·1(8). This dot product constitutes a convolution result of the first pixel 750 that can be fed to a transition operator (e.g., the reformatting operator 515, the rectifying operator 520, and the clamping operator 530 shown in FIG. 5), and the result can be stored in any of the VGPRs of the lane, e.g., 580. The two units 730, 740 perform dot products of the second pixel with the kernels, i.e., sums of w1·2(1), w2·2(2), w3·2(3), w4·2(4), w5·2(5), w6·2(6), w7·2(7), and w8·2(8). This dot product constitutes a convolution result of the second pixel 760 that can be fed to a transition operator (e.g., the reformatting operator 545, the rectifying operator 550, and the clamping operator 560 shown in FIG. 5), and the result can be stored in any of the VGPRs of the lane, e.g., 590.
[0030] In one embodiment, a first stage may apply a convolution to pixels in each channel of an image (i.e., a depth-wise convolution) using the dual dot product instruction of Figure 4, resulting in an output image for each channel. A second stage may then apply a convolution across the channels (i.e., a point-wise convolution) using the dual dot product instruction of Figure 7, receiving as input the output produced by the first stage.
[0031] FIG. 8 is a flow chart of an example method 800 for application of a dual dot product instruction, according to which one or more features of the present disclosure may be implemented. The method 800 used by a lane of a wave executing on a SIMD unit begins with loading input data into the VGPR of the lane, step 810. A dot product operation may then be performed in one computer cycle, step 820. The dot product operation includes convolving a data element of the input data and then applying a transition operation to the convolved data element. A second dot product operation may be performed in one computer cycle, step 830. The second dot product operation may include convolving a second data element of the input data and then applying a transition operation to the convolved second data element. The dot product operations of steps 820 and 830 may be performed by applying deal product instructions, as described with reference to FIGS. 4-7.
[0032] It should be understood that many variations are possible based on the disclosure herein, and although features and elements have been described above in particular combinations, each feature or element can be used alone without the other features and elements, or in various combinations with or without the other features and elements.
[0033] The provided methods can be implemented in a general purpose computer, processor, or processor core. Suitable processors include, by way of example, general purpose processors, special purpose processors, conventional processors, digital signal processors (DSPs), multiple microprocessors, one or more microprocessors associated with a DSP core, controllers, microcontrollers, application specific integrated circuits (ASICs), field programmable gate array (FPGA) circuits, any other type of integrated circuit (IC), and / or state machines. Such processors can be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediate data, including netlists (instructions that can be stored on a computer readable medium). The results of such processing can be a mask work that is used in a subsequent semiconductor manufacturing process to manufacture a processor embodying aspects of the embodiments.
[0034] The methods or flow charts provided herein may be implemented in a computer program, software, or firmware embodied in a non-transitory computer-readable storage medium for execution by a general purpose computer or processor. Examples of non-transitory computer-readable storage media include read only memory (ROM), random access memory (RAM), registers, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks and digital versatile disks (DVDs).
Claims
1. 1. A method for performing operations on a single instruction multiple data (SIMD) unit, comprising: a lane of a wave executing on a SIMD unit loading input data into a vector general purpose register (VGPR) of said lane; the lane performing a dot product operation in one computer cycle to generate output data; Generating the output data includes: convolving data elements of the input data to generate intermediate data elements; applying one or more transition operations to the intermediate data elements to generate output data elements of the output data. method.
2. the lane performing a dot product operation during the one computer cycle; performing the dot product operation convolving a second data element of the input data to generate a second intermediate data element; applying the one or more transition operations to the second intermediate data element to generate a second output data element of the output data.
2. The method of claim 1.
3. the one or more transition operations are any of a reformatting operation, a rectification operation, or a clamp operation; 2. The method of claim 1.
4. The input data is an input to a layer of a convolutional neural network, and the output data is an output of the layer.
2. The method of claim 1.
5. the input data includes pixels of an image including a pixel and a pixel block centered on the pixel; the convolution includes a dot product of the pixel block with a kernel of weights, the pixel block and the kernel being stored in the VGPR of the lane; 2. The method of claim 1.
6. if a first portion of the pixel block is stored in a VGPR of the lane and a second portion of the pixel block is stored in a VGPR of another lane in the wave, the lane accesses the second portion of the VGPR of the other lane; The method of claim 5.
7. if a first portion of the pixel block is stored in the VGPR of the lane and a second portion of the pixel block is not stored in the VGPR of the lane, the second portion of data is replaced by the first portion of data. The method of claim 5.
8. the output data generated is replaced by the output data generated by the lanes of the second wave; The method of claim 7.
9. the input data is channel data of pixels of an image; the convolution includes a dot product of the channel data with a kernel of weights, the channel data and the kernel being stored in a VGPR for the lane; 2. The method of claim 1.
10. 1. A circuit for performing operations on a single instruction multiple data (SIMD) unit, comprising: At least one processor; A memory for storing instructions, The instructions, when executed by the at least one processor, a lane of a wave executing on a SIMD unit loading input data into a vector general purpose register (VGPR) of said lane; the lane performing a dot product operation during one computer cycle to generate output data; causing the circuit to perform Generating the output data includes: convolving data elements of the input data to generate intermediate data elements; applying one or more transition operations to the intermediate data elements to generate output data elements of the output data. circuit.
11. The instruction: the lane causes the circuit to perform a dot product operation during the one computer cycle; performing the dot product operation convolving a second data element of the input data to generate a second intermediate data element; applying the one or more transition operations to the second intermediate data element to generate a second output data element of the output data. The circuit of claim 10.
12. the one or more transition operations are any of a reformatting operation, a rectification operation, or a clamp operation; The circuit of claim 10.
13. The input data is an input to a layer of a convolutional neural network, and the output data is an output of the layer. The circuit of claim 10.
14. the input data includes pixels of an image including a pixel and a pixel block centered on the pixel; the convolution includes a dot product of the pixel block with a kernel of weights, the pixel block and the kernel being stored in the VGPR of the lane; The circuit of claim 10.
15. if a first portion of the pixel block is stored in a VGPR of the lane and a second portion of the pixel block is stored in a VGPR of another lane in the wave, the lane accesses the second portion of the VGPR of the other lane; 15. The circuit of claim 14.
16. if a first portion of the pixel block is stored in the VGPR of the lane and a second portion of the pixel block is not stored in the VGPR of the lane, the second portion of data is replaced by the first portion of data.
15. The circuit of claim 14.
17. the output data generated is replaced by the output data generated by the lanes of the second wave; 17. The circuit of claim 16.
18. the input data is channel data of pixels of an image; the convolution includes a dot product of the channel data with a kernel of weights, the channel data and the kernel being stored in a VGPR for the lane; The circuit of claim 10.
19. 1. A computer-readable storage medium comprising instructions executable by at least one processor to perform a method for performing operations on a single instruction multiple data (SIMD) unit, the method comprising: The method comprises: a lane of a wave executing on a SIMD unit loading input data into a vector general purpose register (VGPR) of said lane; the lane performing a dot product operation in one computer cycle to generate output data; Generating the output data includes: convolving data elements of the input data to generate intermediate data elements; applying one or more transition operations to the intermediate data elements to generate output data elements of the output data. A computer-readable storage medium.
20. the lane performing a dot product operation during the one computer cycle; performing the dot product operation convolving a second data element of the input data to generate a second intermediate data element; applying the one or more transition operations to the second intermediate data element to generate a second output data element of the output data.
20. The computer readable storage medium of claim 19.
Citation Information
Patent Citations
Dot product multiplier mechanism
JP2021077347A
Deep learning implementations using systolic arrays and fused operations
US20210089316A1
Register saving for function calling
US20210096864A1
