Storage device for processing in memory and operating method of storage device
By performing zero parity or vector data-based PIM operations in memory, the problem that random access memory cannot perform multiple element accumulation operations when receiving vector input is solved, reducing data communication volume and improving processing performance.
Patent Information
- Application Number
- CN202311616189.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-29
- Filing Date
- 2023-11-29
- Publication Date
- 2024-10-01
AI Technical Summary
When random access memory performs processing-in-memory (PIM) operations, it cannot perform accumulation operations between multiple elements when receiving vector inputs, resulting in increased data traffic between the host and the memory.
Provide a storage device and an operation method that utilize multiple memory chips and logic circuits to process data by performing zero parity or PIM operations based on vector data, or only performing PIM operations on part of the scalar data received from a host.
The data communication volume between the memory and the host is reduced, the power consumption of the memory is reduced, and the processing performance is improved.
Smart Images

Figure CN118732937A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims the priority of Korean Patent Application No. 10-2023-0041484 filed on March 29, 2023 in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference in its entirety. Technical Field
[0003] Embodiments of the present disclosure described herein relate to a semiconductor device, and more particularly, to a memory device and an operating method of the memory device that performs a processing operation in a memory based on a vector input or a scalar input. Background Art
[0004] The RAM directly performs some of the computations of the CPU which is called Processing in Memory (PIM). Since the RAM performs some of the computations directly, the communication between the CPU and the RAM can be reduced and the bottleneck can be eliminated.
[0005] To perform the PIM operation, the random access memory may receive a vector input from the host. When the random access memory receives only the vector input, the host may need to perform an accumulation operation between multiple elements included in the vector input because the random access memory cannot perform an accumulation operation between multiple elements. In this case, the amount of data communication between the random access memory and the host increases. Summary of the invention
[0006] Embodiments of the present disclosure provide a storage device and an operating method of the storage device that performs a PIM operation based on vector data or performs a PIM operation on only a portion of scalar data among scalar data received from a host through zero check.
[0007] According to some embodiments, a storage device includes a plurality of memory chips. Each of the plurality of memory chips includes a plurality of memory banks, each of the plurality of memory banks includes: a memory cell array, the memory cell array including a plurality of memory cells electrically connected to a plurality of word lines; a row decoder, the row decoder electrically connected to the memory cell array through the plurality of word lines; and a sense amplifier and a write driver, the sense amplifier and the write driver electrically connected to the memory cell array through a plurality of bit lines; and a logic circuit, the logic circuit electrically connected to the plurality of memory banks, and based on a plurality of corresponding commands and a plurality of corresponding addresses received from a host, reads data from the plurality of memory banks or writes data to the plurality of memory banks. In a first operation mode, the logic circuit writes first data to the plurality of memory banks based on a first command and a first address received from the host, and performs a first in-memory processing (PIM) operation based on a third data received from the host and the first data. In a second operation mode, the logic circuit writes second data into the plurality of memory banks based on the first command and the first address received from the host, and performs a second PIM operation based on fourth data different from the third data received from the host and the second data.
[0008] According to some embodiments, a method for operating a storage device, the storage device includes a plurality of memory chips, each of the plurality of memory chips includes a plurality of storage units, the method including: in a first operating mode, causing a logic circuit included in the storage device to perform operations including the following: recording first data at the plurality of storage units based on a first command and a first address received from a host; and performing a first PIM operation based on third data received from the host and the first data read based on a second command and a second address received from the host; and in a second operating mode, causing the logic circuit to perform operations including the following: recording second data at the plurality of storage units based on the first command and the first address; generating an index when fourth data is received from the host; generating a weight address based on the index in response to the second command and the second address; and performing a second PIM operation based on the fourth data and the second data read in response to the second command and the weight address.
[0009] According to some embodiments, an operating method including a storage device includes a plurality of memory chips, each of the plurality of memory chips includes a plurality of storage units, the method including: in a first operating mode, causing a logic circuit included in the storage device to perform operations including the following: recording first data at the plurality of storage units based on a first command and a first address received from a host; and performing a first PIM operation based on third data received from the host and the first data read in response to a second command and a second address received from the host, and in a second operating mode, causing the logic circuit to perform operations including the following: recording second data at the plurality of storage units based on the first command and the first address; receiving fourth data from the host; generating an index when the fourth data includes a non-zero value; generating a weight address based on the index in response to the second command and the second address; and performing a second PIM operation based on the fourth data and the second data read in response to the second command and the weight address. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other objects and features of the present disclosure will become apparent by describing embodiments of the present disclosure in detail with reference to the accompanying drawings.
[0011] Figure 1 is a block diagram illustrating an electronic device according to some embodiments of the present disclosure.
[0012] Figure 2 is a diagram showing in detail the configuration of a storage device in an electronic device.
[0013] Figure 3 is a diagram showing the arrangement of multiple memory banks and multiple PIM components in one memory chip.
[0014] Figure 4 FIG. 1 is a diagram showing in detail the configuration of a PIM component connected to a plurality of memory banks.
[0015] Figure 5 is a diagram showing in detail the configuration of a single instruction multiple data floating point unit (SIMD FPU) included in the PIM section.
[0016] Figure 6 is a diagram illustrating some embodiments of weight programming in a first mode of operation.
[0017] Figure 7 is a diagram illustrating some embodiments of performing a first PIM operation on an input vector of each of a plurality of memory banks constituting a matrix or included in a matrix in a first operation mode.
[0018] Figure 8is a diagram showing a configuration of a PIM component operating in a first operation mode.
[0019] Fig. 9 is a diagram illustrating some embodiments of performing a first PIM operation in a first operating mode.
[0020] Fig.10 is a diagram showing an arrangement of elements for performing a first PIM operation in a first operation mode.
[0021] Fig.11 is a diagram illustrating some embodiments of weight programming in a second mode of operation.
[0022] Fig.12 is a diagram illustrating some embodiments of performing a second PIM operation on a scalar input to each of a plurality of memory banks constituting or included in a matrix in a second operating mode.
[0023] Fig.13 is a diagram showing a configuration of a PIM component operating in a second operation mode.
[0024] Fig.14 is a diagram illustrating a first embodiment of performing a second PIM operation in a second operation mode.
[0025] Fig.15 is a diagram illustrating a second embodiment of performing a second PIM operation in a second operation mode.
[0026] Fig.16 is a diagram showing an arrangement of elements for performing a second PIM operation in a second operation mode.
[0027] Fig.17 is a diagram showing some embodiments of implementing a matrix with multiple channels.
[0028] Fig.18 is a flow chart of an operating method of a storage device performing weight programming differently according to an operating mode.
[0029] Fig.19 is a flowchart illustrating an operating method of a memory device performing a first PIM operation in a first operating mode.
[0030] Fig. 20 The present invention is a flowchart of a method for a storage device to perform an operation of reading a weight corresponding to a scalar input in a second operation mode.
[0031] Fig.21 is a flow chart of an operating method of a storage device performing a second PIM operation in a second operating mode. DETAILED DESCRIPTION
[0032] Hereinafter, embodiments of the present disclosure will be described in detail and clearly to such an extent that a person having ordinary skill in the art can easily practice the present disclosure.
[0033] Figure 1 is a block diagram showing an electronic device 1000 according to some embodiments of the present disclosure. Figure 1 , the electronic device 1000 may include a storage device 100 , a host 10 , a storage controller 11 and an interposer 13 .
[0034] The memory device 100 may include first to third memory dies (HBM DRAM dies) 121 to 123 and a logic die 110. The first to third memory dies 121 to 123 may be sequentially stacked on the logic die 110 in a vertical direction.
[0035] The first to third memory dies 121 to 123 and the logic die 110 may be electrically connected to each other through through silicon vias (TSVs) and micro bumps arranged in a matrix form. However, the positions of the through silicon vias and the micro bumps are not limited to Figure 1 The example shown in .
[0036] The first to third memory dies 121 to 123 may be manufactured with the same or similar structure / configuration. Figure 1 , an example in which the number of memory dies included in the memory device 100 is 3 is shown, but the number of memory dies is not limited thereto. In some embodiments, a memory die may also be referred to as a “core die” or a “slave die”, and a die may also be referred to as a “chip”.
[0037] The logic die 110 may communicate with a device located outside the storage device 100. For example, the device may be the host 10. In some embodiments, the host 10 may be referred to as a "system on chip (SoC)". The logic die 110 may include a second physical layer (PHY2) 111 electrically connected to the host 10, and may communicate with the host 10 based on the second physical layer 111.
[0038] The logic die 110 may provide addresses and data transmitted from the host 10 to the first to third memory dies 121 to 123. The logic die 110 may receive data from the first to third memory dies 121 to 123.
[0039] The logic die 110 may provide an interface between the first to third memory dies 121 to 123 and the host 10. The logic die 110 may be referred to as an "interface die," a "master die," or a "buffer die."
[0040] The memory device 100 may be a general DRAM device such as DDR SDRAM (double data rate synchronous dynamic random access memory), DDR2 SDRAM, DDR3 SDRAM, DDR4 SDRAM, or DDR5 SDRAM. The memory device 100 may be a mobile DRAM device such as LPDDR (low power double data rate) SDRAM, LPDDR2 SDRAM, LPDDR3 SDRAM, LPDDR4 SDRAM, LPDDR4X SDRAM, or LPDDR5 SDRAM. However, Figure 1 The storage device 100 shown in FIG. 1 is not limited thereto.
[0041] The host 10 may include a processor (not shown) capable of performing various operations (or calculations) for the purpose of applications supported by the electronic device 1000. For example, the host 10 may include at least one of a CPU (Central Processing Unit), an ISP (Image Signal Processing Unit), a DSP (Digital Signal Processing Unit), a GPU (Graphics Processing Unit), a VPU (Visual Processing Unit), and an NPU (Neural Processing Unit).
[0042] The host 10 may include a memory controller 11 and a first physical layer (PHY 1) 12 electrically connected to the logic die 110, and may communicate with the logic die 110 based on the first physical layer 12. The host 10 may store data required for operation in the storage device 100, or may read data required for operation from the storage device 100. However, the location of the memory controller 11 is not limited to Figure 1 The example shown in .
[0043] The adapter 13 may connect the storage device 100 and the host 10. In detail, the adapter 13 may provide a physical path connecting the storage device 100 and the host 10, and may be formed by using a conductive material for electrical connection. For example, the adapter 13 may be a silicon adapter. However, Figure 1 The adapter 13 shown in FIG. 1 is not limited thereto.
[0044] Figure 2 2 is a diagram showing in detail the configuration of the memory device 200 in the electronic device 2000. In some embodiments, the memory device 200 may correspond to one HBM DRAM die 121. Figure 2 , the electronic device 2000 may include a host 20 , a memory controller 21 , and a storage device 200 .
[0045] The host 20 including the memory controller 21 may send a command CMD and an address ADDR to the memory device 200. In some embodiments, the host 20 may send a command CMD and an address ADDR to the memory device 200 through the memory controller 21. The host 20 including the memory controller 21 may exchange a data signal DQ with the memory device 200. The data signal DQ transmitted from the host 20 to the memory device 200 may include a weight to be programmed in the memory device 200.
[0046] In the following description, a description will be given of the case where the host 20 including the memory controller 21 transmits the command / address signal CMD / ADDR to the memory device 200 .
[0047] For example, the host 20 may transmit a write command, an address, and a data signal DQ to the memory device 200. The memory device 200 may record data at a memory cell corresponding to the write command and the address received from the host 20.
[0048] For example, the host 20 may transmit a read command and an address to the memory device 200. The memory device 200 may transmit data read from a memory cell corresponding to the read command and the address received from the host 20 to the host 20 as a data signal DQ.
[0049] For example, before sending a read command and an address to the storage device 200, the host 20 may store a PIM instruction set PIMIS in the storage device 200. The PIM instruction set PIMIS may include at least one of various setting commands defined by the standard. The PIM instruction set PIMIS may include information about operators and registers.
[0050] Later, information included in the PIM instruction set PIMIS will be described in detail. In the following specification, a description will be given of the PIM instruction set PIMIS being stored in the storage device 200.
[0051] The memory device 200 may perform a PIM operation based on a command and an address (CMD, ADDR) received from the host 20. Later, a configuration for performing a PIM operation will be described in detail.
[0052] The storage device 200 may be a dynamic random access memory (DRAM), but the present disclosure is not limited thereto. The storage device 200 may be one of various random access memories such as SRAM (static random access memory), MRAM (magnetic RAM), PRAM (phase change RAM), FRAM (ferroelectric RAM), and RRAM (resistive RAM).
[0053] The memory device 200 may include a plurality of memory chips. However, for convenience, a description will be given based on one memory chip 210. The remaining memory chips that are not disclosed may include the same components as the memory chip 210.
[0054] The memory chip 210 may include a plurality of memory banks 220, a data input / output block 230, a buffer block 240, and a logic circuit 250. Each of the plurality of memory banks 220 may include a memory cell array (MCA) 221, a row decoder (RD) 222, a sense amplifier and write driver (SA / WD) 223, and a column decoder (CD) 224.
[0055] The memory cell array 221 may include a plurality of memory cells (not shown) arranged in row and column directions. Each of the plurality of memory cells may be connected to one of a plurality of word lines WL and one of a plurality of bit lines BL.
[0056] The row decoder 222 may operate under the control of the logic circuit 250. The row decoder 222 may enable a word line selected as an access target from among a plurality of word lines WL based on a command CMD and a row address RA.
[0057] The sense amplifier and write driver 223 may operate under the control of the logic circuit 250. The sense amplifier and write driver 223 may be connected to a plurality of memory cells through a plurality of bit lines BL.
[0058] The column decoder 224 may operate under the control of the logic circuit 250. The column decoder 224 may be connected to the sense amplifier and the write driver 223. The column decoder 224 may select one or more of the plurality of bit lines BL based on the command CMD and the column address CA.
[0059] The data input / output block 230 may operate under the control of the logic circuit 250. The data input / output block 230 is connected to the sense amplifier and write driver 223 through a plurality of data lines DL. The data input / output block 230 may output data read by the sense amplifier and write driver 223 to the buffer block 240 according to the column address CA.
[0060] The data input / output block 230 may provide the data received from the buffer block 240 to the sense amplifier and write driver 223 based on the column address CA.
[0061] The buffer block 240 may operate under the control of the logic circuit 250. The buffer block 240 may exchange data with the data input / output block 230. The buffer block 240 may receive a command and an address (CMD, ADDR) from the host 20. The buffer block 240 may exchange a data signal DQ with the host 20.
[0062] The logic circuit 250 may include a control logic 251 and a process-in-memory (PIM) execution component 252 .
[0063] The control logic 251 may include a mode register set 251 a. The mode register set 251 a may include information on a mode set by the host 20.
[0064] For example, the mode register set 251a may include information about the operation mode of the memory chip 210. The information about the operation mode may include a first PIM operation mode for vector input and a second PIM operation mode for scalar input. However, the information included in the mode register set 251a is not limited thereto. Later, the configuration associated with the first PIM operation mode and the second PIM operation mode will be described in detail.
[0065] The PIM execution component 252 may include a plurality of PIM components 252a. Each of the plurality of PIM components 252a may execute a PIM command corresponding to the PIM instruction set PIMIS based on a command CMD and data received from the host 20. In some embodiments, the data may include vector input and scalar input.
[0066] The plurality of PIM parts 252 a may execute a PIM command by performing a first PIM operation or a second PIM operation based on information about an operation mode of the mode register set 251 a .
[0067] The control logic 251 may enable the PIM execution component 252 to execute a PIM command corresponding to the PIM instruction set PIMIS. Later, a configuration for executing the PIM command will be described in detail.
[0068] Figure 3 3 is a diagram showing the arrangement of multiple memory banks and multiple PIM components in one memory chip 300. In some embodiments, Figure 3 The memory chip 300 may correspond to Figure 2 The memory chip 210 is provided.
[0069] refer to Figure 3 , the memory chip 300 may include a plurality of memory banks B0 to B15 and a plurality of PIM components PU0 to PU7. In some embodiments, Figure 3 The multiple memory banks B0 to B15 may correspond to Figure 2 The storage body 220. Figure 3 The multiple PIM components PU0 to PU7 may correspond to Figure 2 Multiple PIM components 252a.
[0070] The plurality of memory banks B0, B2, B8 and B10 may be electrically connected to other memory banks not shown through through silicon vias TSV. The plurality of memory banks B1, B3, B9 and B11 may be electrically connected to the plurality of memory banks B4, B6, B12 and B14 through through silicon vias TSV.
[0071] The plurality of memory banks B5, B7, B13, and B15 may be electrically connected to other memory banks not shown through through silicon vias TSV. However, the positions of the through silicon vias TSV are not limited to Figure 3 The example shown in .
[0072] The first PIM unit PU0 may be disposed between the first memory bank B0 and the second memory bank B1. The second PIM unit PU1 may be disposed between the third memory bank B2 and the fourth memory bank B3. The fifth PIM unit PU4 may be disposed between the ninth memory bank B8 and the tenth memory bank B9. The sixth PIM unit PU5 may be disposed between the eleventh memory bank B10 and the twelfth memory bank B11.
[0073] The third PIM unit PU2 may be disposed between the fifth memory bank B4 and the sixth memory bank B5. The fourth PIM unit PU3 may be disposed between the seventh memory bank B6 and the eighth memory bank B7. The seventh PIM unit PU6 may be disposed between the thirteenth memory bank B12 and the fourteenth memory bank B13. The eighth PIM unit PU7 may be disposed between the fifteenth memory bank B14 and the sixteenth memory bank B15. However, the positions of the plurality of PIM units PU0 to PU7 are not limited to Figure 3 The example shown in .
[0074] Figure 4 4 is a diagram showing a configuration of a PIM component 400 connected to a plurality of memory banks (in detail, bank 0 and bank 1). In some embodiments, Figure 4 The multiple memory banks (bank 0 and bank 1) can correspond to Figure 3 The first memory bank B0 and the second memory bank B1. Therefore, Figure 4 The PIM component 400 may correspond to Figure 3 The first PIM component PU0.
[0075] refer to Figure 4 The PIM unit 400 may include body interfaces 410 a and 410 b , a control unit 420 , a scalar register 430 , a first vector register 440 , a single instruction multiple data floating point unit (SIMD FPU) 450 , and a second vector register 460 .
[0076] The bank interfaces 410 a and 410 b may provide communication between the PIM component 400 and a plurality of memory banks (bank 0 and bank 1 ) not included in the PIM component 400 .
[0077] The PIM component 400 may communicate with the first memory bank (Bank 0) through the bank interface 410a. The PIM component 400 may send commands and addresses (CMD, ADDR) to the first memory bank (Bank 0).
[0078] For example, when the command CMD is a write command, the PIM component 400 may store data in the first memory bank (bank 0). In some embodiments, the data may be a weight. For example, when the command CMD is a read command, the PIM component 400 may read data from the first memory bank (bank 0). In some embodiments, the data may be a PIM operation result.
[0079] The PIM component 400 may communicate with the second memory bank (bank 1) through the bank interface 410b. The PIM component 400 may send commands and addresses (CMD, ADDR) to the second memory bank (bank 1).
[0080] For example, when the command CMD is a write command, the PIM component 400 may store data in the second memory bank (bank 1). In some embodiments, the data may be a weight. For example, when the command CMD is a read command, the PIM component 400 may read data from the second memory bank (bank 1). In some embodiments, the data may be a PIM operation result.
[0081] The control part 420 may control components in the PIM part 400 and a plurality of memory banks (Bank 0 and Bank 1) based on commands and addresses (CMD, ADDR).
[0082] The control component 420 may receive input data and may store the input data in the scalar register 430 or the first vector register 440. When the input data is a vector input, the control component 420 may store the vector input in the first vector register 440. When the input data is a scalar input, the control component 420 may store the scalar input in the scalar register 430.
[0083] The SIMD FPU 450 may operate under the control of the control part 420. That is, the SIMD FPU 450 may operate in the first PIM operation mode or the second PIM operation mode in response to the multiplexing signal ms received from the control part 420. The multiplexing signal ms may include information on the mode of the PIM part 400 set by the external host.
[0084] SIMD FPU 450 may perform a first operation based on data received from first vector register 440 and data read from first memory bank (Bank 0). Similarly, SIMD FPU 450 may perform a first operation based on data received from first vector register 440 and data read from second memory bank (Bank 1).
[0085] In some embodiments, SIMD FPU 450 may perform a second operation based on data received from scalar register 430 and data read from the first memory bank (Bank 0). Similarly, SIMD FPU 450 may perform a second operation based on data received from scalar register 430 and data read from the second memory bank (Bank 1).
[0086] The second vector register 460 may store a result of the first operation or the second operation performed by the SIMD FPU 450. When the SIMD FPU 450 performs the first operation or the second operation, in the case where data is stored in the second vector register 460, the second vector register 460 may output the stored data to the SIMD FPU 450.
[0087] The SIMD FPU 450 may perform a third operation based on the result of the first operation and the stored data. The SIMD FPU 450 may output the result of the third operation to the second vector register 460. The second vector register 460 may store the result of the third operation. The result of the first operation may be updated with the result of the third operation. The first PIM operation may be defined as including the first operation and the third operation. The first PIM operation will be described in detail later.
[0088] The SIMD FPU 450 may perform a fourth operation based on the result of the second operation and the stored data. The SIMD FPU 450 may output the result of the fourth operation to the second vector register 460. The second vector register 460 may store the result of the fourth operation. The result of the second operation may be updated with the result of the fourth operation. The second PIM operation may be defined as including the second operation and the fourth operation. The second PIM operation will be described in detail later.
[0089] In response to the command and address (CMD, ADDR), the PIM part 400 may store the data (i.e., the result of the third operation or the fourth operation) output from the second vector register 460 in the first memory bank (Bank 0) and the second memory bank (Bank 1). The PIM part 400 may output the data stored in the first memory bank (Bank 0) and the second memory bank (Bank 1) as output data output in response to the command and address (CMD, ADDR).
[0090] Figure 5is a diagram showing in detail the configuration of a single instruction multiple data floating point unit (SIMD FPU) 550 included in the PIM unit 500.
[0091] refer to Figure 4 and Figure 5 , the SIMD FPU 550 may include a plurality of multiplexers MUX 0 to MUX 15 and a plurality of devices (FPU 0 to FPU 15) 551. Data selected by the plurality of multiplexers MUX 0 to MUX 15 may be respectively transmitted to the plurality of devices 551. However, the number of multiplexers and the number of devices are not limited thereto.
[0092] The first multiplexer MUX 0 may select one of the data sca, vec1, and vec2 based on the multiplexing signal ms. The first multiplexer MUX 0 may transmit the selected data “Data” to the first device FPU 0. The data sca may be scalar data output from the scalar register 430. The data vec1 may be vector data output from the first vector register 440. The data vec2 may be vector data output from the second vector register 560.
[0093] The first device FPU 0 may perform a first operation based on the vector data vec1 and the weight “Weight” read from the memory bank. The first device FPU 0 may perform a second operation based on the weight “Weight” and the scalar data sca read from the memory bank.
[0094] When the first multiplexer MUX 0 selects the vector data vec2, the first device FPU 0 may perform a third operation based on the result of the first operation and the vector data vec2. In this case, the vector data vec2 may include the result of the previously performed first operation.
[0095] In some embodiments, when the first multiplexer MUX 0 selects the vector data vec2, the first device FPU 0 may perform a fourth operation based on the result of the second operation and the vector data vec2. In this case, the vector data vec2 may include the result of the previously performed second operation.
[0096] The first device FPU 0 may output a result of the third operation or the fourth operation to the second vector register 560 .
[0097] Likewise, the remaining multiplexers MUX1 to MUX15 may operate the same as or similarly to the first multiplexer MUX0. The remaining devices FPU1 to FPU15 may operate the same as or similarly to the first device FPU0.
[0098] Figure 6is a diagram illustrating some embodiments of weight programming in the first operating mode. Figure 6 To describe the configuration for weight programming in the first memory bank (bank 0). Figure 6 In the embodiment, the first memory bank (bank 0) may include a plurality of rows (row 0 to row i). However, the number of rows included in the first memory bank (bank 0) is not limited thereto.
[0099] Weight programming can be performed in the remaining memory banks in the same or similar manner as the first memory bank (bank 0). Figure 6 In the above example, “x” indicates Figure 5 The number of devices, and "z" indicates Figure 4 The size of the first vector register 440 is .
[0100] refer to Figure 6 , the weight row may include a plurality of weights w0 and wk. The first weight w0 may include a plurality of element groups eg0 to egm. The remaining weights w1 to wk may be configured to be the same as the first weight w0.
[0101] The first element group eg0 may include a plurality of elements in the first direction. Likewise, the second element group eg1 may include a plurality of elements in the first direction. As in the above description, the (m+1)th element group egm may include a plurality of elements in the first direction.
[0102] The number of the plurality of elements included in each of the plurality of element groups eg0 to egm may be “x.” The number of the plurality of element groups eg0 to egm may be “z.”
[0103] The first weight w0 may include a plurality of element groups eg0 to egm in a second direction perpendicular to the first direction. One of the first direction and the second direction includes a row direction, and the other of the first direction and the second direction includes a column direction. A plurality of memory cells are arranged along the row direction and the column direction.
[0104] The weight row can be physically mapped to the first memory bank (bank 0). In this case, the first to fourth weights can be mapped to the first row (row 0). That is, in the first memory bank (bank 0), four weights can be mapped to each row. Therefore, the fifth weight w4 can be mapped to the second row (row 1). As in the above description, the (k+1)th weight wk can be mapped to the (i+1)th row (row i).
[0105] The plurality of element groups eg0 to egm included in the first weight w0 may be mapped along the second direction. The plurality of elements included in each of the plurality of element groups eg0 to egm may be mapped along the first direction. The plurality of element groups and the plurality of elements included in the remaining weights w1 to wk may be mapped identically to the first weight w0.
[0106] Figure 7 is a diagram illustrating some embodiments of performing a first PIM operation on an input vector of each of a plurality of memory banks constituting a matrix or included in a matrix in a first operating mode. In some embodiments, Figure 7 Only one channel ch1 among a plurality of channels for electrically connecting the storage device to an external host is shown in FIG. Figure 7 In the example, “n” may be the number of vector inputs received via channel ch1.
[0107] refer to Figure 4 and Figure 7 , 8 memory banks (bank 0, bank 2, ..., bank 14) may be electrically connected to channel ch1. 8 memory banks (bank 0, bank 2, ..., bank 14) may be implemented in one matrix to perform the first PIM operation. However, the number of memory banks is not limited thereto.
[0108] The first memory bank (bank 0) may include a plurality of weights w0 to wk mapped thereto. Likewise, the remaining memory banks (banks 2 to 14) may include a plurality of weights w0 to wk mapped in the same manner as the first memory bank (bank 0). The same description of the mapped plurality of weights w0 to wk will be omitted.
[0109] A first PIM operation may be performed on each vector input using a plurality of weights w0 to wk included in a first memory bank (bank 0). As a result of performing the first PIM operation on all received vector inputs, a first output vector may be generated.
[0110] The first PIM operation may be performed on each vector input using a plurality of weights w0 to wk included in the third memory bank (bank2). As a result of performing the first PIM operation on all received vector inputs, a second output vector may be generated.
[0111] As described above, the first PIM operation can be performed on each vector input using the plurality of weights w0 to wk included in the fifteenth memory bank (bank 14). As a result of performing the first PIM operation on all received vector inputs, an eighth output vector can be generated. The first PIM operation will be described in detail later.
[0112] Figure 8 is a diagram showing a configuration of a PIM component 600 operating in a first operating mode. In some embodiments, Figure 8 The PIM component 600 may correspond to Figure 3 The first PIM component PU0 is provided adjacent to the PIM component 600. Figure 3 The configuration of the second memory bank (bank 1) can be the same as the configuration of the first memory bank (bank 0). Figure 8 Only the first memory bank (Bank 0) disposed adjacent to the PIM part 600 will be described.
[0113] refer to Figure 8 , the PIM part 600 may include a control part 610 , a first vector register 620 , a SIMD FPU 630 , and a second vector register 640 .
[0114] The control component 610 may receive a vector input group vg. The vector input group vg may include a plurality of vector inputs. In this case, the vector input group vg may correspond to Figure 4 The control unit 610 may provide the vector input group vg to the first vector register 620 .
[0115] The first vector register 620 may operate under the control of the control part 610. The first vector register 620 may store a plurality of vector inputs, and may output the vector inputs one by one to the SIMD FPU 630 while shifting the plurality of vector inputs stored therein.
[0116] The SIMD FPU 630 may operate under the control of the control section 610 (ie, in response to the multiplexing signal ms).
[0117] For example, the SIMD FPU 630 may perform a current first operation based on the vector input vec currently output from the first vector register 620 and the current weight "Weight" read from the first memory bank (bank 0). When receiving the vector input vec, the control unit 610 may read the weight of the first memory bank (bank 0) corresponding to the received vector input based on the command CMD and the column address CA.
[0118] The second vector register 640 may operate under the control of the control part 610. The second vector register 640 may output the stored data to the SIMD FPU 630 one by one.
[0119] In some embodiments, the stored data may include a result of a previous first PIM operation performed based on a vector input vec previously output from the first vector register 620 and a previous weight “Weight” corresponding thereto.
[0120] SIMD FPU 630 may perform the current third operation based on the result of the previous first PIM operation and the result of the current first operation output from second vector register 640. SIMD FPU 630 may output data including the result of the current third operation to second vector register 640. The result of the current third operation may indicate the result of the current first PIM operation.
[0121] When there is no result of the previous first PIM operation in the second vector register 640, the SIMD FPU 630 may output the result of the current first operation to the second vector register 640 without modification. When there is a result of the previous first PIM operation in the second vector register 640, the SIMD FPU 630 may output the result of the current first PIM operation to the second vector register 640.
[0122] When SIMD FPU 630 no longer performs the first operation, second vector register 640 may output the result of the current first PIM operation as the first output vector. Control unit 610 may store the first output vector in the first memory bank (bank 0) based on the received command CMD and the received column address CA.
[0123] Thereafter, the control unit 610 may output the first output vector stored in the first memory bank (bank 0) to the external host in response to the command and address received from the external host. In this case, the first output vector may correspond to Figure 4 Output data Output.
[0124] When there is a vector input vec provided to the SIMD FPU 630 , the SIMD FPU 630 may perform a next first operation based on a next vector input vec and a next weight “Weight” read from the first memory bank (bank 0 ).
[0125] The second vector register 640 may output data including the result of the current first PIM operation to the SIMD FPU 630. The SIMD FPU 630 may perform a next third operation based on the result of the current first PIM operation and the result of the next first operation. The SIMD FPU 630 may output data including the result of the next third operation to the second vector register 640. The result of the next third operation may indicate the result of the current first PIM operation.
[0126] As in the above description, the SIMD FPU 630 may repeatedly perform the first PIM operation based on all vector inputs included in the vector input group vg and weights corresponding thereto.
[0127] Fig. 9 is a diagram illustrating some embodiments of performing a first PIM operation in a first operating mode. Fig. 9 To describe the first PIM operation performed only on the weights stored in the first memory bank (bank 0). Fig. 9 In , "k" may represent the number of vector inputs. The first PIM operation may include a multiply-accumulate operation (hereinafter referred to as "MAC").
[0128] refer to Figure 8 and Fig. 9 , the SIMD FPU 630 may perform a first operation based on the first vector input v0 and the first weight w0. The first weight w0 may be present in a memory cell corresponding to the first column address CA0 in the first memory bank (bank 0). As a result of the first operation, a first partial vector pv1 may be generated. The first operation may be a multiplication operation.
[0129] The second vector register 640 may store the first partial vector pv1 (hereinafter referred to as “result of the previous first PIM operation”). When generating the first partial vector pv1, since no data exists in the second vector register 640, the first MAC may include only the first operation.
[0130] When currently receiving the second vector input v1, the SIMD FPU 630 may perform the current first operation based on the second vector input v1 and the second weight w1. The second weight w1 may exist in a memory cell corresponding to the second column address CA1 in the first memory bank (bank0).
[0131] Since the result of the previous first PIM operation exists in the second vector register 640, the SIMD FPU 630 may perform the current third operation based on the result of the previous first PIM operation and the result of the current first operation. As a result of the current third operation, a second partial vector pv2 may be generated. The third operation may be an accumulation operation. The second vector register 640 may store the second partial vector pv2. The second MAC may include the current first operation and the current third operation.
[0132] As in the above description, the k-th MAC will be described assuming that the (k-1)-th partial vector pvk-1 is generated based on the currently received vector input vk-2. In this case, the (k-1)-th first operation and the (k-1)-th third operation may be the current first operation and the current third operation, respectively. The SIMD FPU 630 may perform the next first operation based on the vector input vk-1 and the k-th weight wk-1. The k-th weight wk-1 may exist in a storage cell corresponding to the k-th column address CAk-1 in the first storage bank (bank 0).
[0133] Since the result of the current first PIM operation exists in the second vector register 640, the SIMD FPU 630 can perform the next third operation based on the (k-1)th partial vector pvk-1 and the result of the current first operation. As a result of the next third operation, the kth partial vector pvk can be generated. The second vector register 640 can store the kth partial vector pvk. The kth MAC can include the next first operation and the next third operation.
[0134] The second vector register 640 may output the kth partial vector pvk as a first output vector. The control unit 610 may store the first output vector in a first memory bank (bank 0) based on the received command CMD and the received column address CA.
[0135] Fig.10 is a diagram showing an arrangement of elements for performing a first PIM operation in a first operating mode. Fig.10 Describes only one vector input (e.g. Fig. 9 The first vector input v0) and a weight (e.g., Fig. 9 The configurations of the remaining weights w1 to wk-1 and the remaining vector inputs v1 to vk-1 may be the same as or similar to the configurations of the first weight w0 and the first vector input v0.
[0136] refer to Figure 5 , Fig. 9 and Fig.10 , the first vector input v0 may include a plurality of elements arranged in a first direction, and the number of the plurality of elements may be the same as the number of the plurality of devices (FPU 0 to FPU 15) 551 included in the SIMD FPU 550.
[0137] That is, because Figure 5 The number of the plurality of devices (FPU 0 to FPU 15) 551 is 16, so the first vector input v0 may include 16 elements. When the number of the plurality of devices changes, the number of elements of the first vector input v0 may also change.
[0138] A plurality of multiplexers MUX 0 to MUX 15 may select a vector input v0 (eg, Figure 5 Vector data vec1).
[0139] In this case, the first element e1a' included in the first vector input v0 may be selected by the first multiplexer MUX 0. The second element e1b' included in the first vector input v0 may be selected by the second multiplexer MUX 1. As in the above description, the sixteenth element e1p' included in the first vector input v0 may be selected by the sixteenth multiplexer MUX 15.
[0140] The first weight w0 may be input from the memory bank to the plurality of devices (FPU 0 to FPU 15) 551. For example, the first weight w0 may include 8 element groups in the second direction. However, the number of element groups included in the first weight w0 is not limited thereto.
[0141] For example, the first element group may include a plurality of elements e1a to e1p in the first direction. The second element group may include a plurality of elements e2a to e2p in the first direction. As in the above description, the eighth element group may include a plurality of elements e8a to e8p in the first direction.
[0142] The first weight w0 stored in the memory bank may be read along the second direction. That is, the first element group may be read before the second element group. Finally, the eight element group may be read.
[0143] Therefore, the operation may be performed on the first element group before the second element group, and the operation may be performed last on the eighth element group.
[0144] The first element e1a included in the first element group may be applied to the first device FPU 0. The second element e1b included in the first element group may be applied to the second device FPU 1. As in the above description, the sixteenth element e1p included in the first element group may be applied to the sixteenth device FPU 15.
[0145] The first device FPU0 may perform a first operation based on the first element e1a included in the first element group and the first element e1a′ included in the first vector input v0.
[0146] The second device FPU1 may perform a first operation based on the second element e1b included in the first element group and the second element e1b′ included in the first vector input v0.
[0147] As in the above description, the sixteenth means FPU 15 may perform the first operation based on the sixteenth element e1p included in the first element group and the sixteenth element e1p′ included in the first vector input v0.
[0148] The result of performing the first operation on the first vector input v0 and the first element group may be stored in the second vector register 560. In some embodiments, when there is data stored in the second vector register 560, the SIMD FPU 550 may perform a third operation based on the data output from the second vector register 560 and the result of the first operation.
[0149] The third operation may be an accumulation operation of each element included in the result of the first operation and each element included in the output data. In this case, the result of the third operation may be stored in the second vector register 560.
[0150] Next, the first device FPU0 may perform a first operation based on the first element e2a included in the second element group and the first element e1a′ included in the first vector input v0.
[0151] The second device FPU1 may perform a first operation based on the second element e2b included in the second element group and the second element e1b′ included in the first vector input v0.
[0152] As in the above description, the sixteenth means FPU 15 may perform the first operation based on the sixteenth element e2p included in the second element group and the sixteenth element e1p′ included in the first vector input v0.
[0153] The result of performing the first operation on the first vector input v0 and the second element group may be stored in the second vector register 560. In some embodiments, when there is data stored in the second vector register 560, the SIMD FPU 550 may perform a third operation based on the data output from the second vector register 560 and the result of the first operation.
[0154] The third operation may be an accumulation operation of each element included in the result of the first operation and each element included in the output data. In this case, the result of the third operation may be stored in the second vector register 560.
[0155] As in the above description, the sixteenth device FPU0 may perform the first operation based on the sixteenth element e8a included in the eighth element group and the first element e1a′ included in the first vector input v0.
[0156] The second device FPU1 may perform a first operation based on the second element e8b included in the eighth element group and the second element e1b′ included in the first vector input v0.
[0157] As in the above description, the sixteenth means FPU 15 may perform the first operation based on the sixteenth element e8p included in the eighth element group and the sixteenth element e1p′ included in the first vector input v0.
[0158] The result of performing the first operation on the first vector input v0 and the eighth element group may be stored in the second vector register 560. In some embodiments, when there is data stored in the second vector register 560, the SIMD FPU 550 may perform a third operation based on the data output from the second vector register 560 and the result of the first operation.
[0159] The third operation may be an accumulation operation of each element included in the result of the first operation and each element included in the output data. In this case, the result of the third operation may be stored in the second vector register 560.
[0160] According to the above description, the PIM component 500 can generate a final result of the first PIM operation while repeatedly performing the first PIM operation on the received vector input. The final result of the first PIM operation can be a first output vector.
[0161] Thereafter, the PIM part 500 may output the first output vector stored in the first memory bank (bank 0) to the external host in response to a command and an address received from the external host.
[0162] Since the first PIM operation does not include an operation between a plurality of elements belonging to each element group and arranged in the first direction, the external host may need to additionally perform an operation between a plurality of elements arranged in the first direction in each element group. Therefore, the additional operation of the external host may increase the amount of data communication between the storage device and the external host.
[0163] Fig.11 is a diagram showing some embodiments of weight programming in the second operating mode. Fig.11 To describe the configuration for weight programming in the first memory bank (bank 0). Fig.11 In the embodiment, the first memory bank (bank 0) may include a plurality of rows (row 0 to row i). However, the number of rows included in the first memory bank (bank 0) is not limited thereto.
[0164] As in the first memory bank (bank 0), weight programming can be performed in the remaining memory banks. Fig.11 In the example, “x” may represent the number of multiple devices, and “z” may represent Figure 4 The size of the first vector register 440 is .
[0165] refer to Fig.11, the weight row may include a plurality of weights w0 to wk. The first weight w0 may include a plurality of element groups eg0 to egm. The remaining weights w1 to wk may be configured to be the same as or similar to the first weight w0.
[0166] The first element group eg0 may include a plurality of elements in the first direction. Likewise, the second element group eg1 may include a plurality of elements in the first direction. As in the above description, the (m+1)th element group egm may include a plurality of elements in the first direction.
[0167] For example, the number of the plurality of elements included in the first element group eg0 may be "x". Although not shown, the number of the plurality of elements included in each of the remaining element groups eg1 to egm may be "x". The number of the plurality of element groups eg0 to egm may be "z". The first weight w0 may include the plurality of element groups eg0 to egm in the first direction.
[0168] The weight row can be physically mapped to the first memory bank (bank 0). In this case, the first to fourth weights can be mapped to the first row (row 0). That is, in the first memory bank (bank 0), four weights can be mapped to each row. Therefore, the fifth weight w4 can be mapped to the second row (row 1). As described above, the (k+1)th weight wk can be mapped to the (i+1)th row (row i).
[0169] The plurality of element groups eg0 to egm included in the first weight w0 may be mapped in the first direction. The number of the plurality of elements included in each of the plurality of element groups eg0 to egm may be mapped in the first direction. The plurality of element groups and the plurality of elements included in the remaining weights w1 to wk may be mapped identically or similarly to the first weight w0.
[0170] Fig.12 is a diagram illustrating some embodiments of performing a second PIM operation on a scalar input to each of a plurality of memory banks constituting or included in a matrix in a second operating mode.
[0171] In some embodiments, Fig.12 Only one channel ch1 among a plurality of channels electrically connecting the storage device to an external host is shown in FIG. Fig.12 In the example, “n” may be the number of scalar inputs received through channel ch1.
[0172] refer to Figure 4 and Fig.12, 8 memory banks (bank 0, bank 2, ..., bank 14) may be electrically connected to channel ch1. 8 memory banks (bank 0, bank 2, ..., bank 14) may be implemented in one matrix to perform the second PIM operation. However, the number of memory banks is not limited thereto.
[0173] The first memory bank (bank 0) may include a plurality of weights w0 to wk mapped thereto. Similarly, the remaining memory banks (banks 2 to 14) may include a plurality of weights w0 to wk mapped in the same manner as the memory bank (bank 0). For the mapped plurality of weights w0 to wk, the same description will be omitted.
[0174] The second PIM operation may be performed on each scalar input using a plurality of weights w0 to wk included in the first memory bank (bank 0). As a result of performing the second PIM operation on some or all of the received scalar inputs, a first output vector may be generated.
[0175] The second PIM operation may be performed on each scalar input using a plurality of weights w0 to wk included in the third memory bank (bank2). As a result of performing the second PIM operation on some or all of the received scalar inputs, a second output vector may be generated.
[0176] As described above, a second PIM operation may be performed on each scalar input using a plurality of weights w0 to wk included in the fifteenth memory bank (bank 14). As a result of performing the second PIM operation on some or all of the received scalar inputs, an eighth output vector may be generated. The second PIM operation will be described in detail later.
[0177] Fig.13 is a diagram showing a configuration of the PIM component 700 operating in the second operating mode. In some embodiments, Fig.13 The PIM component 700 may correspond to Figure 3 The first PIM component PU0 is provided adjacent to the PIM component 700. Figure 3 The configuration of the second memory bank (bank 1) may be the same or similar to the configuration of the first memory bank (bank 0). Fig.13 Only the first memory bank (bank 0 ) disposed adjacent to the PIM part 700 is described.
[0178] refer to Fig.13 , the PIM part 700 may include a control part 710 , a scalar register 720 , a SIMD FPU 730 , and a second vector register 740 .
[0179] The control part 710 may include a zero check part 711, an index register 712, and a weight address generator 713. The control part 710 may determine whether to enable the zero check part 711 based on an enable signal EN.
[0180] The zero check component 711 may receive a scalar input group sg. In this case, the scalar input group sg may correspond to Figure 4 When the zero check unit 711 is enabled, the zero check unit 711 may extract a scalar input having a zero value while receiving the scalar input group sg. The zero check unit 711 may send a scalar input not including a zero value to the scalar register 720.
[0181] When the zero check part 711 is disabled, the control part 710 may transfer the scalar input group sg to the scalar register 720 .
[0182] When the zero check component 711 is enabled, the zero check component 711 may generate an index whenever a scalar input having a non-zero value is received. The zero check component 711 may provide an index group ig generated based on multiple scalar inputs having non-zero values to the index register 712. The index group ig may include multiple indexes.
[0183] When the zero check component 711 is disabled, the control component 710 may generate an index whenever a scalar input is received. Likewise, the control component 710 may store the index group ig in the index register 712.
[0184] The index register 712 may store a plurality of indexes, and may output the indexes one by one to the weight address generator 713 by shifting the plurality of indexes stored therein.
[0185] The weight address generator 713 may generate a weight address WA based on the received index id. For example, when the command CMD is a read command and the currently received index id is "a", the weight address generator 713 may generate a weight address WA so that the data stored in the ath column of the first memory bank (bank 0) is read. The weight address WA may correspond to Figure 4 The address ADDR.
[0186] The scalar register 720 may operate under the control of the control part 710. The scalar register 720 may store data including a plurality of scalar inputs, and may output vector inputs sca to the SIMD FPU 730 one by one while shifting the stored data.
[0187] The SIMD FPU 730 may operate under the control of the control section 710 (ie, in response to the multiplexing signal ms).
[0188] For example, SIMD FPU 730 may perform a current first operation based on the scalar input sca currently output from scalar register 720 and the current weight "Weight" read from the first memory bank (Bank 0). Control unit 710 may read the weight "Weight" stored in the first memory bank (Bank 0) based on command CMD and weight address WA.
[0189] The second vector register 740 may operate under the control of the control part 710. The second vector register 740 may output the stored data to the SIMD FPU 730 one by one.
[0190] In some embodiments, the stored data may include a result of a previous second PIM operation performed based on the scalar data sca previously output from the scalar register 720 and a previous weight “Weight” corresponding thereto.
[0191] SIMD FPU 730 may perform the current fourth operation based on the result of the previous second PIM operation and the result of the current second operation output from second vector register 740. SIMD FPU 730 may output data including the result of the current fourth operation to second vector register 740. The result of the current fourth operation may indicate the result of the current second PIM operation.
[0192] When there is no result of the previous second PIM operation in the second vector register 740, the SIMD FPU 730 may output the result of the current second operation to the second vector register 740 without modification. When there is a result of the previous second PIM operation in the second vector register 740, the SIMD FPU 730 may output the result of the current second PIM operation to the second vector register 740.
[0193] When SIMD FPU 730 no longer executes the second operation, second vector register 740 may output the result of the current second PIM operation as the first output vector. Control unit 710 may store the first output vector in the first memory bank (bank 0) based on the received command and the received column address.
[0194] Thereafter, the control unit 710 may output the first output vector stored in the first memory bank (bank 0) to the external host in response to the command and address received from the external host. In this case, the first output vector may correspond to Figure 4 Output data Output.
[0195] When there is a scalar input sca provided to the SIMD FPU 730, the SIMD FPU 730 may perform a next second operation based on next scalar data sca and a next weight "Weight" read from the first memory bank (Bank 0).
[0196] The second vector register 740 may output data including the result of the current second PIM operation to the SIMD FPU 730. The SIMD FPU 730 may perform a next fourth operation based on the result of the current second PIM operation and the result of the next second operation. The SIMD FPU 730 may output data including the result of the next fourth operation to the second vector register 740. The result of the next fourth operation may indicate the result of the next second PIM operation.
[0197] As in the above description, the SIMD FPU 730 may repeatedly perform the second PIM operation based on some or all of the scalar inputs included in the scalar input group sg and weights corresponding thereto.
[0198] Fig.14 is a diagram showing a first embodiment of performing a second PIM operation in a second operation mode. Fig.14 An example embodiment in which zero checking is not performed is described.
[0199] Will refer to Fig.14 Describes the second PIM operation performed only on the weights stored in the first memory bank (bank 0). Fig.14 In the example, "k" may represent the number of scalar inputs. The second PIM operation may include a multiply-accumulate operation (hereinafter referred to as "MAC").
[0200] refer to Fig.13 and Fig.14 , the SIMD FPU 730 may perform a second operation based on the first scalar input s0 and the first weight w0. The first weight w0 may be present in a storage cell corresponding to the first weight address WA0 in the first memory bank (bank 0). As a result of the second operation, a first partial vector pv1 may be generated. The second operation may be a multiplication operation.
[0201] The first weight address WA0 may be generated based on an index having a value of “0.” When a scalar input having a zero or non-zero value is first received, the zero check unit 711 may generate an index having a value of “0.”
[0202] The second vector register 740 may store the first partial vector pv1 (hereinafter referred to as “result of the previous second PIM operation”). When generating the first partial vector pv1, since no data exists in the second vector register 740, the first MAC may include only the second operation.
[0203] When currently receiving the second scalar input s1, the SIMD FPU 730 may perform the current second operation based on the second scalar input s1 and the second weight w1. The second weight w1 may exist in a memory cell corresponding to the second weight address WA1 in the first memory bank (bank0).
[0204] The second weight address WA1 may be generated based on an index having a value of “1.” The zero check part 711 may generate an index having a value of “1” when a scalar input having a zero or non-zero value is currently received after a previous scalar input.
[0205] Since the result of the previous second PIM operation exists in the second vector register 740, the SIMD FPU 730 may perform the current fourth operation based on the result of the previous second PIM operation and the result of the current second operation. The fourth operation may be an accumulation operation. The second vector register 740 may store the second partial vector pv2. The second MAC may include the current second operation and the current fourth operation.
[0206] As in the above description, the k-th MAC will be described assuming that the (k-1)-th partial vector pvk-1 is generated based on the currently received scalar input sk-2. In this case, the (k-1)-th second operation and the (k-1)-th fourth operation may be the current second operation and the current fourth operation, respectively. The SIMD FPU 730 may perform the next second operation based on the scalar input sk-1 and the k-th weight wk-1. The k-th weight wk-1 may exist in a storage cell corresponding to the k-th weight address WAk-1 in the first memory bank (bank 0). As a result of the next second operation, the k-th partial vector pvk may be generated.
[0207] The kth weight address WAk-1 may be generated based on an index having a value of “k-1.” When the next scalar input sk-1 having a zero or non-zero value is received after the current scalar input sk-2, the zero check component 711 may generate an index having a value of “k-1.”
[0208] Since the result of the current second PIM operation exists in the second vector register 740, the SIMD FPU 730 may perform the next fourth operation based on the (k-1)th partial vector pvk-1 and the result of the next second operation. The second vector register 740 may store the kth partial vector pvk. The kth MAC may include the next second operation and the next fourth operation.
[0209] The second vector register 740 may output the kth partial vector pvk as a first output vector. The control unit 710 may store the first output vector in a first memory bank (bank 0) based on the received command and the received column address.
[0210] Fig.15 is a diagram showing a second embodiment of performing a second PIM operation in a second operation mode. Fig.15 To describe an example embodiment of performing zero check. Fig.14 The description given is the same as the description given.
[0211] refer to Fig.13 and Fig.15 , the SIMD FPU 730 may perform a second operation based on the first scalar input s0 having a non-zero value and the first weight w0. The first weight w0 may be present in a storage cell corresponding to the first weight address WA0 in the first memory bank (bank 0). As a result of the second operation, a first partial vector pv1 may be generated. The second operation may be a multiplication operation.
[0212] The first weight address WA0 may be generated based on an index having a value of “0.” When a scalar input having a non-zero value is first received, the zero check unit 711 may generate an index having a value of “0.”
[0213] The second vector register 740 may store the first partial vector pv1 (hereinafter referred to as “result of the previous second PIM operation”). When generating the first partial vector pv1, since no data exists in the second vector register 740, the first MAC may include only the second operation.
[0214] Since the second scalar input s1 has a value of "0", the zero check component 711 may not generate an index even if the second scalar input s1 is received. Therefore, the weight address generator 713 may not generate a second weight address for reading the second weight w1 corresponding to the second scalar input s1.
[0215] When currently receiving the third scalar input s2, the SIMD FPU 730 may perform the current second operation based on the third scalar input s2 and the third weight w2. The third weight w2 may exist in a memory cell corresponding to the third weight address WA2 in the first memory bank (bank 0).
[0216] The third weight address WA2 may be generated based on an index having a value of "2". When the zero check component 711 receives a second scalar input s2 having a current non-zero value after a scalar input s0 having a previous non-zero value, the zero check component 711 may generate an index having a value of "2" instead of "1".
[0217] Since the result of the previous second PIM operation exists in the second vector register 740, the SIMD FPU 730 may perform the current fourth operation based on the result of the previous second PIM operation and the result of the current second operation. The fourth operation may be an accumulation operation. The second vector register 740 may store the third partial vector pv3. The second MAC may include the current second operation and the current fourth operation.
[0218] Since the fourth scalar input s3 has a value of "0", the zero check component 711 may not generate an index even if the fourth scalar input s3 is received. Therefore, the weight address generator 713 may not generate a fourth weight address for reading the fourth weight w3 corresponding to the fourth scalar input s3.
[0219] When the fifth scalar input s4 is received next, the SIMD FPU 730 may perform the current second operation based on the fifth scalar input s4 and the fifth weight w4. The fifth weight w4 may exist in a memory cell corresponding to the fifth weight address WA4 in the first memory bank (bank 0).
[0220] The fifth weight address WA4 may be generated based on an index value of “4.” When the zero check component 711 receives a scalar input s4 having a next non-zero value after the scalar input s2 having a current non-zero value, the zero check component 711 may generate an index value of “4” instead of “3.”
[0221] Since the result of the current second PIM operation exists in the second vector register 740, the SIMD FPU 730 can perform the next fourth operation based on the result of the current second PIM operation and the result of the next second operation. The second vector register 740 can store the fifth partial vector pv5. The third MAC can include the next second operation and the next fourth operation.
[0222] Since the sixth scalar input s5 has a value of "0", the zero check component 711 may not generate an index even if the sixth scalar input s5 is received. Therefore, the weight address generator 713 may not generate a sixth weight address for reading the sixth weight w5 corresponding to the sixth scalar input s5.
[0223] Since the seventh scalar input s6 has a value of "0", the zero check component 711 may not generate an index even if the seventh scalar input s6 is received. Therefore, the weight address generator 713 may not generate a seventh weight address for reading the seventh weight w6 corresponding to the seventh scalar input s6.
[0224] As in the above description, the k-th MAC will be described assuming that the (k-1)-th partial vector pvk-1 is generated based on the scalar input sk-2 having a currently received non-zero value. In this case, the (k-1)-th second operation and the (k-1)-th fourth operation may be the current second operation and the current fourth operation, respectively. The SIMD FPU 730 may perform the next second operation based on the scalar input sk-1 having a non-zero value and the k-th weight wk-1. The k-th weight wk-1 may exist in a storage cell corresponding to the k-th weight address WAk-1 in the first memory bank (bank 0).
[0225] The k-th weight address WAk-1 may be generated based on an index having a value of "k-1". When the zero check component 711 receives the next scalar input sk-1 having a non-zero value after the scalar input sk-2 having a current non-zero value, the zero check component 711 may generate an index having a value of "k-1".
[0226] Since the result of the current second PIM operation exists in the second vector register 740, the SIMD FPU 730 can perform the next fourth operation based on the (k-1)th partial vector pvk-1 and the result of the next second operation. The second vector register 740 can store the kth partial vector pvk (i.e., the first output vector). The kth MAC can include the next second operation and the next fourth operation.
[0227] Fig.16 is a diagram showing an arrangement of elements for performing a second PIM operation in a second operating mode. Fig.16 Describes only one scalar input (e.g. Fig.15 The first scalar input s0) and a weight (e.g., Fig.15 The configuration of the remaining weights and the remaining scalar inputs can be the same as the configuration of the first weight w0 and the first scalar input s0.
[0228] refer to Figure 5 , Fig.15 and Fig.16 , the first scalar input s0 may be broadcast to each of the plurality of devices (FPU 0 to FPU 15) 551 included in the SIMD FPU 550. That is, the plurality of multiplexers MUX 0 to MUX 15 may select the same scalar input (ie, the first scalar input s0) based on the multiplexing signal ms.
[0229] The first weight w0 may be input from the memory bank to the plurality of devices (FPU 0 to FPU 15) 551. For example, the first weight w0 may include 8 element groups in the first direction. However, the number of element groups included in the first weight w0 is not limited thereto.
[0230] For example, the first element group may include a plurality of elements e1a to e1p in the first direction. As in the above description, the eighth element group may include a plurality of elements e8a to e8p in the first direction.
[0231] The first weight w0 stored in the memory bank may be read along the first direction. That is, first, the first element group may be read. Finally, the eighth element group may be read.
[0232] Thus, the operation may be performed first on the first element group and continue with each element group until the operation may finally be performed on the eighth element group.
[0233] The first element e1a included in the first element group may be applied to the first device FPU 0. The second element e1b included in the first element group may be applied to the second device FPU 1. As in the above description, the sixteenth element e1p included in the first element group may be applied to the sixteenth device FPU 15.
[0234] The first device FPU0 may perform a second operation based on the first element e1a included in the first element group and the first scalar input s0 broadcasted thus.
[0235] The second device FPU1 may perform a second operation based on the second element e1b included in the first element group and the first scalar input s0 broadcasted thus.
[0236] As in the above description, the sixteenth means FPU 15 may perform the second operation based on the sixteenth element e1p included in the first element group and the first scalar input s0 broadcasted thus.
[0237] The result of performing the second operation on the first scalar input s0 and the first element group may be stored in the second vector register 560. In some embodiments, when there is data stored in the second vector register 560, the SIMD FPU 550 may perform a fourth operation based on the data output from the second vector register 560 and the result of the second operation.
[0238] The fourth operation may be an accumulation operation of each element included in the result of the second operation and each element included in the output data. In this case, the result of the fourth operation may be stored in the second vector register 560.
[0239] As in the above description, the first device FPU0 may perform the second operation based on the first element e8a included in the eighth element group and the first scalar input s0 broadcasted thus.
[0240] The second device FPU1 may perform a second operation based on the second element e8b included in the eighth element group and the first scalar input s0 broadcasted thus.
[0241] As in the above description, the sixteenth means FPU 15 may perform the second operation based on the sixteenth element e8P included in the eighth element group and the first scalar input s0 broadcasted thus.
[0242] The result of performing the second operation on the first scalar input s0 and the eighth element group may be stored in the second vector register 560. In some embodiments, when there is data stored in the second vector register 560, the SIMD FPU 550 may perform a fourth operation based on the data output from the second vector register 560 and the result of the second operation.
[0243] The fourth operation may be an accumulation operation of each element included in the result of the second operation and each element included in the output data. In this case, the result of the fourth operation may be stored in the second vector register 560.
[0244] According to the above description, in the second operation mode, PIM component 500 can generate the result of the last second PIM operation while repeatedly performing the second PIM operation on the received non-zero valued scalar input. The result of the last second PIM operation can be the first output vector.
[0245] Thereafter, the PIM part 500 may output the first output vector stored in the first memory bank (bank 0) to the external host in response to a command and an address received from the external host.
[0246] In the second PIM operation, since all elements included in one weight are arranged in one direction, the external host does not need to perform additional operations between multiple elements belonging to the element group. Therefore, the amount of data communication between the storage device and the external host required for the external host to perform additional operations can be reduced.
[0247] Fig.17 is a diagram showing some embodiments of implementing a matrix with multiple channels. Fig.17 A matrix implemented by connecting a plurality of banks to each of 64 channels ch0 to ch63 electrically connecting an external host and a memory device is described. However, the number of channels is not limited thereto.
[0248] refer to Figure 4 , Figure 5 and Fig.17 In the matrix thus implemented, 16 channels may be set in the first direction, and 4 channels may be set in the second direction. Weight programming may be performed in each of the 8 memory banks, and banks 0 to 7 are connected to the first channel ch0. The weight may include a plurality of element groups each including a plurality of elements.
[0249] For example, in the second operation mode, for each of the 8 memory banks connected to the first channel ch0, multiple element groups can be programmed in the second direction. As described above, in the second operation mode, weights can be programmed in the remaining channels ch1 to ch63.
[0250] refer to Figure 4 , Figure 5 and Fig.17 , the number of the plurality of devices (FPU 0 to FPU 15) 551 included in the SIMD FPU 550 may be "16". A description will be given assuming that the scalar register 430 can store 8 scalar inputs simultaneously. However, the number of the plurality of devices and the size of the scalar register 430 are not limited thereto.
[0251] In some embodiments, programming of 8 element groups (i.e., one weight) each including 16 elements can be performed in the first memory bank (bank 0) belonging to the first channel ch0. According to the above description, programming of 64 weights can be performed in the first memory bank (bank 0) along the first direction. As in the above description, programming of weights can be performed in the remaining memory banks (banks 1 to 7).
[0252] In the memory bank (bank 0 to bank 7) connected to the first channel ch0, 64 elements can be programmed in the first direction and 1024 elements can be programmed in the second direction. Therefore, in one matrix, 1024 elements can be programmed in the first direction and 4096 elements can be programmed in the second direction. However, the number of elements and the way of weight programming are not limited to this.
[0253] Figure 4 PIM parts 400 or Figure 5 The PIM component 500 may receive a scalar input from an external host. In this case, the PIM component 400 / 500 may perform a second operation based on the scalar input of a non-zero value and a weight corresponding thereto. The PIM component 400 / 500 may generate a first output vector due to the second PIM operation, and may output the first output vector to the external host. According to the above manner, eight output vectors (hereinafter referred to as an "output vector group") may be output to the external host through the first channel ch0.
[0254] When weights corresponding to scalar inputs of non-zero values received from an external host are present in the first channel ch0, the seventeenth channel ch16, the thirty-third channel ch32, and the forty-ninth channel ch48, the external host may perform additional operations on an output vector group output through the first channel ch0, an output vector group output through the seventeenth channel ch16, an output vector group output through the thirty-third channel ch32, and an output vector group output through the forty-ninth channel ch48.
[0255] Similarly, when there are weights corresponding to scalar inputs of non-zero values received from an external host in the second channel ch1, the eighteenth channel ch17, the thirty-fourth channel ch33, and the fiftieth channel ch49, the external host can perform additional operations on the output vector group output through the second channel ch1, the output vector group output through the eighteenth channel ch17, the output vector group output through the thirty-fourth channel ch33, and the output vector group output through the fiftieth channel ch49.
[0256] That is, the external host may perform another operation based on data output from a channel including a plurality of memory banks in which the same weight corresponding to a non-zero scalar input is programmed in the second direction.
[0257] Fig.18 The present invention is a flowchart of an operation method of a storage device performing weight programming differently according to an operation mode. Figure 2 and Fig.18 In operation S110, the memory device 200 may receive data associated with an operation mode from the host 20. The operation mode may include a first PIM operation mode for vector input and a second PIM operation mode for scalar input.
[0258] When the received data includes information about the first PIM operation mode, in operation S120, the memory device 200 may perform weight programming at the memory cells of the memory bank in the first direction and the second direction based on the command and address received from the host 20. The second direction may be a direction perpendicular to the first direction.
[0259] When the received data includes information about the second PIM operation mode, the memory device 200 may perform weight programming in the first direction at the memory cells of the memory bank based on the command and the address received from the host 20 in operation S130 .
[0260] Fig.19 is a flow chart showing an operation method of a storage device performing a first PIM operation in a first operation mode. Figure 2 and Fig.19 , in operation S210 , the storage device 200 may receive a vector input from the host 20 .
[0261] In operation S220 , the memory device 200 may read the current element group in the second direction based on the command and the address received from the host 20 .
[0262] In operation S230 , the memory device 200 may perform a first operation of the first PIM operation based on the currently received vector input and one of the current element groups thus read.
[0263] When it is determined in operation S240 that there is data stored in the memory device 200, operations S250 to S270 may be performed. The stored data may include a result of performing a previous first PIM operation based on a previous vector input and a previously read element group.
[0264] In operation S250 , the memory device 200 may perform a third operation in the first PIM operation based on the current first operation and the stored data.
[0265] In operation S260 , the storage device 200 may store a result of the current third operation.
[0266] When it is determined in operation S270 that all weights previously programmed in the memory device 200 and corresponding to the current vector input are used in the first PIM operation, the process ends.
[0267] When it is determined in operation S270 that at least one weight not used in the first PIM operation exists among the weights previously programmed in the memory device 200, operations S230 to S270 may be repeated. In this case, the memory device 200 may perform the next first PIM operation based on the current vector input and the next element group.
[0268] When it is determined in operation S240 that there is no data stored in the memory device 200 , operations S260 and S270 may be performed.
[0269] In operation S260 , the storage device 200 may store the result of the first operation without modification.
[0270] When it is determined in operation S270 that all weights previously programmed in the memory device 200 and corresponding to the current vector input are used in the first PIM operation, the process ends.
[0271] When it is determined in operation S270 that at least one weight not used in the first PIM operation exists among the weights previously programmed in the memory device 200, operations S230 to S270 may be repeated. In this case, the memory device 200 may perform the next first PIM operation based on the current vector input and the next element group.
[0272] Fig. 20 The present invention is a flowchart of a method for a storage device to read a weight corresponding to a scalar input in a second operation mode. Figure 2 , Fig.13 and Fig. 20 , in operation S310 , the storage device 200 may receive a scalar input from the host 20 .
[0273] When it is determined in operation S320 that the zero check part 711 is enabled, operations S330 to S360 may be performed.
[0274] When it is determined in operation S330 that the value of the scalar input is '0', operations S310 and S320 may be performed.
[0275] When it is determined in operation S320 that the zero check part 711 is disabled, or when it is determined in operation S330 that the value of the scalar input is not “0”, operations S340 to S360 may be performed.
[0276] In operation S340 , the storage device 200 may generate an index corresponding to the scalar input.
[0277] In operation S350 , the storage device 200 may generate an index-based weight address in response to a command and an address received from the host 20 .
[0278] In operation S360 , the memory device 200 may read the element group programmed in the first direction in the second operation mode based on the command and the weight address.
[0279] Fig.21 is a flow chart of an operating method of a storage device performing a second PIM operation in a second operating mode. Figure 2 and Fig.21 , in operation S410, the storage device 200 may read a current element group along a first direction based on a command and a weight address received from the host 20.
[0280] In operation S420 , the memory device 200 may perform a second operation in the second PIM operation based on the current scalar input and one of the current element groups thus read.
[0281] When it is determined in operation S430 that there is data stored in the memory device 200, operations S440 to S460 may be performed. The stored data may include a result of performing a previous second PIM operation based on a previous scalar input and a previously read element group.
[0282] In operation S440 , the memory device 200 may perform a current fourth operation in the second PIM operation based on a result of the current second operation and the stored data.
[0283] In operation S450 , the storage device 200 may store a result of the current fourth operation.
[0284] When it is determined in operation S460 that all weights previously programmed in the memory device 200 and corresponding to the current scalar input are used in the second PIM operation, the process ends.
[0285] When it is determined in operation S460 that there is at least one weight not used in the second PIM operation among the weights previously programmed in the memory device 200, operations S420 to S460 may be repeated. In this case, the memory device 200 may perform the next second PIM operation based on the current scalar input and the next element group.
[0286] When it is determined in operation S430 that there is no data stored in the memory device 200 , operations S450 and S460 may be performed.
[0287] In operation S450 , the storage device 200 may store the result of the second operation without modification.
[0288] When it is determined in operation S460 that all weights previously programmed in the memory device 200 and corresponding to the current scalar input are used in the second PIM operation, the process ends.
[0289] When it is determined in operation S460 that there is at least one weight not used in the second PIM operation among the weights previously programmed in the memory device 200, operations S420 to S460 may be repeated. In this case, the memory device 200 may perform the next second PIM operation based on the current scalar input and the next element group.
[0290] According to some embodiments of the present disclosure, a storage device for PIM operation and an operation method of the storage device can reduce the amount of data communication with a host by receiving a scalar input instead of a vector input from the host. In addition, the storage device can perform operations on zero values among the values of the scalar input received from the host by zero checking. Therefore, the power consumption of the storage device can be reduced, and the processing performance of the storage device can be improved.
[0291] While the present disclosure has been described with reference to the embodiments thereof, it will be apparent to those skilled in the art that various changes and modifications may be made thereto without departing from the spirit and scope of the present disclosure as set forth in the appended claims.
Claims
1. A storage device, the storage device include: Multiple memory chips, Wherein, the plurality of memory chips each include a plurality of memory banks, Wherein, the multiple storage bodies each include: a memory cell array comprising a plurality of memory cells electrically connected to a plurality of word lines; a row decoder electrically connected to the memory cell array through the plurality of word lines; and a sense amplifier and a write driver electrically connected to the memory cell array through a plurality of bit lines; and a logic circuit electrically connected to the plurality of memory banks and configured to read data from the plurality of memory banks or write data to the plurality of memory banks based on a plurality of corresponding commands and a plurality of corresponding addresses received from a host, The logic circuit is configured to: in a first operation mode, write first data to the plurality of memory banks based on a first command and a first address received from the host, and perform a first PIM operation based on the first data and third data received from the host, wherein the PIM is an in-memory process, and Wherein, the logic circuit is configured to: in a second operation mode, write second data into the multiple storage bodies based on the first command and the first address received from the host, and perform a second PIM operation based on the second data and fourth data different from the third data received from the host.
2. The storage device according to claim 1, in, The first data includes a plurality of element groups, each of the plurality of element groups includes a plurality of elements recorded at the plurality of storage banks along a first direction, and wherein the plurality of element groups are recorded along a second direction perpendicular to the first direction, One of the first direction and the second direction includes a row direction, the other of the first direction and the second direction includes a column direction, and the plurality of storage units are arranged along the row direction and the column direction.
3. The storage device according to claim 2, in, The logic circuit is configured to, in the first operation mode, perform a first operation of the first PIM operation based on the received third data and one element group among the plurality of element groups read in response to a second command and a second address received from the host.
4. The storage device according to claim 3, in, The logic circuit includes a vector register, and The logic circuit is configured to: when no data exists in the vector register before executing the first operation, store the result of the first operation in the vector register, and perform the first operation next time based on the received third data and the next element group read along the second direction in response to the received second command and the second address.
5. The storage device according to claim 3, in, The logic circuit includes a vector register, wherein the logic circuit is configured to: after executing the first operation, when there is PIM data in the vector register, execute a second operation in the first PIM operation based on a result of the first operation and the PIM data output from the vector register, and The PIM data includes a result of the first PIM operation performed based on previously received third data and a plurality of element groups read in response to a previously received second command and a second address.
6. The storage device according to claim 5, in, The logic circuit is configured to: perform the first operation based on the received third data and the next element group read along the second direction based on the received second command and the second address, and perform a second operation in the first PIM operation based on a result of the first operation and the PIM data sequentially output from the vector register.
7. The storage device according to claim 1, in, The logic circuit is configured to: in the second operation mode, when the fourth data includes a non-zero value, generate an index based on the non-zero value of the fourth data, and generate a weight address based on the index in response to a second command and a second address received from the host.
8. The storage device according to claim 7, in, The second data includes a plurality of element groups, each of the plurality of element groups includes a plurality of elements recorded in the plurality of storage bodies along a first direction, the first direction including a row direction or a column direction in which the plurality of storage units are arranged, wherein the plurality of element groups are recorded along the first direction, and The logic circuit is configured to: in the second operation mode, perform a first operation in the second PIM operation based on the received fourth data and an element group among the plurality of element groups read in response to a received second command and a weight address.
9. The storage device according to claim 8, in, The logic circuit includes a vector register, Wherein, the logic circuit is configured to: when no data exists in the vector register before executing the first operation, store the result of the first operation in the vector register, and perform the first operation next time based on the fourth data and the next element group read along the first direction in response to the received second command and the weight address.
10. The storage device according to claim 8, in, The logic circuit includes a vector register, wherein the logic circuit is configured to: after executing the first operation, when there is PIM data in the vector register, execute a second operation in the second PIM operation based on a result of the first operation and the PIM data output from the vector register, and The PIM data includes a result of the second PIM operation performed based on the previously received fourth data and a plurality of element groups read in response to the previously received second command and weight address.
11. The storage device according to claim 10, in, The logic circuit is configured to perform the first operation based on the fourth data and a next element group read along the first direction based on the second command previously received and the weight address, and to perform a second operation in the second PIM operation based on a result of the first operation and the PIM data sequentially output from the vector register.
12. The storage device according to claim 1, in, The first PIM operation and the second PIM operation both include a multiply-add operation.
13. A method for operating a storage device, the storage device comprising a plurality of memory chips, each of the plurality of memory chips comprising a plurality of storage units, the method include: In the first operation mode, the logic circuit included in the storage device is caused to perform operations including the following: recording first data at the plurality of storage units based on a first command and a first address received from a host; and performing a first PIM operation based on third data received from the host and the first data read based on a second command and a second address received from the host, the PIM being process-in-memory; and In the second operation mode, the logic circuit is caused to perform operations including: recording second data at the plurality of storage units based on the first command and the first address; generating an index when fourth data is received from the host; generating a weighted address based on the index in response to the second command and the second address; and A second PIM operation is performed based on the fourth data and the second data read in response to the second command and the weight address.
14. The method according to claim 13, in, The first data includes a plurality of element groups, each of the plurality of element groups includes a plurality of elements recorded at the plurality of storage units along a first direction, and the method further includes: In the first operation mode, the logic circuit performs a first operation of the first PIM operation on each of the plurality of element groups read along a second direction perpendicular to the first direction in response to received second addresses and second commands, and One of the first direction and the second direction includes a row direction, the other of the first direction and the second direction includes a column direction, and the plurality of storage units are arranged along the row direction and the column direction.
15. The method according to claim 14, further comprising: include: in the first operation mode, causing the logic circuit to perform a second operation in the first PIM operation on a result of the first operation and each PIM data previously stored in the logic circuit, The PIM data includes a result of the first PIM operation performed based on the previously received third data and the plurality of element groups read in response to the previously received second command and second address.
16. The method according to claim 13, in, The second data includes a plurality of element groups, each of the plurality of element groups includes a plurality of elements recorded at the plurality of storage units along a first direction, and the method further includes: In the second operation mode, the logic circuit is caused to perform a first operation of the second PIM operation on the fourth data and each of the plurality of element groups read along the first direction in response to a received second command and a weight address.
17. The method according to claim 16, further comprising: include: in the second operation mode, causing the logic circuit to perform a second operation in the second PIM operation on a result of the first operation and each PIM data previously stored in the logic circuit, The PIM data includes a result of the second PIM operation performed based on the previously received fourth data and the plurality of element groups read along the first direction in response to the previously received second command and weight address.
18. A method for operating a storage device, the storage device comprising a plurality of memory chips, each of the plurality of memory chips comprising a plurality of storage units, the method include: In the first operation mode, the logic circuit included in the storage device is caused to perform operations including the following: recording first data at the plurality of storage units based on a first command and a first address received from a host; and performing a first PIM operation based on third data received from the host and the first data read in response to a second command and a second address received from the host, the PIM being a process in memory, and In the second operation mode, the logic circuit is caused to perform operations including: recording second data at the plurality of storage units based on the first command and the first address; receiving fourth data from the host; generating an index when the fourth data includes a non-zero value; generating a weighted address based on the index in response to the second command and the second address; and A second PIM operation is performed based on the fourth data and the second data read in response to the second command and the weight address.
19. The method according to claim 18, in, The first data and the second data each include a plurality of element groups, each of the plurality of element groups includes a plurality of elements recorded at the plurality of storage units along a first direction, wherein the plurality of element groups included in the first data are read along a second direction perpendicular to the first direction in response to the second command and the second address, and wherein the plurality of element groups included in the second data are read along the first direction in response to the second command and the weight address, and One of the first direction and the second direction includes a row direction, the other of the first direction and the second direction includes a column direction, and the plurality of storage units are arranged along the row direction and the column direction.
20. The method according to claim 18, in, The first PIM operation and the second PIM operation both include a multiply-add operation.
