In-memory computing device and in-memory computing method

By using a combination of capacitors and switching devices in in-memory computing devices, signed multiplication and accumulation operations are realized, solving the problem of low adaptability of traditional in-memory computing architecture to neural networks, improving computing energy efficiency and saving money. device area.

WO2024193468A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081949
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2024-03-15
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

The traditional charge domain in-memory computing architecture is difficult to complete in-memory calculations of special values, resulting in low adaptability to neural networks and the inability to implement signed multiply-accumulate operations.

Method used

By using capacitors to store different values ​​in in-memory computing devices, the voltage states of the capacitors are defined as -1, 0, and 1, and switching devices are used for precharging and charge sharing to implement signed multiplication and accumulation operations, improving in-memory computing. Architectural suitability for neural networks.

Benefits of technology

It implements signed multiplication and accumulation operations, improves the adaptability of in-memory computing devices to neural networks, improves computing energy efficiency without increasing power consumption, and makes the device structure more compact, saving device area. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081949_26092024_PF_FP
    Figure CN2024081949_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are an in-memory computing device and an in-memory computing method. The in-memory computing method comprises: charging each capacitor to a first preset voltage; at a certain moment, performing multiplication operation on an input signal of one in-memory computing unit among one or more in-memory computing units and weight data in a memory device of the in-memory computing unit, so as to obtain multiplication operation results output by one or more tiles, wherein the multiplication operation result output by each tile is represented by means of the voltage of a capacitor connected to the tile, and the voltage of the capacitor comprises the first preset voltage, a second preset voltage or a third preset voltage; and performing accumulation operation on the multiplication operation results output by the one or more tiles. In the embodiments of the present application, signed multiplication-accumulation operation can be realized by means of different values stored in a capacitor, thereby improving the adaptability of an in-memory computing architecture to a network.
Need to check novelty before this filing date? Find Prior Art

Description

In-memory computing device and in-memory computing method

[0001] This application claims priority to the Chinese patent application with application number 202310306302.0 filed with the State Intellectual Property Office of China on March 21, 2023, and priority to the Chinese patent application entitled “A memory computing device and a memory computing method”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of in-memory computing, and in particular to an in-memory computing device and an in-memory computing method. Background Art

[0003] In the von Neumann architecture, the central processing unit (CPU) retrieves instructions and data from memory to perform calculations, then sends the results back to memory for storage. The physical separation between where data is stored and where it is processed consumes energy. This is why the industry has proposed in-memory computing architectures. Traditional charge-domain in-memory computing architectures solve common multiplication-accumulation problems, but struggle with in-memory computations involving specialized numerical values, making them less suitable for neural networks.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide an in-memory computing device and an in-memory computing method, which can realize signed multiplication and accumulation operations through different values ​​stored in capacitors, thereby improving the adaptability of the in-memory computing architecture to the network.

[0006] In a first aspect, an embodiment of the present application provides an in-memory computing device, including one or more tiles, one or more first switching devices, one or more capacitors, and a first power supply;

[0007] The output terminals of one or more tiles are respectively connected to the first terminals of one or more first switching devices, and are respectively connected to the first side plates of one or more capacitors;

[0008] The first terminals of the one or more first switching devices are respectively connected to the first side plates of the one or more capacitors, and the second side plates of the one or more capacitors are grounded; and

[0009] The second terminals of the one or more first switching devices are connected to the first power source.

[0010] In an embodiment of the present application, the state of a fully discharged capacitor is predefined as -1, the state of charging to VDD / 2 is 0, and the state of charging to VDD is 1. One or more capacitors can be precharged through the first power supply and the first switching device of the in-memory computing device. The output signals of one or more tiles can be stored in the capacitors connected thereto. By defining the state corresponding to the voltage of the capacitor, the multiplication results output by one or more tiles are represented by the state corresponding to the voltage of the capacitor connected thereto, and a signed multiplication operation can be realized (i.e., a three-state multiplication operation of -1, 0, 1 is realized), which is beneficial to improving the adaptability of the in-memory computing device to the network.

[0011] In one possible implementation, each tile is implemented based on one or more in-memory computing units, each of which includes a storage device and a second switching device;

[0012] A first end of the second switch device is connected to the output end of the memory device, and a second end of the second switch device is connected to the first charge sharing line, which is the output end of the tile.

[0013] In this implementation, the multiplication operation of the weight data in the storage device and the input signal can be achieved by opening / closing the second switch device, and the multiplication result is output through the output end of the tile and stored in the capacitor.

[0014] In a possible implementation, the device further includes a second charge sharing line and a third switching device;

[0015] The second terminal of the one or more first switching devices is connected to the second charge sharing line, the second charge sharing line is connected to the first terminal of the third switching device; and the second terminal of the third switching device is connected to the first power source.

[0016] In this implementation, the capacitor of the in-memory computing device can be precharged through the first switching device, the second charge sharing line, the third switching device, and the first power supply.

[0017] In a second aspect, an embodiment of the present application provides an in-memory computing device, including one or more tiles, one or more first switching devices, one or more capacitors, a first power supply, a second power supply, and a third power supply;

[0018] The first terminals of the one or more first switching devices are respectively connected to the output terminals of the one or more tiles, or to the first power supply, or to the second power supply;

[0019] The second ends of the one or more first switching devices are respectively connected to the first side plates of the one or more capacitors;

[0020] The second side plates of the one or more capacitors are connected to a third power source.

[0021] In an embodiment of the present application, the state of a fully discharged capacitor is predefined as -1, the state of charging to VDD / 2 is 0, and the state of charging to VDD is 1. The first power supply and the first switching device of the in-memory computing device can be used to precharge the first side plates of one or more capacitors to achieve a reset before each multiplication and accumulation operation. And the second side plates of one or more capacitors can be precharged through the third power supply. By defining the state corresponding to the voltage of the capacitor, the multiplication results output by one or more tiles are represented by the state corresponding to the voltage of the first side plates of the capacitor connected thereto, and a signed multiplication operation can be achieved (i.e., a three-state multiplication operation of -1, 0, 1 is achieved). The multiplication result stored in the first side plate of the capacitor can be converted to the second side plate through the second power supply to achieve accumulation operation, which is beneficial to improving the adaptability of the in-memory computing device to the network. In addition, the capacitors of the in-memory computing device can be reused with the capacitors of the ADC, which can improve the computing energy efficiency while making the structure of the device more compact, which is beneficial to saving device area.

[0022] In one possible implementation, each tile is implemented based on one or more in-memory computing units, each of which includes a storage device and a second switching device;

[0023] A first end of the second switch device is connected to the output end of the memory device, and a second end of the second switch device is connected to the first charge sharing line, which is the output end of the tile.

[0024] In this implementation, the second switch device is opened / closed to realize the multiplication operation of the weight data in the storage device and the input signal, and the multiplication result is output through the output end of the tile and stored in the first side plate of the capacitor.

[0025] In a possible implementation, the device further includes a third charge sharing line and a fourth switching device;

[0026] The second side plates of the one or more capacitors are connected to the third charge sharing line, the third charge sharing line is connected to the first end of the fourth switching device, and the second end of the fourth switching device is connected to the third power source.

[0027] In this implementation, the second-side plate of the capacitor of the in-memory computing device can be precharged through the third charge sharing line, the fourth switching device, and the third power supply.

[0028] In a third aspect, an embodiment of the present application provides an in-memory computing method, applied to the in-memory computing device of the first aspect, wherein the voltage output by the first power supply is a first preset voltage; the memory device is used to store weight data; the method includes:

[0029] charging each capacitor to a first predetermined voltage;

[0030] At a certain moment, an input signal of one of the one or more in-memory computing units is multiplied by weight data in a storage device of the in-memory computing unit to obtain a multiplication result output by one or more tiles; the multiplication result output by each tile is represented by a voltage of a capacitor connected to the tile, and the voltage of the capacitor includes a first preset voltage, a second preset voltage, or a third preset voltage;

[0031] Performs accumulation operation on the multiplication results output by one or more tiles.

[0032] In an embodiment of the present application, the state of a fully discharged capacitor is predefined as -1, the state of charging to VDD / 2 is 0, and the state of charging to VDD is 1. Connecting the first switching device of the in-memory computing device to the first power supply can pre-charge one or more capacitors. The output signals of one or more tiles can be stored in the capacitors connected thereto. By defining the state corresponding to the voltage of the capacitor, the multiplication results of the outputs of one or more tiles are represented by the state corresponding to the voltage of the capacitor connected thereto, thereby realizing signed multiplication operations, thereby facilitating improving the adaptability of the in-memory computing device to the network.

[0033] In one possible implementation, charging each capacitor to a first preset voltage includes:

[0034] One or more first switching devices and a third switching device are controlled to be closed to charge each capacitor to a first preset voltage.

[0035] In this implementation, the capacitor is reset before each multiplication-accumulation operation, which can ensure that the two operations will not affect each other, and can implement signed multiplication operations through pre-charging operations.

[0036] In one possible implementation, at a certain moment, performing a multiplication operation on an input signal of one of the one or more in-memory computing units and weight data in a storage device of the in-memory computing unit includes:

[0037] controlling one or more first switching devices and a third switching device to be turned off; and

[0038] At a certain moment, in response to an input signal of one of the one or more in-memory computing units, the second switching device connected to the in-memory computing unit is controlled to be closed / opened, thereby realizing the multiplication operation of the input signal and the weight data in the storage device of the in-memory computing unit.

[0039] In this implementation, the second switch device connected to the in-memory computing unit is controlled to be closed / opened by an input signal, and a signed multiplication operation can be realized in combination with a pre-charging operation.

[0040] In one possible implementation, performing an accumulation operation on the multiplication results output by one or more tiles includes:

[0041] Controlling the second switch device connected to the in-memory computing unit to disconnect;

[0042] controlling the third switching device to be turned off; and,

[0043] One or more first switching devices are controlled to be closed so that the multiplication results output by one or more tiles are charge-shared through the second charge-sharing line, thereby realizing the accumulation operation of the multiplication results output by one or more tiles.

[0044] In this implementation, by controlling the first switch device to be closed, the capacitor can share charges through the second charge sharing line, thereby achieving an accumulation operation.

[0045] In a fourth aspect, an embodiment of the present application provides an in-memory computing method, which is applied to the in-memory computing device of the second aspect, wherein the voltage output by the first power supply is a first preset voltage, and the voltages output by the second power supply and the third power supply are a fourth preset voltage; and the memory device is used to store weight data; the method comprising:

[0046] charging the first side plate of each capacitor to a first preset voltage, and charging the second side plate of each capacitor to a fourth preset voltage;

[0047] At a certain moment, an input signal of one of the one or more in-memory computing units is multiplied by weight data in a storage device of the in-memory computing unit to obtain a multiplication result output by one or more tiles;

[0048] Changing the voltage of the first side plates of the one or more capacitors to a voltage corresponding to a multiplication result of the output of the tile connected to the first side plates of the one or more capacitors or maintaining the voltage of the first side plates of the one or more capacitors unchanged; the voltage of the first side plates of the one or more capacitors includes a first preset voltage, a second preset voltage, or a third preset voltage;

[0049] The voltage of the first side plate of one or more capacitors is changed to a second preset voltage to implement an accumulation operation of the multiplication operation results output by one or more tiles.

[0050] In an embodiment of the present application, the first switching device of the in-memory computing device is connected to the first power supply, so that the first side plates of one or more capacitors can be precharged to achieve a reset before each multiplication and accumulation operation. The second side plates of one or more capacitors are connected to the third power supply, so that the second side plates of one or more capacitors can be precharged. By defining the state corresponding to the voltage of the capacitor, one or more output multiplication results are represented by the state corresponding to the voltage of the first side plate of the capacitor connected thereto, so that a signed multiplication operation can be achieved. The multiplication result stored on the first side plate of the capacitor can be converted to the second side plate through the second power supply to achieve accumulation operation, which is beneficial to improving the adaptability of the in-memory computing device to the network.

[0051] In one possible implementation, at a certain moment, performing a multiplication operation on an input signal of one of the one or more in-memory computing units and weight data in a storage device of the in-memory computing unit includes:

[0052] controlling one or more first switching devices and a fourth switching device to be turned off; and

[0053] At a certain moment, in response to an input signal of one of the one or more in-memory computing units, the second switching device connected to the in-memory computing unit is controlled to be closed / opened, thereby realizing the multiplication operation of the input signal and the weight data in the storage device of the in-memory computing unit.

[0054] In this implementation, the second switch device connected to the in-memory computing unit is controlled to be closed / opened by an input signal, and a signed multiplication operation can be realized in combination with a pre-charging operation.

[0055] In one possible implementation, charging the first-side plate of each capacitor to a first preset voltage includes:

[0056] Controlling the first end of one or more first switching devices to be connected to the first power source to charge the first side plate of each capacitor to a first preset voltage;

[0057] Charging the second side plate of each capacitor to a fourth preset voltage includes:

[0058] The fourth switch device is controlled to be closed to charge the second side plate of each capacitor to a fourth preset voltage.

[0059] In this implementation, the capacitor is reset before each multiplication-accumulation operation, which can ensure that the two operations will not affect each other, and can implement signed multiplication operations through pre-charging operations.

[0060] In one possible implementation, converting the voltage of the first-side plates of the one or more capacitors into a multiplication result of a tile output that is conductive with the first-side plates of the one or more capacitors includes:

[0061] The first ends of the one or more first switching devices are controlled to be respectively connected to the output ends of the one or more tiles, so as to convert the voltage of the first side plates of the one or more capacitors into a multiplication result of the output of the tiles respectively connected to the first side plates of the one or more capacitors.

[0062] In this implementation, the multiplication result is stored in the first-side plate of the capacitor, and the multiplication result can be represented by the state corresponding to the voltage of the first-side plate, thereby realizing a signed multiplication operation.

[0063] In one possible implementation, changing the voltage of the first-side plates of one or more capacitors to a fourth preset voltage to implement an accumulation operation of multiplication results output by one or more tiles includes:

[0064] controlling the fourth switching device to be turned off; and,

[0065] Control the first end of one or more first switching devices to be turned on by the second power supply to change the voltage of the first side plate of one or more capacitors to a fourth preset voltage, so that the multiplication results output by one or more tiles are accumulated through the third charge sharing line.

[0066] In this implementation, by connecting the first end of the first switching device to the second power supply, the multiplication result stored in the first side plate of each capacitor can be converted to the second side plate of the capacitor, so that the multiplication results output by one or more tiles can be accumulated through the third charge sharing line. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0068] FIG1 is a schematic structural diagram of an in-memory computing device provided in an embodiment of the present application;

[0069] FIG2 is a schematic diagram of the structure of an in-memory computing unit provided in an embodiment of the present application;

[0070] FIG3 is a schematic diagram of an input signal of an in-memory computing unit provided in an embodiment of the present application;

[0071] FIG4 is a schematic diagram of the structure of another in-memory computing device provided in an embodiment of the present application;

[0072] FIG5 is a schematic diagram of a multiplication truth table provided in an embodiment of the present application;

[0073] FIG6 is a schematic diagram of the structure of another in-memory computing device provided in an embodiment of the present application;

[0074] FIG7 is a schematic diagram of the structure of another in-memory computing device provided in an embodiment of the present application;

[0075] FIG8 is a schematic diagram of a flow chart of an in-memory computing method provided in an embodiment of the present application;

[0076] FIG9 is a schematic diagram of an overall implementation of an in-memory computing method provided in an embodiment of the present application;

[0077] FIG10 is a flow chart of another in-memory computing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0079] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0080] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both an application running on a terminal device and a terminal device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, through local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems via signals).

[0081] To facilitate understanding of the embodiments of the present application, further analyze and propose the technical problems to be specifically solved by the present application, the relevant technical solutions of the present application are briefly introduced below.

[0082] One of the related technologies proposes an in-memory analog-digital hybrid computing subunit, comprising a conventional 6T static random-access memory (SRAM) unit, a complementary transmission gate, a first N-type metal-oxide-semiconductor field-effect transistor (MOSFET; MOS tube for short), and a computing capacitor; the conventional 6T SRAM unit is composed of MOS tubes M1, M2, M3, M4, M5, and M6, wherein the complementary metal oxide semiconductor (CMOS) inverter formed by MOS tubes M1 and M2 is cross-coupled with the CMOS inverter formed by MOS tubes M3 and M4, and the two cross-coupled CMOS inverters store a 1-bit filter parameter, and M5 and M6 are control switches for the bit line used to read and write the filter parameter; the conventional 6T The output of the CMOS inverter formed by M1 and M2 in the SRAM cell is connected to the input of a complementary transmission gate, the output of which is connected to the drain of a first N-type MOS transistor. The source of the first N-type MOS transistor is grounded, and the drain is connected to the bottom plate of a computation capacitor. The gate of the N-type MOS transistor of the complementary transmission gate is connected to the input signal, while the gate of the P-type MOS transistor is connected to the complementary input signal, which has the same voltage level as the gate input signal of the first N-type MOS transistor during computation. The multiplication result of the input signal and the filter parameter is stored as the voltage of the bottom plate of the computation capacitor. Multiple sub-units are used to form a computation unit, and each sub-unit within the same computation unit shares the same first N-type MOS transistor and computation capacitor. This solution focuses on solving the problems of low computational efficiency and high computational error rate in in-memory computation, and cannot implement signed multiplication and accumulation operations.

[0083] Related technology No. 2 proposes a memory device, a computing device, and a computing method, wherein the memory device includes: a storage element having a write control input, a weight input, and a weight output, and adapted to receive a weight value at the weight input and store the weight value in response to a write control signal from the write control input; a capacitor; a first switching device having a data input and adapted to interconnect the weight output of the storage element to the first end of the capacitor in response to a data input control signal at the data input; and a second switching device having a read control input and adapted to interconnect the first end of the capacitor to a read bit line ("RBL") in response to a read control signal at the read control input. This solution focuses on solving the problem of computing performance in in-memory computing, and also cannot implement signed multiplication and accumulation operations.

[0084] The following is a detailed description of the in-memory computing device and the in-memory computing method provided in the embodiments of the present application in conjunction with the accompanying drawings.

[0085] Please refer to Figure 1, which is a schematic diagram of the structure of an in-memory computing device provided by an embodiment of the present application. As shown in Figure 1, the in-memory computing device includes one or more tiles, one or more first switching devices SW1, one or more capacitors C, and a first power supply.

[0086] The output terminals of one or more tiles are respectively connected to the first terminals of one or more first switching devices SW1, and are respectively connected to the first side plates of one or more capacitors C;

[0087] The first terminals of the one or more first switching devices SW1 are respectively connected to the first side plates (upper plates) of the one or more capacitors C, and the second side plates (lower plates) of the one or more capacitors C are grounded; and

[0088] A second terminal of the one or more first switching devices SW1 is connected to a first power source.

[0089] For example, as shown in Figure 2, each tile is implemented based on one or more in-memory computing units, each of which includes a memory device and a second switching device SW2. A first terminal of the second switching device SW2 is connected to the output terminal of the memory device, and a second terminal of the second switching device SW2 is connected to a first charge sharing line, which is the output terminal of the tile.

[0090] The storage device in each in-memory computing unit is used to store weight data. As shown in FIG3 , the second switch device SW2 in each in-memory computing unit is used to close / open in response to the input signal Xin to implement the multiplication operation of the weight data in the storage device and the input signal. It should be noted that for each tile, at a certain moment, only one in-memory computing unit is working. That is, the multiplication result output by the tile at a certain moment is the multiplication result output by one in-memory computing unit in the tile.

[0091] Exemplarily, the memory device is a standard 6T SRAM, which is composed of two cross-coupled inverters and two switch MOS transistors and is used to store 1-bit privileged value data.

[0092] For example, as shown in Figure 4 , the in-memory computing device further includes a second charge-sharing line and a third switching device SW3. The second end of one or more first switching devices SW1 is connected to the second charge-sharing line, which is connected to the first end of the third switching device SW3; and the second end of the third switching device SW3 is connected to the first power supply. It should be noted that Figure 4 only illustrates one in-memory computing unit in each tile and does not limit the present embodiment.

[0093] Exemplarily, the voltage output by the first power supply is a first preset voltage, such as VDD / 2. For each capacitor C in the in-memory computing device shown in FIG4 , the fully discharged state of the capacitor C is defined as -1, the state charged to VDD / 2 is defined as 0, and the state charged to VDD is defined as 1. The weight data Q stored in the memory device is defined as representing 1 when it is at a high level and representing -1 when it is at a low level. The weight data is stored in the memory device in the form of +1 and -1 (i.e., + / -1 encoding).

[0094] Specifically, based on the in-memory computing device shown in FIG4 , the embodiment of the present application can implement multiplication and accumulation operations through the following operations:

[0095] (1) Reset

[0096] The first switch SW1 and the third switch SW3 are controlled to be closed to charge each capacitor to a first preset voltage (ie, VDD / 2). In this implementation, the capacitor C is reset before each multiplication and accumulation operation to ensure that the two operations do not affect each other.

[0097] (2) Multiplication

[0098] The first and third switching devices SW1 and SW3 are controlled to be off. At a certain moment, in response to an input signal Xin from an in-memory computing unit in a tile, the second switching device SW2 connected to the in-memory computing unit is controlled to be closed or opened, thereby performing a multiplication operation on the input signal and the weight data stored in the memory device of the in-memory computing unit. The multiplication result output by each tile can be stored in the capacitor C connected to it, that is, the voltage of the capacitor C connected to each tile represents the multiplication result output by the tile.

[0099] For example, when the input signal Xin is 0, it means that the second switch device SW2 is controlled to be disconnected, and when the input signal Xin is 1, it means that the second switch device SW2 is controlled to be closed. The multiplication truth table can be shown in Figure 5. For an in-memory calculation unit in a tile, when the input signal Xin is 0, the second switch device SW2 of the in-memory calculation unit is controlled to be disconnected, and the result of the multiplication operation of the weight data and the input signal is 0, that is, the capacitor C connected thereto is neither charged nor discharged, and the state corresponding to its voltage (VDD / 2) represents the result of the multiplication operation. When the input signal Xin is 1, the second switch device SW2 of the in-memory calculation unit is controlled to be closed. If the weight data stored in its storage device is 1 (the corresponding voltage is VDD), the result of the multiplication operation of the weight data and the input signal is 1, that is, the capacitor C connected thereto is charged, and the state corresponding to its voltage (VDD) represents the result of the multiplication operation. When the input signal Xin is 1, the second switch device SW2 of the in-memory calculation unit is controlled to be closed. If the weight data stored in the storage device is -1 (indicating a low level, the actual stored value is 0), the multiplication result of the weight data and the input signal is -1, that is, the capacitor C connected to it is discharged, and the state corresponding to its voltage (0) represents the multiplication result.

[0100] (3) Accumulation operation

[0101] For the in-memory computing unit in step (2), the second switch device SW2 connected thereto is controlled to be disconnected, the third switch device SW3 is controlled to be disconnected, and all the first switch devices SW1 are controlled to be closed, so that the charges stored in all capacitors C are shared through the second charge sharing line, thereby realizing the accumulation operation of the multiplication results output by one or more tiles, and the result of the accumulation operation is used as the input of the analog to digital converter (ADC).

[0102] It can be seen that in the embodiment of the present application, the first power supply and the first switching device SW1 of the in-memory computing device can be used to precharge one or more capacitors C to achieve a reset before each multiplication and accumulation operation. By defining the state corresponding to the voltage of the capacitor C, the multiplication result output by one or more tiles is represented by the voltage state of the capacitor C connected thereto, and a signed multiplication operation can be achieved (i.e., a three-state multiplication operation of -1, 0, and 1 is achieved), which is conducive to improving the adaptability of the in-memory computing device to the network. At the same time, without increasing power consumption, the computing energy efficiency is improved.

[0103] Please refer to Figure 6, which is a schematic diagram of the structure of another in-memory computing device provided in an embodiment of the present application. As shown in Figure 6, the in-memory computing device includes one or more tiles, one or more first switching devices SW1, one or more capacitors C, a first power supply, a second power supply, and a third power supply.

[0104] The first terminals of the one or more first switching devices SW1 are respectively connected to the output terminals of the one or more tiles, or to the first power supply, or to the second power supply;

[0105] The second ends of the one or more first switching devices SW1 are respectively connected to the first side plates of the one or more capacitors C;

[0106] The second side plates of the one or more capacitors C are connected to a third power source.

[0107] Exemplarily, each tile is implemented based on one or more in-memory computing units, each of which includes a memory device and a second switching device SW2. A first terminal of the second switching device SW2 is connected to an output terminal of the memory device, and a second terminal of the second switching device SW2 is connected to a first charge sharing line, which is the output terminal of the tile.

[0108] The storage device in each in-memory computing unit is used to store weight data. The second switching device SW2 in each in-memory computing unit is configured to close / open in response to an input signal Xin to implement a multiplication operation between the weight data in the storage device and the input signal. Exemplarily, the storage device is a standard 6T SRAM.

[0109] Exemplarily, as shown in FIG7 , the in-memory computing device further includes a third charge sharing line and a fourth switching device SW4 . The second plates of one or more capacitors C are connected to the third charge sharing line, which is connected to a first terminal of the fourth switching device SW4 . The second terminal of the fourth switching device SW4 is connected to a third power source.

[0110] Exemplarily, the voltage output by the first power supply is a first preset voltage (e.g., VDD / 2), the voltage output by the second power supply and the third power supply is a fourth preset voltage, the fourth preset voltage may be a common mode voltage (VCM), and the fourth switch device may be a common mode switch (SWcm). The state of the capacitor C being fully discharged is defined as -1, the state being charged to VDD / 2 is defined as 0, and the state being charged to VDD is defined as 1. The weight data Q stored in the memory device is defined as representing 1 when it is at a high level and representing -1 when it is at a low level. The weight data is stored in the memory device in the form of +1 and -1 (i.e., + / -1 encoding).

[0111] Specifically, based on the in-memory computing device shown in FIG7 , the embodiment of the present application can implement multiplication and accumulation operations through the following operations:

[0112] (1) Precharge

[0113] The first terminal of the first switching device SW1 is controlled to be conductive with the first power supply to charge the first plate of each capacitor C to a first preset voltage (i.e., VDD / 2). Furthermore, the fourth switching device SW4 is controlled to be closed to charge the second plate of each capacitor C to a fourth preset voltage (i.e., VCM).

[0114] (2) Multiplication

[0115] The first switch device SW1 and the fourth switch device SW4 are controlled to be disconnected. At a certain moment, in response to the input signal Xin of an in-memory computing unit in the tile, the second switch device SW2 connected to the in-memory computing unit is controlled to be closed / disconnected, thereby realizing the multiplication operation of the input signal and the weight data in the storage device of the in-memory computing unit. The multiplication operation truth table can be referred to Figure 5 and will not be described in detail here. The first end of the first switch device SW1 is controlled to be connected to the output end of the tile to change the voltage of the first side plate of each capacitor C to a voltage corresponding to the multiplication operation result output by the tile whose first side plate is connected, so as to store the multiplication operation result in the first side plate of the capacitor C connected to the tile, or keep the voltage of the first side plate of one or more capacitors unchanged, that is, the voltage of the first side plate of the capacitor C connected to each tile represents the multiplication operation result output by the tile. It should be noted that when the input signal of the in-memory computing unit working in the Tile is 0, the multiplication result output by the Tile is 0, and the voltage of the first side plate of the corresponding capacitor remains unchanged (for example: maintaining the VDD / 2 state), that is, the multiplication result stored in the first side plate of the capacitor is 0.

[0116] (3) Accumulation operation

[0117] The fourth switch device SW4 is controlled to be disconnected, and the first end of the first switch device SW1 is controlled to be conductively connected to the second power supply, so that the voltage of the first side plate of each capacitor C is changed to a fourth preset voltage, and the multiplication result stored in the first side plate of each capacitor C is transferred to the second side plate of the capacitor C. The multiplication results output by one or more tiles are accumulated via the third charge sharing line, and the accumulated result serves as the input of the ADC. It should be noted that the capacitor C in Figure 7 can also serve as the capacitor of the ADC. That is, the in-memory computing device shown in Figure 7 realizes the reuse of capacitors and ADC capacitors, which can make the device structure more compact and help save device area.

[0118] Specifically, for example, if the result output by a certain tile is a, then after the first switching device SW1 connected to it and its output end are turned on, a is stored in the first side plate of the corresponding capacitor C, and the voltage difference between the first side plate and the second side plate of the capacitor C is a-VCM. Now the first end of the first switching device SW1 is turned on to the second power supply, and the voltage of the first side plate of the capacitor C becomes VCM. In order to maintain the voltage difference between the first side plate and the second side plate of the capacitor C, the voltage of the second side plate of the capacitor C becomes 2VCM-a, that is, a is converted to the second side plate of the capacitor C.

[0119] It can be seen that in the embodiment of the present application, the first side plates of one or more capacitors C can be precharged through the first power supply and the first switching device SW1 of the in-memory computing device to achieve a reset before each multiplication and accumulation operation. And the second side plates of one or more capacitors C can be precharged through the third power supply. By defining the state corresponding to the voltage of the capacitor C, the multiplication results output by one or more tiles are represented by the voltage state of the first side plate of the capacitor C connected thereto, and a signed multiplication operation can be achieved (that is, a three-state multiplication operation of -1, 0, 1 is achieved). The multiplication result stored in the first side plate of the capacitor C can be converted to the second side plate through the second power supply to achieve accumulation operation, which is beneficial to improving the adaptability of the in-memory computing device to the network. In addition, the capacitor C of the in-memory computing device can be reused with the capacitor of the ADC, which can make the structure of the device more compact while improving the computing energy efficiency, which is beneficial to saving device area.

[0120] Please refer to Figure 8, which is a flow chart of an in-memory computing method provided by an embodiment of the present application. The method can be applied to the in-memory computing device shown in Figure 4. As shown in Figure 8, the method may include the following steps:

[0121] 801: Charge each capacitor in the in-memory computing device to a first preset voltage.

[0122] In the embodiment of the present application, referring to the in-memory computing device shown in FIG4 , one or more first switching devices SW1 and third switching devices SW3 are controlled to be closed to charge each capacitor C to a first preset voltage via a first power supply. Exemplarily, the first preset voltage is VDD / 2.

[0123] In this implementation, the capacitor C is reset before each multiplication-accumulation operation, which can ensure that the two operations will not affect each other, and can implement signed multiplication operations through pre-charging operations.

[0124] 802: For each tile, at a certain moment, an input signal of one of the one or more in-memory computing units is multiplied by weight data in the storage device of the in-memory computing unit to obtain one or more output multiplication results; the multiplication result output by each tile is represented by the voltage of a capacitor connected to the tile, and the voltage of the capacitor includes a first preset voltage, a second preset voltage, or a third preset voltage.

[0125] In the embodiment of the present application, the first switching device SW1 and the third switching device SW3 are controlled to be disconnected. At a certain moment, in response to an input signal Xin from an in-memory computing unit in a tile, the second switching device SW2 connected to the in-memory computing unit is controlled to be closed / opened, thereby performing a multiplication operation between the input signal and the weight data stored in the storage device of the in-memory computing unit. The multiplication result output by each tile can be stored in the capacitor C connected thereto, that is, the voltage of the capacitor C connected to each tile represents the multiplication result output by the tile. The second preset voltage is 0, and the third preset voltage is VDD.

[0126] In the embodiment of the present application, the state of the capacitor C being fully discharged is defined as -1, the state of being charged to VDD / 2 is defined as 0, and the state of being charged to VDD is defined as 1.

[0127] As shown in Figure 9, weight data 1, -1 (corresponding voltage is 0), 1 are stored in the three in-memory computing units respectively, the first switch device SW1 and the third switch device SW3 are controlled to be closed, and the second switch device SW2 is disconnected, so that each capacitor is charged to VDD / 2. The first switch device SW1 and the third switch device SW3 are controlled to be disconnected, and the signals 0, 1, and 1 are input to the three in-memory computing units respectively through Xin. Then, the multiplication operations of the three in-memory computing units are respectively: 1×0, -1×1, 1×1, and the multiplication results 0, -1, 1 are respectively represented by the voltages of the corresponding capacitors C: VDD / 2, 0, VDD. It should be noted that the three in-memory computing units are the in-memory computing units working in the three tiles at a certain moment.

[0128] 803: Perform accumulation operation on the multiplication results output by one or more tiles.

[0129] In an embodiment of the present application, the second switch device SW2 connected to the in-memory computing unit is controlled to be disconnected, the third switch device SW3 is controlled to be disconnected, and one or more first switch devices SW1 are controlled to be closed, so that the multiplication results output by one or more tiles are charge-shared through the second charge-sharing line (that is, each capacitor C is charge-shared through the second charge-sharing line), thereby realizing the accumulation operation of the multiplication results output by one or more tiles, which is expressed as: 1×0+(-1)×1+1×1=0 (the corresponding voltage is VDD / 2).

[0130] It can be seen that in the embodiment of the present application, the state of the fully discharged capacitor is predefined as -1, the state of charging to VDD / 2 is 0, and the state of charging to VDD is 1. The first switch device SW1 of the in-memory computing device is connected to the first power supply to pre-charge one or more capacitors. The output signal of one or more tiles can be stored in the capacitor C connected thereto. By defining the state corresponding to the voltage of the capacitor C, the multiplication result of the output of one or more tiles is represented by the state corresponding to the voltage of the capacitor C connected thereto, which can realize signed multiplication operation, thereby facilitating the improvement of the adaptability of the in-memory computing device to the network.

[0131] Please refer to Figure 10, which is a flow chart of another in-memory computing method provided by an embodiment of the present application. This method can be applied to the in-memory computing device shown in Figure 7. As shown in Figure 10, the method may include the following steps:

[0132] 1001: Charge the first side plate of each capacitor in the in-memory computing device to a first preset voltage, and charge the second side plate of each capacitor to a fourth preset voltage.

[0133] In an embodiment of the present application, the first end of one or more first switching devices SW1 is controlled to be connected to the first power supply to charge the first side plate of each capacitor to a first preset voltage (i.e., VDD / 2), and the fourth switching device SW4 is controlled to be closed to charge the second side plate of each capacitor C to a fourth preset voltage (i.e., VCM).

[0134] 1002: For each tile, at a certain moment, perform a multiplication operation on the input signal of one of the one or more in-memory computing units and the weight data in the storage device of the in-memory computing unit to obtain a multiplication result output by one or more tiles.

[0135] In the embodiment of the present application, one or more first switching devices SW1 and fourth switching devices SW4 are controlled to be off, and for each tile, at a certain moment, in response to an input signal from one of the one or more in-memory computing units, a second switching device connected to the in-memory computing unit is controlled to be closed / opened, thereby implementing a multiplication operation between the input signal and the weight data stored in the storage device of the in-memory computing unit. The specific implementation can be referred to the example described in FIG9 and will not be further described here.

[0136] 1003: Changing the voltage of the first side plates of the one or more capacitors to a voltage corresponding to a multiplication result of the tile output of the one or more capacitors to which the first side plates are turned on, or maintaining the voltage of the first side plates of the one or more capacitors unchanged; the voltage of the first side plates of the one or more capacitors includes a first preset voltage, a second preset voltage, or a third preset voltage.

[0137] In the embodiment of the present application, the first end of the first switching device SW1 is controlled to be conductive with the output end of the tile, so as to change the voltage of the first side plate of each capacitor C to a voltage corresponding to the multiplication result output by the tile whose first side plate is conductive, thereby storing the multiplication result in the first side plate of the capacitor C connected to the tile, that is, the voltage of the first side plate of the capacitor C connected to each tile represents the multiplication result output by the tile. It should be noted that when the input signal of the in-memory computing unit working in the tile is 0, the multiplication result output by the tile is 0. At this time, the voltage of the first side plate of the corresponding capacitor remains unchanged, that is, the multiplication result stored on the first side plate of the capacitor is 0.

[0138] 1004: Change the voltage of the first-side plate of one or more capacitors to a second preset voltage to implement an accumulation operation of the multiplication results output by one or more tiles.

[0139] In an embodiment of the present application, the fourth switching device SW4 is controlled to be disconnected, and the first end of the first switching device SW1 is controlled to be connected to the second power supply, so that the voltage of the first side plate of each capacitor C is changed to a fourth preset voltage, and the multiplication result stored in the first side plate of each capacitor C is converted to the second side plate of the capacitor C, so that the multiplication results output by one or more tiles are accumulated through the third charge sharing line.

[0140] It can be seen that in the embodiment of the present application, the first switching device SW1 of the in-memory computing device is connected to the first power supply, and the first side plates of one or more capacitors C can be precharged to achieve a reset before each multiplication and accumulation operation. The second side plates of one or more capacitors C are connected to the third power supply, and the second side plates of one or more capacitors C can be precharged. By defining the state corresponding to the voltage of the capacitor C, the multiplication results output by one or more tiles are represented by the voltage state of the first side plate of the capacitor C connected thereto, and a signed multiplication operation can be achieved. The multiplication result stored on the first side plate of the capacitor C can be converted to the second side plate through the second power supply to achieve accumulation operation, which is beneficial to improving the adaptability of the in-memory computing device to the network.

[0141] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0142] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. In the text description of this application, the character " / " generally indicates that the associated objects are in an "or" relationship.

[0143] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0144] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An in-memory computing device, characterized in that: It includes one or more tiles, one or more first switching devices, one or more capacitors and a first power supply; The output ends of the one or more tiles are respectively connected to the first ends of the one or more first switch devices, and are respectively connected to the first side plates of the one or more capacitors; The first ends of the one or more first switching devices are respectively connected to the first side plates of the one or more capacitors, and the second side plates of the one or more capacitors are grounded; as well as, The second terminals of the one or more first switching devices are connected to the first power source.

2. The in-memory computing device according to claim 1, characterized in that: Each of the Tile is implemented based on one or more in-memory computing units, each of which includes a storage device and a second switching device; A first end of the second switch device is connected to the output end of the storage device, and a second end of the second switch device is connected to a first charge sharing line, which is the output end of the Tile.

3. The in-memory computing device according to claim 1 or 2, characterized in that: Also comprising a second charge sharing line and a third switching device; The second end of the one or more first switching devices is connected to the second charge sharing line, the second charge sharing line is connected to the first end of the third switching device; and the second end of the third switching device is connected to the first power source.

4. An in-memory computing device, characterized in that: The device comprises one or more tiles, one or more first switching devices, one or more capacitors, a first power supply, a second power supply and a third power supply; The first ends of the one or more first switch devices are respectively connected to the output ends of the one or more tiles, or to the first power supply, or to the second power supply; The second ends of the one or more first switching devices are respectively connected to the first side plates of the one or more capacitors; The second side plates of the one or more capacitors are connected to the third power source.

5. The in-memory computing device according to claim 4, characterized in that: Each of the Tile is implemented based on one or more in-memory computing units, each of which includes a storage device and a second switching device; A first end of the second switch device is connected to the output end of the storage device, and a second end of the second switch device is connected to a first charge sharing line, which is the output end of the Tile.

6. The in-memory computing device according to claim 4 or 5, characterized in that: Also comprising a third charge sharing line and a fourth switching device; The second side plates of the one or more capacitors are connected to the third charge sharing line, the third charge sharing line is connected to the first end of the fourth switch device, and the second end of the fourth switch device is connected to the third power source.

7. An in-memory computing method, characterized in that: Applied to the in-memory computing device of claim 3, the voltage output by the first power supply is a first preset voltage; The storage device is used to store weight data; The method comprises: charging each of the capacitors to the first preset voltage; At a certain moment, an input signal of one of the one or more in-memory computing units is multiplied by weight data in a storage device of the in-memory computing unit to obtain a multiplication result output by the one or more tiles; the multiplication result output by each tile is represented by a voltage of the capacitor connected to the tile, and the voltage of the capacitor includes the first preset voltage, the second preset voltage or the third preset voltage; Perform an accumulation operation on the multiplication results output by the one or more tiles.

8. The method according to claim 7, characterized in that The step of charging each of the capacitors to the first preset voltage comprises: The one or more first switching devices and the third switching device are controlled to be closed, so as to charge each of the capacitors to the first preset voltage.

9. The method according to claim 7 or 8, characterized in that: The method of performing a multiplication operation on an input signal of one of the one or more in-memory computing units and weight data in a storage device of the in-memory computing unit at a certain moment includes: controlling the one or more first switching devices and the third switching device to be turned off; and, At a certain moment, in response to an input signal of an in-memory computing unit among the one or more in-memory computing units, a second switching device connected to the in-memory computing unit is controlled to close / open, thereby realizing the multiplication operation of the input signal and the weight data in the storage device of the in-memory computing unit.

10. The method according to any one of claims 7 to 9, characterized in that: The accumulating operation on the multiplication results output by the one or more tiles includes: Controlling a second switch device connected to the in-memory computing unit to disconnect; controlling the third switch device to be turned off; and, The one or more first switch devices are controlled to be closed so that the multiplication results output by the one or more tiles are charge-shared through the second charge-sharing line, thereby realizing the accumulation operation of the multiplication results output by the one or more tiles.

11. An in-memory computing method, characterized in that: Applied to the in-memory computing device of claim 6, the voltage output by the first power supply is a first preset voltage, and the voltages output by the second power supply and the third power supply are fourth preset voltages; The storage device is used to store weight data; The method comprises: Charging the first side plate of each of the capacitors to the first preset voltage, and charging the second side plate of each of the capacitors to the fourth preset voltage; At a certain moment, multiplying an input signal of one of the one or more in-memory computing units by weight data in a storage device of the in-memory computing unit to obtain a multiplication result output by the one or more tiles; The voltage of the first side plates of the one or more capacitors is changed to a voltage corresponding to a multiplication result of the tile output of the first side plates of the one or more capacitors being turned on, or the voltage of the first side plates of the one or more capacitors is kept unchanged; the voltage of the first side plates of the one or more capacitors includes the first preset voltage, the second preset voltage or the third preset voltage; The voltage of the first side plates of the one or more capacitors is changed to the second preset voltage to implement the accumulation operation of the multiplication results output by the one or more tiles.

12. The method according to claim 11, characterized in that The method of performing a multiplication operation on an input signal of one of the one or more in-memory computing units and weight data in a storage device of the in-memory computing unit at a certain moment includes: controlling the one or more first switching devices and the fourth switching device to be turned off; and, At a certain moment, in response to an input signal of an in-memory computing unit among the one or more in-memory computing units, a second switching device connected to the in-memory computing unit is controlled to be closed / opened, so as to realize the multiplication operation of the input signal and the weight data in the storage device of the in-memory computing unit.

13. The method according to claim 11 or 12, characterized in that: The step of charging the first side plate of each capacitor to the first preset voltage comprises: Controlling the first end of the one or more first switching devices to be connected to the first power source to charge the first side plate of each of the capacitors to the first preset voltage; The step of charging the second side plate of each capacitor to the fourth preset voltage comprises: The fourth switch device is controlled to be closed to charge the second side plate of each of the capacitors to the fourth preset voltage.

14. The method according to any one of claims 1 to 13, characterized in that: The step of converting the voltage of the first side plates of the one or more capacitors into a multiplication result of the Tile output that is connected to the first side plates of the one or more capacitors comprises: The first ends of the one or more first switching devices are controlled to be respectively connected to the output ends of the one or more tiles, so as to convert the voltage of the first side plates of the one or more capacitors into a multiplication result of the output of the tiles respectively connected to the first side plates of the one or more capacitors.

15. The method according to any one of claims 11 to 13, characterized in that: The step of changing the voltage of the first side plates of the one or more capacitors to the fourth preset voltage to implement the accumulation operation of the multiplication results output by the one or more tiles includes: controlling the fourth switch device to be turned off; and, The first ends of the one or more first switching devices are controlled to be turned on with the second power supply to change the voltage of the first side plates of the one or more capacitors into the fourth preset voltage, so as to achieve accumulation of the multiplication results of the one or more Tile outputs through the third charge sharing line.

Citation Information

Patent Citations

  • Direct photocurrent calculation unit circuit

    CN111901541A

  • Subunit, MAC (Media Access Control) array and analog-digital hybrid in-memory calculation module with reconfigurable bit width

    CN113627601A

  • Multi-bit vector-matrix product arithmetic unit based on 8T-SRAM unit

    CN114547546A

  • Charge sharing in-memory computing device

    CN114743580A

  • SRAM (Static Random Access Memory) storage and calculation integrated chip based on local capacitance charge sharing

    CN115080501A