METHOD FOR DATA PLACEMENT FOR IN-MEMORY COMPUTING AND MEMORY MODULE HAVING APPLIED THERETO

By integrating an ALU on the DRAM bank die and optimizing data placement, the HBM system achieves significant performance gains in in-memory computing, overcoming limitations of current HBM architectures.

JP7550614B2Active Publication Date: 2024-09-13SAMSUNG ELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2020191783
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-04-27
Filing Date
2020-11-18
Publication Date
2024-09-13
Estimated Expiration
2040-11-18

AI Technical Summary

Technical Problem

Current HBM architectures for GPUs lack efficient in-memory processing capabilities, limiting performance gains in high-bandwidth memory systems.

Method used

Integrate an arithmetic logic unit (ALU) directly on the DRAM bank die within the HBM system, enabling in-memory computing (IMC) by performing calculations without passing through an external bus, and optimize data placement strategies based on computational operations to reduce DRAM timing overhead.

Benefits of technology

Enhances computational performance by reducing memory access delays and improving peak performance in in-memory computing operations, such as GEMM, to achieve up to 8 TFLOPS in certain scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007550614000003
    Figure 0007550614000003
  • Figure 0007550614000004
    Figure 0007550614000004
  • Figure 0007550614000005
    Figure 0007550614000005
Patent Text Reader

Abstract

To provide a method for improving performance of a memory module and a memory module with improved performance.SOLUTION: A memory system 1 includes a memory module and a host processor. The memory module includes memory dies including DRAM banks 200 and a memory controller. Each of the DRAM banks includes an array of DRAM cells 210, a row buffer storing values of an opened page, an IO module 260, and an in-memory computing (IMC) module 250. The IMC module includes: an arithmetic logic unit (ALU) 252 configured to receive operands from the row buffer or the IO module and to compute an output based on the operands and an ALU operation selected from a plurality of ALU operations; and a result register 256 configured to store the output computed by the ALU.SELECTED DRAWING: Figure 2A
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a system and method for data placement for in-memory computing. [Background technology]

[0002] High Bandwidth Memory (HBM) is often used as high-performance memory for graphics processing units (GPUs). HBM has the advantage of having a very wide bus compared to typical DRAM. Current HBM architectures include multiple stacked DRAM dies (e.g., dice) connected using through silicon vias (TSVs) and a logic die that acts as a buffer for the HBM and an HBM memory controller for the GPU. Further performance improvements are achieved by adding in-memory processing (e.g., in-memory processing) capabilities to the memory system.

[0003] The above content includes information that does not constitute prior art and is intended only to provide a better understanding of the background to embodiments of the present invention. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2019-075101 A Summary of the Invention [Problem to be solved by the invention]

[0005] The present invention has been made in consideration of the above-mentioned conventional technology, and an object of the present invention is to provide a method for improving the performance of a memory module, and a memory module with improved performance. [Means for solving the problem]

[0006] In order to achieve the above object, a memory module according to one aspect of the present invention includes a memory die including a plurality of dynamic random access memory (DRAM) banks, each of the DRAM banks including an array of DRAM cells arranged in a plurality of pages, a row buffer for storing values ​​of an open page of the plurality of pages, an input / output (IO) module, and an in-memory computing (IMC) module, each of the pages including a plurality of the DRAM cells, each of the DRAM cells storing a bit value, the IMC module receiving an operand from the row buffer or the IO module, and performing a calculation based on the operand and an arithmetic logic operation selected from a plurality of arithmetic logic operations. and an arithmetic logic unit (ALU) configured to calculate an output based on a first operand, a second operand, and an instruction from a host processor; determining a data layout from a plurality of data layouts based on the instruction; providing the first operand and the second operand to the DRAM bank in accordance with the one data layout; and controlling the IMC module of the DRAM bank to perform the one arithmetic logic operation of the plurality of arithmetic logic operations on the first operand and the second operand in accordance with the instruction.

[0007] The multiple data layouts may include a one operand (1OP) data layout, where the first operand is written to the DRAM cell and the second operand is provided directly from the host processor to the IMC module of the DRAM bank.

[0008] The IMC module may further include an operand register, and the memory controller may be further configured to store a first tile of the first operand in the operand register and perform an arithmetic logic operation on the first tile of the first operand stored in the operand register and each of a plurality of second tiles of the second operand.

[0009] The first operand may be divided into a plurality of first tiles, the second operand may be divided into a plurality of second tiles, each of the tiles including a plurality of values, the plurality of data layouts may include a same row (SR) data layout, and the memory controller may store one or more of the first tiles and one or more of the second tiles in the same page of the array of DRAM cells.

[0010] The IMC module may further include an operand register, and the memory controller may be further configured to store a first tile of the one or more first tiles in the operand register and perform an arithmetic logic operation on the first operand stored in the operand register and each of one or more second tiles stored in the same page as the first tile of the array of DRAM cells.

[0011] The IMC module of the DRAM bank may further include an accumulator, the accumulator including an accumulator register configured to store an accumulated value, the accumulator configured to receive an output calculated by the ALU and update the accumulator register with a sum of the accumulated value and the output, the instruction may include calculating a dot product of the first operand and the second operand, and the one of the first tiles may store row data and the one of the second tiles may include column data.

[0012] The first tile may have a first number value and the second tile may have a second number value, the IMC module of the DRAM bank may include an output buffer, the output buffer having a size to store greater than or equal to a product of the first number value and the second number value, the instruction may include calculating a cross product of the first operand and the second operand, and the one of the first tiles may store row data and the one of the second tiles may include column data.

[0013] The first tile may have a first number value and the second tile may have a second number value, the IMC module of the DRAM bank may include an output buffer, the output buffer having a size to store at least the greater of the first number value and the second number value, the instruction may include computing a tensor product of the first operand and the second operand, and the one of the first tiles may store row data and the one of the second tiles may include column data.

[0014] The first operand may be divided into a plurality of first tiles, the second operand may be divided into a plurality of second tiles, each of the tiles including a plurality of values, the plurality of data layouts may include different row (DR) data layouts, and the memory controller may store a subset of the first tiles in a first page of the array of DRAM cells and store a subset of the second tiles in a second page of the array of DRAM cells.

[0015] It is preferable that the IMC module further includes an operand register, and the memory controller is further configured to store a first tile of the first operand from the first page of the operand register, and to perform an arithmetic logic operation on the first operand stored in the operand register and each of a plurality of second tiles of the second operand from the second page.

[0016] Preferably, the IMC module of each of the DRAM banks further includes a buffer configured to buffer the output calculated by the ALU.

[0017] The buffer may have a size that is four or more times the size of the result register.

[0018] Preferably, the IMC module of each of the DRAM banks further includes an accumulator, the accumulator including an accumulator register configured to store an accumulated value, the accumulator configured to receive the output calculated by the ALU and update the accumulator register with a sum of the accumulated value and the output.

[0019] The memory module may be a high bandwidth memory (HBM) module including a stack of memory dies connected by through silicon vias, the stack of memory dies including the memory die.

[0020] In order to achieve the above object, one aspect of the present invention provides a method for performing in-memory computation, the method comprising the steps of: receiving a first operand, a second operand, and an instruction by a memory controller of a memory module; determining, by the memory controller, one data layout from a plurality of data layouts based on the instruction; providing the first operand and the second operand to at least one DRAM bank of the memory module in accordance with the data layout; and configuring the I / O of the DRAM bank to perform one arithmetic and logic operation among a plurality of arithmetic and logic operations on the first operand and the second operand in accordance with the instruction. and controlling an IMC module, wherein each of the DRAM banks includes an array of DRAM cells arranged into a plurality of pages, a row buffer for storing values ​​of an open page of the plurality of pages, an IO module, and the IMC module, each of the pages including the DRAM cells, each of the DRAM cells storing a bit value, the IMC module including an ALU configured to receive an operand from the row buffer or the IO module and calculate an output based on the operand and an arithmetic logic operation selected from a plurality of arithmetic logic operations, and a result register configured to store the output calculated by the ALU.

[0021] The multiple data layouts include a one operand (1OP) data layout, where the first operand is written to the DRAM cell and the second operand can be provided directly from the host processor to the IMC module of the DRAM bank.

[0022] The IMC module may further include an operand register, and the memory controller may be further configured to store a first tile of the first operand in the operand register and perform an arithmetic logic operation on the first tile of the first operand stored in the operand register and each of a plurality of second tiles of the second operand.

[0023] The first operand may be divided into a plurality of first tiles, the second operand may be divided into a plurality of second tiles, each of the tiles including a plurality of values, the plurality of data layouts may include same row (SR) data layouts, and the memory controller may store one or more of the first tiles and one or more of the second tiles in the same page of the array of DRAM cells.

[0024] The IMC module may further include an operand register, and the memory controller may be further configured to store a first tile of the one or more first tiles in the operand register and perform an arithmetic logic operation on the first operand stored in the operand register and each of the one or more second tiles stored in the same page as the first tile of the array of DRAM cells.

[0025] The IMC module of the at least one DRAM bank may further include an accumulator, the accumulator including an accumulator register configured to store an accumulated value, the accumulator configured to receive the output calculated by the ALU and update the accumulator register with a sum of the accumulated value and the output, the instruction may include calculating a dot product of the first operand and the second operand, and the one of the first tiles may store row data and the one of the second tiles may include column data.

[0026] The first tile may have a first number value and the second tile may have a second number value, the IMC module of the at least one DRAM bank may include an output buffer, the output buffer having a size for storing greater than or equal to a product of the first number value and the second number value, the instruction may include a step of calculating a cross product of the first operand and the second operand, and the one of the first tiles may store row data and the one of the second tiles may include column data.

[0027] The first tile may have a first number value and the second tile may have a second number value, the IMC module of the at least one DRAM bank may include an output buffer, the output buffer having a size to store at least the greater of the first number value and the second number value, the instruction may include calculating a tensor product of the first operand and the second operand, and a first tile of the one of the first tiles may store row data and a second tile of the one of the second tiles may include column data.

[0028] The first operand may be divided into a plurality of first tiles, the second operand may be divided into a plurality of second tiles, each of the tiles including a plurality of values, the plurality of data layouts may include different row (DR) data layouts, and the memory controller may store a subset of the first tiles in a first page of the array of DRAM cells and store a subset of the second tiles in a second page of the array of DRAM cells.

[0029] It is preferable that the IMC module further includes an operand register, and the memory controller is further configured to store a first tile of the first operand from the first page of the operand register, and to perform an arithmetic logic operation on the first operand stored in the operand register and each of a plurality of second tiles of the second operand from the second page. Effect of the Invention

[0030] According to the method for data placement for in-memory computing and the memory module to which the method is applied according to the present invention, the performance of the memory module can be improved. [Brief description of the drawings]

[0031] [Figure 1]FIG. 2 is a block diagram illustrating a memory (e.g., HBM) system architecture according to one embodiment of the present invention. [Figure 2A] 1 is a schematic block diagram of a memory bank having an embedded arithmetic logic unit (ALU), in accordance with one embodiment of the present invention; [Figure 2B] 1 is a circuit diagram illustrating an example of a DRAM cell according to an embodiment of the present invention. [Figure 2C] 2 is a schematic diagram of a DRAM bank according to one embodiment of the present invention, including an array of DRAM cells, a row decoder, an IOSA, an IMC module, and a column decoder. [Diagram 3] 2 is a schematic diagram illustrating an array of DRAM blocks according to one embodiment of the present invention. [Figure 4A] FIG. 13 is a schematic diagram illustrating data placement for a GEMM when a first operand (matrix A) is stored in DRAM and a second operand (matrix B) is broadcast from outside the embedded memory module, along with integrated in-memory computing (IMC) in accordance with an embodiment of the present invention. [Figure 4B] FIG. 13 is a schematic diagram illustrating data placement for a GEMM when both operands (matrix A and matrix B) are stored in the same page of the DRAM of a memory module, along with an integrated IMC according to one embodiment of the present invention. [Figure 4C] FIG. 13 is a schematic diagram illustrating data placement for a GEMM when both operands (matrix A and matrix B) are stored in different pages of the DRAM of a memory module, along with an integrated IMC according to an embodiment of the present invention. [Figure 5A] FIG. 13 is a schematic diagram of multiplication of the first row of matrix A by the first column of matrix B in a one operand (1OP) data layout. [Figure 5B] FIG. 2 is a schematic diagram illustrating multiplication of the first value in the first row of matrix A by the first values ​​in each column of matrix B in a 1OP data layout with data reuse. [Figure 6A]FIG. 13 is a schematic diagram of multiplication of the first row of matrix A by the first column of matrix B in a same row (SR) data layout. [Figure 6B] FIG. 13 is a schematic diagram of multiplication with data reuse for the first value in the first row of matrix A and the first values ​​in each column of matrix B in the SR data layout. [Figure 7A] FIG. 13 is a schematic diagram of multiplication of the first row of matrix A by the first column of matrix B in a different row (DR) data layout. [Figure 7B] FIG. 13 is a schematic diagram of data reuse multiplication of the first value in the first row of matrix A by the second values ​​in each column of matrix B, using the first values ​​in each column of matrix B and the second values ​​in the first row of matrix A in a DR data layout. [Figure 8] FIG. 2 is a schematic block diagram of an IMC module of a DRAM bank. [Figure 9] FIG. 13 is a schematic diagram of an example of a GEMM to illustrate computations using a same row (SR) layout in accordance with some embodiments of the present invention. [Figure 10] 4 is a flow chart illustrating a method for controlling placement of data in a DRAM bank having an IMC module, according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0032] The features of the present invention and the methods for achieving the same will be easily understood by referring to the detailed description of the embodiments and the drawings below. Hereinafter, the embodiments will be described in more detail with reference to the drawings, in which the same reference numerals refer to the same elements throughout the drawings. However, the present invention can be implemented in various different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided as examples so that the present invention will be thorough and complete, and the aspects and features of the present invention will be fully conveyed to those skilled in the art. Therefore, processes, elements, and techniques that are unnecessary for those skilled in the art to fully understand the aspects and features of the present invention will not be described. Unless otherwise specified, similar reference numerals refer to similar elements throughout the drawings and the description set forth in the specification, and the description will not be repeated. In the drawings, the relative sizes of elements, layers, and regions may be exaggerated for clarity.

[0033] In the following description, for purposes of explanation, numerous specific details are presented in order to provide a thorough understanding of the various embodiments. However, the various embodiments may be practiced without these specific details, or may be practiced in one or more equivalent configurations. In other instances, well-known structures and devices are shown in block diagram form in order to avoid obscuring the various embodiments.

[0034] The terms used herein are for the purpose of describing particular embodiments and are not intended to limit the present invention. Singular terms include plural terms unless the context clearly indicates otherwise. Terms such as "comprises" and "having" as used herein specify the presence of disclosed features, numbers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, numbers, steps, operations, elements, components, and / or combinations thereof. The term "and / or" as used herein includes any and all combinations of one or more associated listed items.

[0035] The electronic or electrical devices according to the embodiments of the invention described herein and / or any other related devices or components may be implemented using any suitable hardware, firmware (e.g., Application-Specific Integrated Circuit), software, or combination thereof. For example, in some environments, the various components of these devices may be formed on one integrated circuit (IC) chip or on separate IC chips. Also, the various components of these devices may be implemented on a flexible printed circuit film, a tape carrier package (TCP), a printed circuit board (PCB), or may be formed on a single substrate. Furthermore, the various components of these devices may be processes or threads running on one or more processors in one or more computing devices that execute computer program instructions and interact with other system components to perform the various functions described herein. The computer program instructions may be stored in a memory implemented in the computing device using, for example, a standard memory device such as a random access memory (RAM). The computer program instructions may also be stored on other non-transitory computer readable media such as, for example, a CD-ROM, a flash drive, etc. Additionally, those skilled in the art should recognize that within the spirit and scope of the exemplary embodiments of the present invention, the functionality of various computing devices may be combined or integrated into a single computing device, or the functionality of a particular computing device may be distributed across one or more other computing devices.

[0036] Unless otherwise defined, all terms, including technical or scientific terms, used herein have the same meaning as commonly understood by a person of ordinary skill in the art to which the present invention belongs. Furthermore, terms as defined in commonly used dictionaries are interpreted to be consistent with the meaning in the context of the relevant art and / or this specification, and are not interpreted in an ideal or overly formal sense unless expressly defined in this specification.

[0037] Some aspects of the present invention relate generally to managing data placement in memory in the context of in-memory computing. One example of an in-memory computing context is an HBM system that includes a Dynamic Random Access Memory (DRAM) die that includes memory, and an ALU and a memory controller on an HBM logic die, where the ALU on the HBM logic die performs the in-memory computing. The memory controller on the HBM logic die controls storing data to and reading data from the memory of the DRAM die.

[0038] For clarity, the term "in-memory computing" as used herein means performing calculations in a memory module, such as a high-bandwidth memory module, using data stored in a DRAM die without passing through an external data bus. In a comparative computer system, a processor is connected to a main memory (e.g., DRAM) through an external DRAM data bus, and accessing data from the main memory is significantly slower (e.g., tens of times slower) than accessing data in a register file in the processor and / or in a hardware cache (e.g., L1 cache, L2 cache) closer to the processor. By placing an additional processor (e.g., an "in-memory processor") at or near the memory, the delay caused by passing through an external bus can be avoided, thereby achieving high performance calculations.

[0039] Aspects of embodiments of the present invention relate to locating computational circuitry, such as an ALU, on the same die as the DRAM banks (eg, directly connected to the sense amplifiers or row buffers of each DRAM bank).

[0040] Due to the design and performance characteristics of the DRAM modules, the particular arrangement of data within the memory can impact the performance of in-memory computing. Accordingly, some aspects of embodiments of the present invention relate to systems and methods for placing data within the DRAM modules of a memory module (e.g., an HBM memory module), where the placement of the data is controlled based on the characteristics of the computation being performed by the IMC module.

[0041] FIG. 1 is a block diagram illustrating a memory (eg, HBM) system architecture according to one embodiment of the present invention.

[0042] Referring to FIG. 1, embodiments of the present invention provide a system for a function-in-memory (FIM) memory system 100. The memory system 100 (or HBM system) supports additional computing resources integrated into a memory module 110 (or HBM module). For example, in various embodiments, the memory system 100 allows some data computing and movement to be performed in memory and provides a high-capacity memory scratchpad. The memory system 100 includes at least one memory module 110 connected to a host processor 170, such as a graphics processing unit (GPU) or a central processing unit (CPU). In various embodiments, the memory module 110 includes one or more DRAM dies 120 connected to a memory controller 140 (e.g., on a logic die) via an internal memory bus 130. In various embodiments, the host processor 170 includes a host memory controller 180 (or host controller) for interfacing with the memory module 110. However, embodiments of the present invention are not limited in this respect. For example, host memory controller 180 may be separate from host processor 170 (eg, as a separate die or the same die as host processor 170).

[0043] According to various embodiments, memory controller 140 is configured to coordinate the execution of instructions from host processor 170. The instructions include both regular and FIM instructions. For example, regular instructions (e.g., traditional load and store functions, rather than function-in-memory (FIM) instructions) are sent by host memory controller 180, received by memory controller 140, and executed in a regular manner. For example, regular instructions include instructions to store data received via external bus 190 in DRAM die 120, and instructions to retrieve data from DRAM die 120 and send the data to host processor 170 via external bus 190. In some embodiments, regular and FIM instructions include operations to store data in a specific location of the DRAM die (e.g., a specific page of a specific bank). These data include two different operands, where each operand includes multiple values ​​(e.g., floating point or integer values), and the values ​​of these operands are distributed to different locations of the DRAM die according to various data placement strategies, as described in more detail below.

[0044] An aspect of an embodiment of the present invention relates to the use of in-memory compute (IMC). Some comparative HBM systems include an ALU that is external to the DRAM die 120 (e.g., located in the memory controller 140) and shared by memory banks of the DRAM die 120 such that the ALU can perform operations (e.g., arithmetic operations) on data stored in one or more of the DRAM dies 120 without passing through an external bus 190. For example, the memory controller 140 performs data movement operations (e.g., load / store pair instructions) to move or copy data between different portions of the DRAM die 120. For example, the memory controller executes FIM instructions that were originally multiple regular instructions by coordinating the execution of computational FIM instructions (e.g., atomic instructions and ALU instructions) that utilize the ALU. As another example, in some cases, a FIM instruction received from the host processor 170 causes the memory module with the IMC integrated to perform a specific computation, such as using a learned machine learning model (e.g., a neural network) to perform backpropagation during training of the neural network, or to compute inference based on the inputs provided to multiply two matrices. In such cases, the memory controller 140 coordinates the execution of these instructions by storing the received data (e.g., operands of the instruction) in specific pages of the DRAM banks and providing specific ALU operations to the DRAM banks that store data related to the FIM instruction. The memory controller 140 places the received data (operands) in specific pages of the DRAM banks in a manner that improves computational performance when executing the specific FIM instruction. The results are stored in the DRAM die 120 or returned to the host processor 170 via the external bus 190.

[0045] Some aspects of embodiments of the present invention relate to accelerating memory boundary operations by integrating IMC modules into memory banks of the DRAM die 120, thereby avoiding traversal of the internal memory bus 130 between the DRAM die 120 and the memory controller 140. For example, the IMC modules are on the same physical semiconductor die as the DRAM banks that hold the data. Each DRAM bank has an associated IMC module, which allows calculations to be performed on data stored in the DRAM bank without the data passing over the internal memory bus 130 to the memory controller (e.g., without sending the data out of the DRAM bank). Additionally, the calculations can be parallelized across the IMC modules of the DRAM bank.

[0046] Although aspects of the embodiments of the present invention are described with respect to high bandwidth memories, the embodiments are not so limited and also apply to integrating an IMC module with a DRAM die in other types of DRAM systems.

[0047] FIG. 2A is a schematic block diagram of a memory bank with an embedded arithmetic logic unit (embedded ALU) according to an embodiment of the present invention. As shown in FIG. 2A, the DRAM bank 200 includes an array of DRAM cells 210 arranged in rows and columns (or pages and columns). As illustrated in FIG. 2A, the DRAM bank 200 includes the DRAM cells 210 arranged in n rows (or pages) and m columns. A number of bit lines B1-Bm extend along the column direction, and a number of row enable lines R1-Rn extend along the row direction of the array and intersect with the bit lines. Each bit line is connected to all the cells (DRAM cells 210) in a corresponding column (e.g., all the cells in the i-th column of the array are connected to a bit line Bi). Similarly, each row enable line R1-Rn is connected to each DRAM cell 210 in a corresponding row (e.g., all the cells in the j-th row or page of the array are connected to a row enable line Rj). Additionally, a row of DRAM cells 210 in a DRAM bank 200 is referred to as a DRAM page.

[0048] FIG. 2B is a circuit diagram illustrating an example of a DRAM cell according to an embodiment of the present invention. Each DRAM cell 210 is generally modeled as including a capacitor 212 for storing a data voltage (e.g., a bit value, where each capacitor stores a voltage representing a 0 bit or a voltage representing a 1 bit) and a switch 214 for transmitting the data voltage to the capacitor 212. The particular DRAM cell 210 illustrated in FIG. 2B is in the i-th row and j-th column of the array. Thus, the switch 214 of the DRAM cell 210 illustrated in FIG. 2B is connected between the i-th bit line Bi and one terminal of the capacitor 212, and the other terminal of the capacitor 212 is connected to ground. As illustrated in FIG. 2B, the gate electrode of the switch 214 of the DRAM cell 210 is connected to the j-th row enable line Rj, and when the switch 214 is turned on, the capacitor 212 is connected to the bit line Bi.

[0049] 2A, the DRAM bank 200 includes a row decoder 220 connected to row enable lines R1-Rn, the row decoder 220 being configured to provide a row enable signal to a particular one of the row enable lines corresponding to a row address provided, for example, by the memory controller 140. When writing or reading data to a particular row r (or page) of the array of DRAM cells 210, the row decoder 220 provides a row enable signal to the row enable line corresponding to the particular row (or page). When writing data, while the particular row (or page) is enabled, voltages corresponding to the data to be written are provided to the bit lines B1-Bm. Similarly, when reading data from a particular row (or page) of the array of DRAM cells 210, a voltage corresponding to the voltage stored on the capacitor 212 is sent along the bit lines B1-Bm and read by an input / output sense amplifier layer 230 (or IOSA) including a sense amplifier 232. Each sense amplifier in sense amplifiers 232 is connected to a corresponding one of the bit lines (e.g., sense amplifiers 232 includes m sense amplifiers). For example, in some embodiments, the array of DRAM cells 210 includes 8,192 columns and 8,192 corresponding bit lines (e.g., bit lines B1-B8192) connected to 8,192 corresponding sense amplifiers 232 (e.g., each page can store 8,192 bits or 8 kilobits of data). Because sense amplifiers 232 store data read from the current row (or page) until cleared by a "precharge" command, sense amplifiers 232 are referred to as "row buffers."

[0050] The column decoder 240 is used to select a subset of the data columns using the multiplexer 234, and the read data is provided to the IMC module 250 via the global IO layer 236 to perform computations on the data. For example, in some embodiments, the column decoder 240 and multiplexer 234 allow the selection of 256 bits (256b) of data from 8,192 columns of DRAM cells 210.

[0051] When loading data from a page of DRAM bank 200 different from the page currently stored in sense amplifiers 232, a "precharge" (PRE) command is used to close the current page and prepare DRAM bank 200 for the next access. An "activate" (ACT) command is then used to open a particular row or page of the DRAM bank and store the data of the opened page in sense amplifiers 232. The data is then read (READ) from sense amplifiers 232 and sent to IMC module 250.

[0052] On the other hand, if data is to be loaded into IMC module 250 from an already open page, then a READ command is sufficient to load the data, for example, by using column decoder 240 to select the appropriate subset of data already stored in sense amplifiers 232 (the PRE and ACT commands may be omitted).

[0053] According to various embodiments, the IMC module 250 (or ALU&Reg) includes an ALU 252 and one or more registers. In the embodiment shown in FIG. 2A, the IMC module 250 includes an operand register (Rop) 254 (or input buffer) and a result register (Rz) 256. Multiplexers 257 and 258 are used to control the flow of data to two inputs of the ALU 252 (e.g., as a first operand and a second operand to the ALU 252). For example, in the embodiment shown in FIG. 2A, the operand register (Rop) 254 is connected to a first operand input of the ALU 252, and a first multiplexer 257 is connected to the operand register (Rop) 254 for writing data from an external source (e.g., a host processor) from the sense amplifiers 232 through the global IO layer 236 or through the input / output (IO) module 260 (or write input / output and read input / output, or WIO and RIO). 2A, a second multiplexer 258 is also configured to provide data directly to a second operand input of ALU 252 from sense amplifiers 232 via global IO layer 236 or from an external source via IO module 260. ALU 252 outputs its calculation to result register (Rz) 256 from which data is either written back to DRAM cells 210 via global IO layer 236 or sent to host processor 170 via IO module 260 (or WIO and RIO).

[0054] In some embodiments, ALU 252 is configured to perform various computational operations (e.g., simple computational commands). For example, ALU 252 is a 16-bit, 32-bit, or 64-bit ALU configured to perform arithmetic, bitwise, shift operations, etc. In various embodiments, ALU 252 includes circuitry to perform integer operations, floating point operations, or both. For example, ALU 252 is configured to perform arithmetic operations such as ADD (+), SUBTRACT (-), MULTIPLY (x), and DIVIDE (÷), bit operations such as AND (&), OR (|), XOR (^), and NOT (~), and tensor operations. Also, in some embodiments, ALU 252 implements single instruction, multiple data (SIMD), or vector instructions to perform operations on vectors of data in parallel. Examples of vector operations implemented by the ALU 252 according to an embodiment of the present invention are dot product ('), cross product ('), and TIFF0007550614000001.tif6128, Rectified Linear Unit (ReLU), Square (vsSqr), and Square Root (vsSqrt). ALU 252 is utilized for atomic and non-atomic operations. Table 1 below lists operations supported by ALU 252 according to some embodiments of the present invention.

[0055] [Table 1]

[0056] FIG. 2C is a schematic diagram of a DRAM bank 200 according to one embodiment of the present invention, including an array of DRAM cells 210 as described above, a row decoder 220, an input / output sense amplifier layer (IOSA) 230, an IMC module (ALU&Reg) 250, and a column decoder 240.

[0057] Figure 3 is a schematic diagram illustrating an array of DRAM blocks according to an embodiment of the present invention. As in the embodiment shown in Figure 3, 16 DRAM banks 200 are arranged in a 4x4 array, labeled as DRAM banks A-P, and arranged into four bank groups labeled as BG0 (including DRAM banks A, B, C, and D), BG1 (including DRAM banks E, F, G, and H), BG2 (including DRAM banks I, J, K, and L), and BG3 (including DRAM banks M, N, O, and P). As described above with respect to Figure 2C, each DRAM bank 200 shown in Figure 3 includes an IMC module 250 for performing computations within the DRAM die 120 (e.g., without passing through an external bus). 3, the DRAM die 120 further includes a multiplexer 300 (e.g., a 4:1 multiplexer) configured to multiplex data from an external source (e.g., via through silicon vias or TSVs connecting the DRAM die 120 to multiple other stacked DRAM dies 120 and the memory controller 140) to the four columns of blocks. For example, the multiplexer 300 may be used to broadcast a 256-bit (256b) data vector to all DRAM banks 200 or to provide a data vector to a particular column (BG0, BG1, BG2, or BG3) of the DRAM banks 200.

[0058] Memory system 100 including an IMC, such as IMC module 250 integrated into DRAM die 120, accelerates the performance of host operations at the memory boundary because data does not have to pass through the bottleneck of an external bus (e.g., bus 190) to perform the operation. However, the IMC still encounters computing overhead in the form of ALU pipelining and DRAM processes, and memory overhead in the form of data placement and DRAM timing.

[0059] Accordingly, aspects of embodiments of the present invention relate to systems and methods for placing data in DRAM to avoid or reduce the impact of DRAM timing overhead when performing in-memory computing with an integrated IMC module 250. Some aspects of embodiments of the present invention relate to the co-design of software and hardware to achieve improved performance.

[0060] In various embodiments, memory controller 140 provides operations to and from DRAM die 120 and manages the input and output of data. Accordingly, some aspects of embodiments of the present invention relate to memory controller 140 configured to arrange data within DRAM die 120 according to instructions provided to memory controller 140 of memory system 100 by host processor 170. For example, some aspects of embodiments of the present invention relate to providing an application programming interface (API) for interacting with an HBM having in-memory computing and a compiler (e.g., a data compiler) configured to generate commands for controlling memory controller 140 to arrange data according to calls to the API when compiling or interpreting source code of a program using the API. For example, the API may provide function calls to perform a general matrix-matrix multiplication (GEMM), and the compiler may generate a sequence of commands to control memory controller 140 to place data representing operand matrices on DRAM die 120 in a manner that improves performance over a naive placement of the data based on the elements, including the operation to be performed on the data (e.g., inner product, outer product, matrix multiplication, etc.), and the size of the data (e.g., whether the data fits into a page of memory). In creating software to use DRAM in the IMC via the API, a compiler or data compiler according to some embodiments of the invention translates at least a portion of the software's source code into commands executed by memory controller 140 to place the data in specific locations on DRAM die 120, control the IMC module to perform the calculations on DRAM die 120, and store the results.

[0061] In one embodiment, a 16 lane ALU achieves a peak performance of 8 GFLOPS (giga floating point operations per second) for half-precision floating-point (FP-16) calculations. (Although the performance of an IMC module according to an embodiment of the invention is described herein in terms of FLOPS, embodiments of the invention are not limited to performing floating point operations, and the relative performance of various data layouts is similar, for example, when performing integer operations.) Thus, an implementation of an IMC according to an embodiment of the invention using a four die (4H or 4-Hi) stack using the second generation high bandwidth memory standard (HBM2) achieves 8 TFLOPS (tera floating point operations per second) for FP-16 calculations (256 banks per die x 4 die stack = 1,024 banks, each bank with a corresponding 16 lane ALU).

[0062] Peak computational performance, measured in TFLOPS, varies under different data layout scenarios. In the first case (denoted as 2OP), two operands from outside the memory module 110 are fully supplied to the in-memory computing ALU, and the result is buffered and fully accumulated, thereby achieving the peak computational performance of 8 TFLOPS mentioned above.

[0063] In the second case (denoted as 1OP), the first operand is supplied entirely to the IMC from outside the HMB, while the second operand is read from any location on the DRAM die 120. This reduces the peak computational performance to approximately 6.5 TFLOPS.

[0064] In the third case (denoted DR), both operands are placed on different pages of DRAM and the result is written back to DRAM. In this scenario, the measured computational performance is about 0.8 TFLOPS (e.g., an order of magnitude slower than the 2OP case).

[0065] In the fourth case (denoted SR), both operands are located in the same row or page of the DRAM block, which results in a significant performance improvement over the DR case, reaching approximately 3.3 TFLOPS.

[0066] Thus, various data layout tradeoffs are made based on data considerations. For example, for 1OP, if the first operand is in DRAM and the second operand is broadcast from outside the HBM, performance is higher (approximately 6.5 TFLOPS as mentioned above), but there is overhead for the host processor 170 to provide the second operand to the HBM.

[0067] FIG. 4A is a schematic diagram illustrating the placement of data relative to a GEMM when a first operand (matrix A) is stored in DRAM and a second operand (matrix B) is broadcast from outside the memory module, along with an integrated IMC according to an embodiment of the present invention. For illustrative purposes, DRAM bank 200-O is shown in more detail. As shown in FIG. 4A, data associated with the first operand matrix A is placed in one page 401 (e.g., the first row or first page) of DRAM bank 200-O, and data associated with the second operand matrix B is broadcast from outside the DRAM die 120 (e.g., via multiplexer 300). The calculation result C is placed in a different page 402 of DRAM bank 200-O.

[0068] When both operands are in DRAM, placing both operands in the same page or same row (SR) improves computational performance (e.g., about 3.3 TFLOPS) by partially reducing the number of PRE and ACT operations that need to be performed, as described in more detail below, but imposes more constraints on placing the data in the correct part of the DRAM.

[0069] FIG. 4B is a schematic diagram illustrating the placement of data relative to a GEMM when both operands (matrix A and matrix B) are stored in the same page of the DRAM of a memory module, along with an integrated IMC according to an embodiment of the present invention. For illustrative purposes, DRAM bank 200-O is shown in more detail. As shown in FIG. 4B, data related to the first operand matrix A and the second operand matrix B are placed in page 411 (e.g., the first row or first page) of DRAM bank 200-O. More specifically, the first half of page 411 is filled with data from the first operand matrix A, and the second half of page 411 is filled with data from the second operand matrix B. Assuming that matrices A and B are the same size as described above with respect to FIG. 4A, an additional page is required to store the remaining data. Thus, data related to both the first operand matrix A and the second operand matrix B are also placed in page 412. The result C of the matrix multiplication is stored in page 413 of DRAM bank 200.

[0070] On the other hand, placing operands on different pages is more flexible and places fewer constraints on the layout (e.g., accommodating data having sizes that do not fit neatly into a page of fixed-size memory), but generally reduces computational performance.

[0071] 4C is a schematic diagram illustrating the placement of data relative to a GEMM when both operands (matrix A and matrix B) are stored in different pages of the DRAM of a memory module, along with an integrated IMC in accordance with one embodiment of the present invention. For purposes of illustration, DRAM bank 200-O is shown in more detail. As shown in FIG. 4C, data associated with a first operand matrix A is placed on page 421, data associated with a second operand matrix B is placed on page 422, and result C is placed on page 423.

[0072] The impact of different data placement strategies (1OP, SR, and DR) shown in Figures 4A, 4B, and 4C on performance will be described in more detail with reference to Figures 5A, 5B, 6A, 6B, 7A, and 7B below. For example, as shown in Figure 5A, matrix A is an MxK matrix and matrix B is a KxN matrix, so that the size of matrix C, which is the product of matrix A and matrix B, is MxN. For illustrative purposes, the following example describes the case of K=5, but the embodiments of the present invention are not limited thereto. In accordance with standard matrix multiplication, the top left value C00 of the result matrix C is calculated by pairwise multiplying the first row of matrix A (where each position Aij represents, for example, a vector or "tile" of 16 half-precision floating-point values ​​in horizontal order; Figures 5A, 5B, 6A, 6B, 7A, and 7B represent A00, A01, A02, A03, and A04) by the first column of matrix B (where each position Bij represents, for example, a vector or "tile" of 16 half-precision floating-point values ​​in vertical order). That is, C00 stores A00·B00+A01·B10+A02·B20+A03·B30+A04·B40. In Figures 5A, 5B, 6A, 6B, 7A, and 7B, a shading operation is used to identify the operands that are multiplied together. More specifically, two operands shaded using the same pattern are multiplied together as part of the illustrated calculation. Although aspects of embodiments of the present invention are described with respect to an IMC configured to perform floating-point operations on floating-point operands, embodiments of the present invention are not so limited and may be applied, for example, to an IMC configured to perform integer operations on integer operands.

[0073] 5A is a schematic diagram of a multiplication of the first row of matrix A by the first column of matrix B in a one operand (1OP) data layout, where one operand is provided externally and one operand is stored in a DRAM bank in in-memory computing according to an embodiment of the present invention. As shown in FIG. 5A, tiles A00, A01, A02, A03, and A04 of the first row of matrix A are stored in the same page 401 (row) of DRAM bank 200, and vectors or tiles B00, B10, B20, B30, and B40 of matrix B are provided externally and the result (e.g., C00) is stored in another page 402 of DRAM bank 200.

[0074] The process of computing the multiplication begins by reading the value A00 from DRAM bank 200 and computing A00·B00. This involves opening page 401, thus requiring a precharge (PRE) command to prepare sense amplifiers 232, followed by an activate (ACT) command to load page 401 into sense amplifiers 232, and a read (READ) command to load the value of A00 from sense amplifiers 232 into IMC module 250. As mentioned above, B00 is provided externally as an input, so no DRAM operations are required to obtain this value. ALU 252 then computes the multiplication A00·B00 and stores the temporary result in an output buffer (e.g., output register Rz).

[0075] Next, ALU 252 calculates the multiplication A01·B10 by reading A01 from DRAM. This also requires a PRE command, an ACT command, and a READ command. As vector or tile B10 is provided externally as an input, A01·B10 is calculated and added to the temporary result in a buffer (e.g., output register Rz) that stores A00·B00. This process is repeated for the remaining values ​​of matrix A and matrix B. As a result, each calculation (e.g., multiplication of two operands such as tiles A00 and B00) requires one PRE, one ACT, and one READ for each calculation. As described in more detail below with respect to FIG. 8, in some embodiments, the IMC further includes an accumulator configured to store a value and update the stored value with the sum of the previously stored value and the newly received value.

[0076] FIG. 5B is a schematic diagram showing the multiplication of the first value of the first row of matrix A with the first value of each column of matrix B in a 1OP data layout with data reuse, where one operand is provided from outside and one operand is stored in the DRAM bank in in-memory computing according to an embodiment of the present specification. FIG. 5B is different from that shown in FIG. 5A in that the data loaded from the DRAM is reused for different columns of matrix B (e.g., stored in the operand register (Rop) 254). In particular, when multiplying two matrices, the j-th element of every row of matrix A is multiplied with every element of the j-th row of matrix B. Thus, by loading each element of matrix A once and multiplying it with every column (N columns) of matrix B, the cost of loading data from the DRAM bank 200 is amortized over N columns. More specifically, when multiplying matrices A and B, tile A00 is read from DRAM bank 200 using PRE, ACT, and READ commands, as in the past, and tile B00 is received externally as an input. ALU 252 calculates A00·B00 to calculate part of the sum C00. However, instead of loading tile A01 from DRAM (e.g., using another PRE, ACT, and READ sequence), tile A00 is reused to multiply B01 (received externally) to calculate A00·B01, which is one of the multiplications to be calculated for C01. As a result, each calculation requires 1 / N PRE, 1 / N ACT, and one READ per calculation (because the PRE and ACT commands to load another part of matrix A are amortized over the N columns of matrix B).

[0077] 6A is a schematic diagram of multiplication of the first row of matrix A with the first column of matrix B in a same row (SR) data layout, where both operands are stored in the same page of a DRAM bank with in-memory computing, according to an embodiment of the present invention. As shown in FIG. 6A, tiles A00, A01, and A02 of the first row of matrix A and tiles B00, B10, and B20 of the first row of matrix B are stored in the same page 411 of DRAM bank 200, and tiles A03 and A04 of matrix A and tiles B30 and B40 of matrix B are stored in page 412 of DRAM bank 200. The result (e.g., C00) is stored in page 413 of DRAM bank 200.

[0078] The process of computing a result (e.g., a dot product) begins by reading tile A00 from DRAM bank 200 and computing A00·B00. This involves opening page 411, thus requiring a precharge (PRE) command, followed by an activate (ACT) command and a read (READ) command to load tile A00 from sense amplifiers 232 into IMC module 250. Tile B00 is read from DRAM. However, because tile B00 is in the same page 411 as A00, and its value is already stored in sense amplifiers 232, a READ command is sufficient (no further PRE and ACT need to be performed to read tile B00 into IMC module 250). Thus, once tiles A00 and B00 are read, ALU 252 computes A00·B00 and stores the temporary result in a buffer. Similarly, reading tiles A01 and B10 to calculate A01·B10 without PRE and ACT is similarly performed using READ commands since tiles A01 and B10 are both also in page 411 and therefore were pre-stored in sense amplifiers 232 when page 411 was first opened to read A00. Thus, each calculation performs 1 / rPRE, 1 / rACT, and 2READ operations per calculation, where r is the number of matching value pairs stored in the same page of DRAM bank 200. For example, as described above, FIG. 6A illustrates the case where tiles A00, A01, and A02 of the first row of matrix A and tiles B00, B10, and B20 of the first row of matrix B are stored in page 411 of the DRAM bank. Thus, calculations A00·B00, A01·B10, and A02·B20 amortize 1 / 3 PRE, 1 / 3 ACT, and 2 READ commands, respectively, because page 411 contains 3 sets of tiles (e.g., r=3). When calculating A03·B30 and A04·B40, such calculations amortize 1 / 2 PRE, 1 / 2 ACT, and 2 READ commands, respectively, because page 412 contains 2 sets of values ​​(e.g., r=2). By reducing the number of PRE and ACT commands required per calculation, overall calculation performance is improved.

[0079] FIG. 6B is a schematic diagram of multiplication with data reuse for the first value of the first row of matrix A and the first value of each column of matrix B in an SR data layout, where both operands according to an embodiment of the present invention are stored in the same page of a DRAM bank with in-memory computing. In a similar manner to the comparison between the arrangements of FIG. 5A and FIG. 5B, the calculation process shown in FIG. 6B differs from that shown in FIG. 6A in that the values ​​loaded from the DRAM are reused. More specifically, based on the fact that matrix multiplication involves multiplication of the i-th element of a specified row of a first operand with the i-th element of each column of a second operand, the elements of matrix A and matrix B are arranged in the DRAM bank 200 such that the data of each element of a specified row of matrix A is located on the same page as the value of the row of matrix B to be multiplied.

[0080] For example, as shown in FIG. 6B, when matrix A is multiplied by matrix B, tile A00 of matrix A is multiplied by the first tile of every column of matrix B (all elements of the first row of matrix B, e.g., B00, B01, B02, B03, B04, B05, ...) in the process of computing a portion of the first row of the result matrix C (e.g., any of the terms C00, C01, C02, C03, C04, C05, ...). Similarly, value A01 of matrix A is multiplied by the second tile of every column of matrix B (all elements of the second row of matrix B, e.g., B10, B11, B12, B13, B14, B15, ...) as shown in FIG.

[0081] In this manner, at least one value of matrix A is stored in the same page as the corresponding value of matrix B. In the particular example shown in FIG. 6B, page 411 stores tile A00 from matrix A and tiles B00, B01, B02, B03, B04, B05, ... from matrix B, and page 412 stores tile A01 from matrix A and tiles B10, B11, B12, B13, B14, B15, ... from matrix B. With such an arrangement of data in DRAM, assuming a page of DRAM stores at least N+1 entries, each calculation performs 1 / N PRE commands, 1 / N ACT commands, and (N+1) / N READ commands (because the PRE and ACT commands are amortized over the N columns of matrix B).

[0082] 7A is a schematic diagram of a multiplication of the first row of matrix A by the first column of matrix B in a differential row (DR) data layout, where the operands are stored in different pages of a DRAM bank in in-memory computing according to an embodiment of the present invention. As shown in FIG. 7A, tiles A00, A01, A02, A03, and A04 of the first row of matrix A are stored in page 421, while tiles B00, B10, B20, B30, and B40 of the first column of matrix B are stored in another page 422.

[0083] Because tile B00 is on a different page 422 (row) than tile A00, the process of calculating C00 begins by calculating A00·B00 by reading tile B00 using a sequence of PRE, ACT, and READ commands, and then reading A00 from page 421 (row) of DRAM bank 200 using a sequence of PRE, ACT, and READ commands. ALU 252 calculates A00·B00 and stores the result in a temporary buffer. To continue the C00 calculation, tile A01 is read from page 421 (row) and B10 is read from page 422 (row), where each value involves performing a PRE, ACT, and READ sequence for DRAM bank 200.

[0084] 7B is a schematic diagram of data reuse multiplication of a first value in a first row of matrix A by a second value in each column of matrix B with a first value in each column of matrix B and a second value in a first row of matrix A in a DR data layout, where operands are stored in different pages of a DRAM bank in in-memory computing according to one embodiment of the present invention.

[0085] In a manner similar to that described in Figure 5B and data reuse in 1OP, the number of memory operations is reduced by reusing data taken from matrix A when performing multiplication with matrix B. As described in Figure 7A, each i-th value of a specified row of matrix A is multiplied with each value of the i-th row of matrix B. Thus, when all values ​​of a specified row of matrix B are stored in the same page of DRAM bank 200, the number of PRE and ACT commands is reduced, thereby improving performance.

[0086] For example, the process of multiplying matrix A by matrix B begins by multiplying tile A00 of matrix A by each of the N tiles (B00, B01, B02, ..., B0N) of the first row of matrix B to calculate N partial sums (e.g., portions of C00, C01, C02, ..., C0N). The process begins by loading tile A00 from DRAM bank 200. This includes a PRE command, an ACT command, and a READ command to open page 421 (row) and load tile A00 of matrix A into operand register (Rop) 254. After loading A00, tiles B00, B01, B02, ..., B0N of the first row of matrix B are loaded to be multiplied with tile A00. As shown in FIG. 7B, if all these values ​​of matrix B are on the same page (e.g., B00, B01, B02, B03, B04, ... are on page 422 of DRAM bank 200 shown in FIG. 7B), the PRE and ACT commands used to access this page are amortized over the N values ​​stored on that page. Thus, multiplying one value of matrix A by all the values ​​of one row of matrix B requires two PRE commands, two ACT commands, and N+1 READ commands, and amortizing the N values ​​of the row generates 2 / N PRE commands, 2 / N ACT commands, and (N+1) / N READ commands per calculation. In a similar manner to the above example, the reduction in the number of DRAM commands improves overall computational performance (e.g., matrix multiplication operations).

[0087] The above data placement options were experimentally tested using a cycle-level high-bandwidth memory-function-in-memory (HBM-FIM) simulator, which was customized for IMC with GEMM recordings. The experimental architecture included an HBM with four 4H HBM2 modules, where the DRAM array size was 16,384 (16Kib) rows by 8,192 (8Kib) columns (e.g., each page size was 8,192b) and the row buffer size was 8,192 bits (8Kib). The IMC module included a 16-lane FP-16 vector unit with latency period and a 768-bit buffer, allowing pipelined operation. In various embodiments, the buffer may be smaller (e.g., a 512-bit buffer with a 256-bit input buffer and a 256-bit output buffer) or larger (e.g., a 1,280-bit buffer with a 256-bit input buffer and a 1,024-bit output buffer). In some embodiments, the input buffer is larger than 256 bits (eg, 512 bits).

[0088] Some aspects of embodiments of the present invention relate to the inclusion of additional buffers and accumulators at the level of the DRAM bank 200 (eg, additional hardware provided per bank at the DRAM bank).

[0089] 8 is a schematic block diagram of an IMC module of a DRAM bank, where the IMC module is further connected to a result buffer, an accumulator, and a buffer according to one embodiment of the present invention.

[0090] As shown in Figure 8, ALU 252 receives an input operand A (depicted in Figure 8 as 256-bit operand A[0:255]) and an input operand B (depicted in Figure 8 as 256-bit operand B[0:255]). The ALU performs an operation on the two input operands (e.g., addition, multiplication, dot product, cross product, etc.) to compute a result C (depicted in Figure 8 as 256-bit result C[0:255]).

[0091] 8, the IMC module 250 further includes an accumulator 802 coupled to the output of the ALU 252. For example, the output of the ALU 252 is coupled to both the result register (Rz) 256 and the accumulator 802, and a result C is stored in the result register (Rz) 256 and provided to the accumulator 802. The accumulator 802 includes an accumulator register that stores an accumulated value (e.g., a 256-bit value). When the accumulator 802 receives a new result from the ALU 252, the new result is added (e.g., accumulated) to the accumulated value already stored in the accumulator register (e.g., the value stored in the accumulator register of the accumulator 802 is updated or set as the sum of the new result and the value previously stored in the accumulator 802). In some embodiments, the accumulator 802 is configured to reset the accumulator register (e.g., set the accumulated value stored in the accumulator register to zero) in response to a reset command. Accumulator 802 is particularly useful when calculating inner products (inner products or dot products), such as when calculating matrix multiplication (e.g., where each value in the result matrix is ​​the dot product of a row of a first operand and a column of a second operand). In the embodiment shown in FIG. 8, IMC module 250 further includes a 1,024-bit output buffer, shown as a 512-bit first buffer 812 and a 512-bit second buffer 814. A larger output buffer that stores multiple result values ​​allows memory controller 140 to control a DRAM bank to calculate multiple results at once before opening another page of the DRAM bank to store the results. For example, when reusing data in an SR data layout as shown in FIG. 6B, one value in the first operand matrix A is multiplied by a different value corresponding to a row of the second operand matrix B to calculate a partial sum written to another page (e.g., page 413 shown in FIGS. 6A and 6B) of the DRAM bank 200 that is different from the page storing the operand (e.g., page 411 shown in FIGS. 6A and 6B) that further requires PRE and ACT commands to open the page to store the result.However, a larger output buffer reduces the amount of page switches required to complete an operation (because each page switch requires a PRE and an ACT), and therefore improves computational performance. Although FIG. 8 shows IMC module 250 having both an accumulator 802 and a larger output buffer (812, 814), embodiments of the invention are not so limited and include embodiments in which IMC module 250 includes accumulator 802 without additional output buffers 812 and 814, as well as embodiments in which IMC module 250 includes additional output buffers 812 and 814 without accumulator 802. In some embodiments of the invention, IMC module 250 includes multiple accumulators 802 arranged in parallel (e.g., such that multiple values ​​are accumulated simultaneously). Embodiments of the invention are also not limited to having two 512-bit output buffers 812 and 814, and include output buffers larger or smaller than 512 bits and / or more than or less than two. Various portions of IMC module 250 have different amounts of latency. For example, an ALU 252 performing a multiply operation introduces a four cycle latency, while an accumulate operation involves a one cycle latency.

[0092] Aspects of embodiments of the invention are described in more detail below with respect to implementing GEMM.

[0093] FIG. 9 is a schematic diagram of an example of a GEMM to illustrate a computation using a same row (SR) layout, according to some embodiments of the present invention. More specifically, FIG. 9 illustrates the multiplication of matrix A and matrix B, and updating a result C stored in an accumulator (e.g., accumulator 802) by adding the product of matrix A and matrix B to the value currently stored in accumulator 802 (result C+=matrix A×matrix B). In the computation illustrated in FIG. 9, 16 tiles of matrix A and 16 tiles of matrix B are multiplied together, where each tile has 16 FP-16 elements (256 bits). The composition layout of a particular internal tile is described in more detail below, but the overall complexity of the GEMM is similar for different layouts. As illustrated in FIG. 9, tiles shaded with similar patterns are tiles that are multiplied together. 9 shows the same row (SR) data layout, where all 32 values ​​of matrix A and matrix B are stored in the same page 414 of DRAM bank 200, and the operands of each calculation (e.g., tile A00, and tiles B00, B01, B02, and B03) are all stored in the same page 414. The results of each calculation are accumulated in result register (Rz) 256 to calculate result C.

[0094] As one specific example of tile-level multiplication, when calculating the dot product (inner products or dot products) of two tiles A00 and B00 loaded from the same page of DRAM bank 200, tile A00 is the dotted tile B00 of matrix B. In some embodiments, as described above, each tile includes 16 FP-16 elements. For example, tile A00 includes elements a00, a01, ..., a15, tile B00 includes elements b00, b01, ..., b15, and the dot product of tiles A00 and B00 is the sum of the product pair (= a00 x b00 + a01 x b01 + ... + a15 x b15). Thus, since the dot product (inner products or dot products) of two tiles produces a single element or a single value, an IMC module according to an embodiment of the present invention calculates the dot product with fewer buffer registers (e.g., accumulator register 802) to store the results. As such, an IMC module according to some embodiments of the present invention that includes an accumulator register is well suited for performing calculations that involve accumulating values, such as calculating dot products. In some embodiments, an IMC module that includes an accumulator suitable for calculating dot products is used to perform inference (or forward propagation) using a trained neural network, where a first operand represents an input (e.g., activations from a previous layer) and a second operand represents weights associated with neurons of a layer of the trained neural network.

[0095] As another example of tile-level multiplication, when computing the cross product of two tiles loaded from the same page of DRAM bank 200, all values ​​of the first tile are multiplied with all values ​​of the second tile to load the two tiles simultaneously. For example, as described above, if each tile contains 16 values, the cross product of two tiles has 16×16=256 output values. The cross product can be computed with simpler hardware than the inner product because no tree-adder accumulation is required and the 256 output values ​​are computed in parallel. However, computing the cross product requires many output buffer registers (e.g., output buffers 812 and 814) in IMC module 250 according to embodiments of the invention (e.g., to store all values ​​resulting from the cross product). For example, assuming each tile contains up to 16 FP-16 values, IMC module 250 configured to compute the cross product includes an output buffer large enough to store 256 values ​​(e.g., a 256×16 bit=4,096 bit buffer). Thus, an IMC module according to some embodiments of the present invention that includes an output buffer is suitable for performing calculations including a cross product of operands having a size that stores a size greater than or equal to the product of the number of values ​​in tiles of the first and second operands (in the above example, each tile of the operand contains 16 values, so that the output buffer stores at least 256 values).

[0096] As a third example of tile-level multiplication, when computing a tensor product of two tiles loaded from the same page of the DRAM bank 200, the two tiles contain values ​​arranged in a matrix. For example, if each tile contains 16 FP-16 values, each tile is arranged in a 4×4 matrix of values. Computing the tensor product of the tiles produces a 4×4 result matrix. For example, assuming each tile contains up to 16 FP-16 values, an IMC module 250 configured to compute a tensor product of two 4×4 tiles of 16 values ​​has an output buffer large enough to store 16 values ​​(e.g., a 16×16 bit=256 bit buffer). Thus, an IMC module according to an embodiment of the present invention is suitable for performing computations (including tensor products of operands) that include an output buffer large enough to store a number of values ​​equal to the number of values ​​of the larger of the first and second operands. An IMC module implementing a tensor product according to an embodiment of the present invention represents a middle ground with simpler hardware and an intermediate number of buffer registers compared to IMC module hardware suitable for computing inner products and cross products.

[0097] More specifically, implementing a tensor product between two 4×4 matrices A and B involves 64 multiplication operations, 48 ​​addition operations, and a transpose on matrix A / matrix B. When using a 16-lane e-ALU 252 according to one embodiment of the present invention, 16 operations are performed in parallel. These 64+48=112 operations are performed in 7 cycles of the ALU (assuming one cycle to perform the multiplication). In another embodiment of the present invention, to improve performance, a 64-lane ALU 252 is used to calculate a tensor product of two tiles representing two 4×4 matrices in 2-3 cycles or 4-6 nanoseconds. Thus, increasing the number of lanes in the ALU 252 increases the amount of parallelism possible between calculations, improving performance.

[0098] Accordingly, aspects of an embodiment of the present invention relate to a system and method for data placement in a DRAM system with in-memory computing. In the above three examples of computing the dot product, cross product, and tensor product for a SR (single page) data layout, a single row includes a first tile with row data (of a matrix) on the same page as a second tile with column data (of a matrix).

[0099] According to some embodiments of the invention, memory controller 140 (or a client-side memory controller) of memory module 110 controls the placement of data (operands) received from host processor 170 according to instructions received from host processor 170. For example, based on whether the instruction is to calculate a dot product, a cross product, or a tensor product, and based on the size of the operands (e.g., matrix dimensions), memory controller 140 uses a 1OP, SR, or DR data layout and controls the DRAM banks to store the data accordingly.

[0100] 10 is a flow chart illustrating a method for controlling placement of data in a DRAM bank having an IMC module, according to an embodiment of the present invention. In step S1110, memory controller 140 receives operands (e.g., a first operand and a second operand) and instructions (e.g., a function) to be applied to the operands. For example, these instructions may include computing a dot product, a cross product, performing inference using a trained neural network and an input vector, performing steps of a backpropagation algorithm to train a neural network, etc.

[0101] In step S1130, memory controller 140 determines, based on the instruction, which data layout (e.g., 1OP, SR, or DR) to use to store one or both operands in a DRAM bank on the DRAM die. In some embodiments, the instruction (e.g., from host memory controller 180) explicitly specifies which data layout to use. In some embodiments, the layout is selected based on the type of calculation to be performed and the memory or hardware requirements to accelerate such calculations in the DRAM bank (e.g., an instruction to calculate a dot product will place data in a DRAM bank with an accumulator, whereas an instruction to calculate a cross product will place data in a DRAM bank with more output buffers).

[0102] In step S1150, memory controller 140 provides the first and second operands to the DRAM bank based on the selected data layout. As an example, in the case of 1OP, memory controller 140 controls DRAM bank 200 to store at least a first tile of the first operand and provide a second tile of the second operand directly to the IMC module of the DRAM bank. As another example, in the case of SR, memory controller 140 controls DRAM bank 200 to store tiles corresponding to the first and second operands in the same row or the same page of the DRAM bank.

[0103] In step S1170, memory controller 140 controls the IMC modules of DRAM bank 200 to perform an operation based on the input instruction. For example, for an instruction to perform inference using a trained model, the operation includes preparing an input vector based on one operand and weighting the value of the input vector based on a parameter stored in a second operand.

[0104] Although specific exemplary embodiments are presented in this specification, the present invention is not limited to the disclosed embodiments, and various modifications can be made without departing from the spirit and technical scope of the present invention. [Explanation of symbols]

[0105] 100:Memory system 110: Memory module 120: DRAM die 130: Internal memory bus 140: Memory controller 170: Host processor 180: Host memory controller 190: External bus 200: DRAM bank 210: DRAM cell 212: Capacitor 214: Switch 220: Row decoder 230: Input / Output Sense Amplifier Layer (IOSA) 232: Sense amplifier 234: Multiplexer 236: Global IO Layer 240: Column Decoder 250: IMC module (ALU&Reg) 252: ALU 254: Operand register (Rop) 256: Result register (Rz) 257: First multiplexer 258: Second multiplexer 260: Input / Output (IO) Module 300: Multiplexer Pages 401, 402, 411, 412, 413, 421, 422, 423 802 Accumulator 812 First Buffer 814 Second Buffer

Claims

1. 1. A memory module comprising: a memory die including a dynamic random access memory (DRAM) bank; a memory controller for receiving operands and instructions from a host processor; The DRAM bank includes: an array of DRAM cells arranged in a plurality of pages; an in-memory computing (IMC) module including an arithmetic logic unit (ALU); The memory controller includes: determining, based on the instruction, from among a plurality of data layouts, a data layout for specifying placement of the operands from the plurality of pages of the array of DRAM cells to the IMC module; providing the operands to the DRAM banks in accordance with the determined data layout; configured to control the IMC module of the DRAM bank to perform an operation by the ALU on the operand in accordance with the instruction; the IMC module further includes an operand register; the operands include a first operand and a second operand; When one operand (1OP) data layout is determined from the plurality of data layouts, the first operand is provided to the IMC module from outside the DRAM bank; The second operand is supplied from the DRAM cell to the IMC module via the operand register.

2. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, The memory controller includes: storing a first tile of the first operand in the operand register; 2. The memory module of claim 1, further configured to perform an operation by the ALU on a first tile of the first operand and each of a plurality of second tiles of the second operand stored in the operand register.

3. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, When the same page (SR) data layout is determined from the plurality of data layouts, 2. The memory module of claim 1, wherein the memory controller is configured to store one or more of the first tiles and one or more of the second tiles in the same page of the DRAM cells.

4. The memory controller includes: storing a first tile among the one or more first tiles in the operand register; 4. The memory module of claim 3, further configured to perform an operation by the ALU on the first tile stored in the operand register and each of the one or more second tiles stored in the same page as the first tile of the array of DRAM cells.

5. the IMC module of the DRAM bank further includes an accumulator; the accumulator includes an accumulator register configured to store an accumulated value; The accumulator comprises: Receive the output calculated by the ALU; configured to update the accumulator register with a sum of the accumulated value and the output; the instruction includes computing a dot product of the first operand and the second operand; a first tile among the first tiles stores row data; 5. The memory module of claim 4, wherein one of the second tiles includes column data.

6. the first tile having a first number of values; the second tile having a second number of values; the IMC module of the DRAM bank includes an output buffer; the output buffer has a size to store a value equal to or greater than the product of the value of the first number and the value of the second number; the instruction includes computing a cross product of the first operand and the second operand; a first tile among the first tiles stores row data; 5. The memory module of claim 4, wherein one of the second tiles includes column data.

7. the first tile having a first number of values; the second tile having a second number of values; the IMC module of the DRAM bank includes an output buffer; the output buffer has a size to store at least the greater of the first and second numerical values; the instructions include computing a tensor product of the first operand and the second operand; a first tile among the first tiles stores row data; 5. The memory module of claim 4, wherein one of the second tiles includes column data.

8. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, When a different page (DR) data layout is determined from the plurality of data layouts, The memory controller includes: storing a subset of the first tiles in a first page of the array of DRAM cells; 2. The memory module of claim 1 configured to store a subset of the second tiles in a second page of the array of DRAM cells.

9. The memory controller includes: storing a first tile of the first operand from the first page in the operand register; 9. The memory module of claim 8, further configured to perform an operation by the ALU on a first tile of the first operand stored in the operand register and each of a plurality of second tiles of the second operand from the second page.

10. 2. The memory module of claim 1, wherein the IMC module of the DRAM bank further comprises a hardware buffer configured to buffer an output computed by the ALU.

11. 11. The memory module of claim 10, wherein the hardware buffer has a size that is at least four times the size of the result register of the IMC module.

12. the IMC module of the DRAM bank further includes an accumulator; the accumulator includes an accumulator register configured to store an accumulated value; The accumulator comprises: Receive the output calculated by the ALU; 2. The memory module of claim 1 configured to update the accumulator register with a sum of the accumulated value and the output.

13. the memory module is a high bandwidth memory (HBM) module including a stack of memory dies connected by through silicon vias; 2. The memory module of claim 1, wherein the stack of memory dies includes the memory die.

14. 1. A method for performing in-memory computation, comprising: receiving, by a memory controller of the memory module, operands and instructions from a host processor; determining, by the memory controller, a data layout from among a plurality of data layouts based on the instruction; providing the operands to dynamic random access memory (DRAM) banks of the memory module in accordance with the determined data layout; and controlling an in-memory computing (IMC) module of the DRAM bank to perform an arithmetic logic unit (ALU) operation on the operands in accordance with the instruction; The DRAM bank includes: an array of DRAM cells arranged in a plurality of pages; the IMC module including the ALU; the data layout specifies placement of the operands from the multiple pages of the array of DRAM cells into the IMC module; the IMC module further includes an operand register; the operands include a first operand and a second operand; When one operand (1OP) data layout is determined from the plurality of data layouts, the first operand is provided to the IMC module from outside the DRAM bank; the second operand is provided from the DRAM cell through the operand register to the IMC module.

15. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, The memory controller includes: storing a first tile of the first operand in the operand register; 15. The method of claim 14, further comprising: performing an operation by the ALU on a first tile of the first operand and each of a plurality of second tiles of the second operand stored in the operand register.

16. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, When the same page (SR) data layout is determined from the plurality of data layouts, 15. The method of claim 14, wherein the memory controller is configured to store one or more of the first tiles and one or more of the second tiles in the same page of the DRAM cells.

17. The memory controller includes: storing a first tile among the one or more first tiles in the operand register; 17. The method of claim 16, further comprising: performing an operation by the ALU on the first tile stored in the operand register and each of the one or more second tiles stored in the same page as the first tile of the array of DRAM cells.

18. the IMC module of the DRAM bank further includes an accumulator; the accumulator includes an accumulator register configured to store an accumulated value; The accumulator comprises: Receive the output calculated by the ALU; configured to update the accumulator register with a sum of the accumulated value and the output; the instruction includes computing a dot product of the first operand and the second operand; a first tile among the first tiles stores row data; 20. The method of claim 17, wherein a second tile of the second tiles includes column data.

19. the first tile having a first number of values; the second tile having a second number of values; the IMC module of the DRAM bank includes an output buffer; the output buffer has a size to store a value equal to or greater than the product of the value of the first number and the value of the second number; the instruction includes computing a cross product of the first operand and the second operand; a first tile among the first tiles stores row data; 20. The method of claim 17, wherein a second tile of the second tiles includes column data.

20. the first tile having a first number of values; the second tile having a second number of values; the IMC module of the DRAM bank includes an output buffer; the output buffer has a size to store at least the greater of the first and second numerical values; the instructions include computing a tensor product of the first operand and the second operand; a first tile among the first tiles stores row data; 20. The method of claim 17, wherein a second tile of the second tiles includes column data.

21. the first operand is divided into a plurality of first tiles; the second operand is divided into a plurality of second tiles; Each tile contains multiple values, When a different page (DR) data layout is determined from the plurality of data layouts, The memory controller includes: storing a subset of the first tiles in a first page of the array of DRAM cells; 15. The method of claim 14 configured to store the second subset of tiles in a second page of the array of DRAM cells.

22. The memory controller includes: storing a first tile of the first operand from the first page in the operand register; 22. The method of claim 21 further comprising performing an operation by the ALU on a first tile of the first operand stored in the operand register and each of a plurality of second tiles of the second operand from the second page.

Citation Information

Patent Citations

  • Method and apparatus for data processing

    JP1994215160A

  • Storage device

    JP2003272384A

  • SIMD (single instruction multiple data) and memory array structure for the same

    JP2008123479A

  • Information processing apparatus, information processing system, information processing method, and information processing program

    JP2019028572A

  • Method of processing in-memory command, high-bandwidth memory (HBM) implementing the same, and HBM system

    JP2019075101A