[go: up one dir, main page]

WO2025060063A1 - 基于存算一体实现函数计算的方法、装置、系统 - Google Patents

基于存算一体实现函数计算的方法、装置、系统 Download PDF

Info

Publication number
WO2025060063A1
WO2025060063A1 PCT/CN2023/120690 CN2023120690W WO2025060063A1 WO 2025060063 A1 WO2025060063 A1 WO 2025060063A1 CN 2023120690 W CN2023120690 W CN 2023120690W WO 2025060063 A1 WO2025060063 A1 WO 2025060063A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
current
power term
word line
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2023/120690
Other languages
English (en)
French (fr)
Inventor
周海洋
呼红阳
李智
周治道
许晓欣
谢元禄
窦春萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Microelectronics of CAS
Original Assignee
Institute of Microelectronics of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Microelectronics of CAS filed Critical Institute of Microelectronics of CAS
Priority to PCT/CN2023/120690 priority Critical patent/WO2025060063A1/zh
Publication of WO2025060063A1 publication Critical patent/WO2025060063A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C11/00Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor
    • G11C11/21Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements
    • G11C11/34Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices
    • G11C11/40Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors
    • G11C11/401Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors forming cells needing refreshing or charge regeneration, i.e. dynamic cells
    • G11C11/4063Auxiliary circuits, e.g. for addressing, decoding, driving, writing, sensing or timing

Definitions

  • the present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device, and system for implementing function computing based on storage and computing integration.
  • the present disclosure provides a method for implementing function computing based on storage and computing integration.
  • a method for realizing function calculation based on storage and calculation integration comprising: for a first power term in a first Taylor expansion in a first function to be calculated, adjusting a first conductance value of a variable resistor on a word line corresponding to the first power term in a semiconductor memory device according to a coefficient value of a first coefficient corresponding to the first power term; inputting a pulse voltage to a word line through a variable resistor in the semiconductor memory device according to the value of the first power term to obtain a first current output by a bit line; performing analog-to-digital conversion on the first current to obtain a first current value corresponding to the first current; and determining a first calculation result of the first function to be calculated based on the first current value.
  • adjusting a first conductance value of a variable resistor on a word line corresponding to a first power term in a semiconductor memory device according to a coefficient value of a first coefficient corresponding to a first power term includes: determining a variable resistor on the word line corresponding to the first power term according to an exponent value of a first power term of a first Taylor expansion; The coefficient value of the first coefficient adjusts a first conductance value of a variable resistor corresponding to a first power term in the semiconductor memory device.
  • a pulse voltage is input to a word line through a variable resistor in a semiconductor memory device according to the value of a first power term to obtain a first current output by the bit line, including: determining a word line corresponding to the first power term from a plurality of word lines according to the exponential value of the first power term of a first Taylor expansion; inputting a pulse voltage corresponding to the coefficient value of the first coefficient to the word line corresponding to the first power term according to the value of the first power term; and for each bit line, summing up the currents on a plurality of word lines associated with the bit line to obtain the first current output by the bit line.
  • a second conductance value of a variable resistor on a word line corresponding to the first power term in a semiconductor memory device is adjusted according to the value of a first power term, including: determining the variable resistor on the word line corresponding to the first power term according to the exponential value of the first power term of a first Taylor expansion; and adjusting the second conductance value of the variable resistor corresponding to the first power term in the semiconductor memory device according to the value of the first power term of the first Taylor expansion.
  • the first function to be calculated includes multiple first Taylor expansions; based on the second current value, determining the second calculation result of the first function to be calculated includes: summing the multiple second current values to obtain the second calculation result.
  • a method for realizing function calculation based on storage and calculation integration also includes: determining each second power term in the Maclaurin expansion of the second function to be calculated based on the second calculation result; for each second power term, adjusting the third conductance value of the variable resistor on the word line corresponding to the second power term in the semiconductor memory device according to the value of the second power term; inputting a pulse voltage to the word line in the semiconductor memory device according to the coefficient value of the second coefficient corresponding to the second power term to obtain a third current output by the bit line; performing analog-to-digital conversion on the third current to obtain a third current value corresponding to the third current; determining the third calculation result based on the third current value and the first calculation result. fruit.
  • a method for realizing function calculation based on storage and calculation integration also includes: determining each third power term in the second Taylor expansion of the third function to be calculated based on a third calculation result; for each third power term, adjusting the fourth conductance value of the variable resistor on the word line corresponding to the third power term in the semiconductor memory device according to the coefficient value of the third coefficient corresponding to the third power term; inputting a pulse voltage to the word line in the semiconductor memory device according to the value of the third power term to obtain a fourth current output by the bit line; performing analog-to-digital conversion on the fourth current to obtain a fourth current value corresponding to the fourth current; and determining a fourth calculation result of the third function to be calculated based on the fourth current value.
  • a first input module used for inputting a pulse voltage to a word line through a variable resistor in a semiconductor memory device according to a value of a first power term, to obtain a first current output by a bit line;
  • a first conversion module used for performing analog-to-digital conversion on the first current to obtain a first current value corresponding to the first current
  • the first determining module is used to determine a first calculation result of a first to-be-calculated function based on the first current value.
  • a third aspect of the present disclosure provides a system for implementing function computing based on storage and computing integration, including:
  • a semiconductor memory device comprises a word line and a bit line, wherein a variable resistor is arranged on the word line; the semiconductor memory device is used to receive a pulse voltage on the bit line, and obtain a first current output by the bit line through the variable resistor on the word line, wherein a first conductance value of the variable resistor is obtained by adjusting a coefficient value of a first coefficient corresponding to a first power term; and a voltage value of the pulse voltage is determined according to a value of the first power term;
  • an analog-to-digital converter configured to receive a first current sent by the semiconductor memory device, perform analog-to-digital conversion on the first current, and obtain a first current value corresponding to the first current;
  • the calculator is used to receive a first current value sent by the analog-to-digital converter, and determine a first calculation result of a first function to be calculated based on the first current value.
  • the fifth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned method for implementing function calculation based on storage and computing integration.
  • the sixth aspect of the present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method of realizing function calculation based on storage and computing integration.
  • FIG4 schematically shows a flow chart of a method for realizing Softmax function calculation based on storage and computing integration according to an embodiment of the present disclosure
  • FIG5 schematically shows a flow chart of a method for implementing function computing based on storage-computing integration according to another embodiment of the present disclosure
  • FIG6 schematically shows a structural diagram of a system for implementing function computing based on storage-computing integration according to another embodiment of the present disclosure
  • FIG8 schematically shows a block diagram of an electronic device suitable for implementing function computing based on storage-computing integration according to an embodiment of the present disclosure.
  • the user information including but not limited to user personal information, user image information, user device information, such as location information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
  • the core calculation is the calculation of the natural exponent.
  • the conventional calculation method is to expand the natural exponent into a Taylor expansion, calculate the expansion terms one by one through a digital multiplier, and then accumulate the expansion terms through a digital adder to obtain the result. Since the polynomial coefficients of the Taylor expansion are fixed constants, they should be reused. However, in the von Neumann architecture, these constants cannot be effectively reused in the process of calculation according to the above calculation method, and the use of conventional digital circuits to calculate the natural exponential operation requires huge hardware area overhead.
  • An embodiment of the present disclosure provides a method for realizing function calculation based on storage and calculation integration, including: for a first power term in a first Taylor expansion in a first function to be calculated, adjusting a first conductance value of a variable resistor on a word line corresponding to the first power term in a semiconductor memory device according to a coefficient value of a first coefficient corresponding to the first power term; inputting a pulse voltage to a word line through a variable resistor in the semiconductor memory device according to the value of the first power term to obtain a first current output by a bit line; performing analog-to-digital conversion on the first current to obtain a first current value corresponding to the first current; and determining a first calculation result of the first function to be calculated based on the first current value.
  • FIG1 schematically shows an application scenario diagram of a method, apparatus, device, medium, and program product for implementing function computing based on storage-computing integration according to an embodiment of the present disclosure.
  • the user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc.
  • Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
  • the first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
  • the method for implementing function computing based on storage and computing integration provided in the embodiment of the present disclosure can generally be executed by the server 105.
  • the device for implementing function computing based on storage and computing integration provided in the embodiment of the present disclosure can generally be set in the server 105.
  • the method for implementing function computing based on storage and computing integration provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105.
  • terminal devices, networks and servers in Figure 1 is only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
  • FIG2 schematically shows a flow chart of a method for implementing function computing based on storage-computing integration according to an embodiment of the present disclosure.
  • the method 200 for implementing function computing based on storage-computing integration of this embodiment includes operations S210 to S240 .
  • a first conductance value of a variable resistor on a word line corresponding to the first power term in the semiconductor memory device is adjusted according to a coefficient value of a first coefficient corresponding to the first power term.
  • a semiconductor memory device may include N word lines and one or more bit lines, wherein each word line may include a variable resistor.
  • the number of terms of the first Taylor expansion may be determined according to the number of word lines of the semiconductor memory device.
  • the N word lines correspond one-to-one to the N terms from front to back in the first function to be calculated.
  • the first conductance value of the variable resistor is set to the coefficient value of the first coefficient corresponding to the first power term corresponding to the variable resistor.
  • the first coefficient of the first function to be calculated may be the coefficient value of each term in the first function to be calculated, wherein the first coefficient corresponds one-to-one to the first power term.
  • the semiconductor memory device can use a variable resistance memory.
  • RRAM is a non-volatile memory in which electrodes on both sides sandwich metal oxide in the middle, so low power consumption and high-speed rewriting can be achieved.
  • a pulse voltage is applied to the metal oxide film to generate a large resistance difference to store "0" and "1".
  • RRAM can achieve multi-bit storage by adjusting the resistance state, it is conducive to storing multi-bit data using less hardware.
  • the word line of the semiconductor memory device is subjected to variable resistance according to the value of the first power term.
  • a pulse voltage is input to obtain a first current output by the bit line.
  • analog-to-digital conversion is performed on the first current to obtain a first current value corresponding to the first current.
  • a first calculation result of a first to-be-calculated function is determined based on the first current value.
  • FIG3 schematically shows a structural diagram of a semiconductor memory device for implementing function computing based on storage-computation integration according to an embodiment of the present disclosure.
  • the semiconductor memory device for implementing function calculation based on storage-computation integration in this embodiment includes a word line 310 , a bit line 320 , and a variable resistor 330 .
  • a variable resistance memory is used to implement natural exponential operations. Since the polynomial coefficients of the Taylor expansion are constants, the conductance value of the variable resistor in the semiconductor memory device is set according to the coefficient value of the first coefficient corresponding to the first power term, thereby realizing the reuse of fixed constants.
  • the advantage of using in-memory calculations to perform high-parallel matrix-vector multiplication is realized, while avoiding the operation of determining the voltage value of the pulse voltage input on the word line through multiple accesses, thereby reducing the number of times the memory needs to be accessed. At the same time, it also reduces the problem of low computing efficiency caused by the need to read and calculate from the memory space multiple times when using common computer architectures for calculations.
  • the semiconductor storage is adjusted according to the coefficient value of the first coefficient corresponding to the first power term.
  • the first conductance value of the variable resistor on the word line corresponding to the first power term in the storage device includes: determining the variable resistor on the word line corresponding to the first power term according to the exponent value of the first power term of the first Taylor expansion; and adjusting the first conductance value of the variable resistor corresponding to the first power term in the semiconductor storage device according to the coefficient value of the first coefficient.
  • the first function to be calculated can be the first N terms of the Taylor expansion of the function e x , and the first power terms are x 0 , x 1 , x 2 , ..., x N-2 , x N-1 in increasing order of exponent.
  • the corresponding relationship between the variable resistor on the word line and each term in the first Taylor expansion is determined, that is, the term with the power of n corresponds to the (n+1)th word line, and then the conductance value of the variable resistor corresponding to the term is adjusted according to the coefficient value of each term.
  • a pulse voltage is input to a word line through a variable resistor in a semiconductor memory device according to the value of a first power term to obtain a first current output by the bit line, including: determining a word line corresponding to the first power term from a plurality of word lines according to the exponential value of the first power term of a first Taylor expansion; inputting a pulse voltage corresponding to the coefficient value of the first coefficient to the word line corresponding to the first power term according to the value of the first power term; and for each bit line, summing up the currents on a plurality of word lines associated with the bit line to obtain the first current output by the bit line.
  • a pulse voltage of a numerical value corresponding to each power term is input to the word line corresponding to the term to obtain the current output by the word line.
  • the currents on all word lines associated with the bit line are summed on the bit line to obtain the first current of the bit line.
  • a method for realizing function calculation based on storage and calculation integration also includes: for a first power term in a first Taylor expansion in a first function to be calculated, adjusting a second conductance value of a variable resistor on a word line corresponding to the first power term in a semiconductor memory device according to the value of the first power term; inputting a pulse voltage to a word line through a variable resistor in a semiconductor memory device according to the coefficient value of a first coefficient corresponding to the first power term to obtain a second current output by a bit line; performing analog-to-digital conversion on the first current to obtain a second current value corresponding to the first current; and determining a second calculation result of the first function to be calculated based on the second current value.
  • a second conductance value of a variable resistor on a word line corresponding to the first power term in a semiconductor memory device is adjusted according to the value of a first power term, including: determining the variable resistor on the word line corresponding to the first power term according to the exponential value of the first power term of a first Taylor expansion; and adjusting the second conductance value of the variable resistor corresponding to the first power term in the semiconductor memory device according to the value of the first power term of the first Taylor expansion.
  • the first function to be calculated can be the first N terms of the Taylor expansion of the function e x , and the first power term is x 0 , x 1 , x 2 , ..., x N-2 , x N-1 in increasing order of exponent.
  • the first function to be calculated includes multiple first Taylor expansions; based on the second current value, determining the second calculation result of the first function to be calculated includes: summing the multiple second current values to obtain the second calculation result.
  • the pulse voltage of the word line is determined according to the coefficient value of the first coefficient, and therefore the current generated on the word line is the result of this term.
  • the first function to be calculated takes the first N terms of the Taylor expansion of e x
  • the second current value of the corresponding bit line obtained by analog-to-digital conversion is In the case where there are three bit lines in the semiconductor memory device, and x is x 0 , x 1 , and x 2 respectively, the second current values of the three bit lines are summed to obtain Therefore, semiconductor memory devices can be used to calculate The value of , where d is the number of bit lines of the semiconductor memory device.
  • the operation of the Softmax function is as follows:
  • FIG4 schematically shows a flow chart of a method for implementing function computing based on storage-computing integration according to an embodiment of the present disclosure.
  • the method 400 for implementing function computing based on storage-computing integration of this embodiment includes operations S410 to S450 .
  • each second power term in a Maclaurin expansion of a second function to be calculated is determined based on the second calculation result.
  • a semiconductor memory device may include M word lines and one bit line, wherein each word line may include a variable resistor.
  • the number of terms of the second function to be calculated may be determined according to the number of word lines of the semiconductor memory device. Then the M word lines correspond one to one with the M terms from front to back in the second function to be calculated.
  • the third conductance value of the variable resistor is set to the value of the second power term of the term of the second function to be calculated corresponding to the variable resistor.
  • a third calculation result is obtained by subtracting the first calculation result from the third current value, wherein the subtraction can be implemented using a current differential amplifier.
  • a method for realizing Softmax function calculation based on storage and calculation integration can also be provided, which can further include, on the basis of operations S410 to S450 as shown in FIG4 , the following parts: determining each third power term in the second Taylor expansion of the third function to be calculated based on the third calculation result; for each third power term, adjusting the fourth conductance value of the variable resistor on the word line corresponding to the third power term in the semiconductor memory device according to the coefficient value of the third coefficient corresponding to the third power term; inputting a pulse voltage to the word line in the semiconductor memory device according to the value of the third power term to obtain a fourth current output by the bit line; performing analog-to-digital conversion on the fourth current to obtain a fourth current value corresponding to the fourth current; and determining the fourth calculation result of the third function to be calculated based on the fourth current value.
  • FIG5 schematically shows a flow chart of a method for realizing Softmax function calculation based on storage and computing integration according to an embodiment of the present disclosure.
  • the third coefficient of the third function to be calculated may be the coefficient value of each term in the third function to be calculated, wherein the third coefficient corresponds to the third power term one-to-one.
  • the semiconductor memory device may include P word lines and a bit line, wherein each word line may include a variable resistor.
  • the number of terms of the third function to be calculated may be determined according to the number of word lines of the semiconductor memory device. Then the P word lines correspond to the P terms in the third function to be calculated one-to-one.
  • the conductance value of the variable resistor is set to the coefficient value of the third coefficient.
  • the pulse voltage on each word line is determined according to the value of the third power term of the term of the third function to be calculated corresponding to the variable resistor, and after the pulse voltage is input to each word line, a current is generated through the variable resistor on each word line.
  • the currents on multiple word lines associated with the bit line are summed up to obtain a fourth current of the bit line.
  • a fourth calculation result of the third to-be-calculated function is determined based on the fourth current value.
  • the fourth calculation result of the third to-be-calculated function may be numerically equal to the magnitude of the fourth current value.
  • a semiconductor memory device is used to calculate a value with a natural constant as the base and a third calculation result as the exponent.
  • the result of the Softmax function is obtained through the inverse function relationship between the logarithmic function and the power function.
  • the coefficient of the Taylor expansion of the natural exponential is set to the fourth conductance value of the variable resistor, the calculation result can be obtained by only changing the voltage value of the pulse voltage on the word line, thereby realizing the reuse of the constant.
  • the fourth calculation result of the third function to be calculated can be calculated using the system for realizing function calculation based on storage and calculation integration shown in FIG3.
  • the third function to be calculated can take the first P terms of the e b Taylor expansion, where b can be equal to the second calculation result in value. Then the third parameter is b 0 , b 1 , ..., b P-2 , b P-1 in order of exponent from small to large. First, determine the correspondence between the variable resistor on the word line and each term in the Taylor expansion, and then adjust the conductance value of the variable resistor corresponding to the term according to the coefficient value of each term.
  • the pulse voltage input to the word line corresponding to the item is b 3
  • the conductance value of the variable resistor on the word line is set to 1/6
  • the current generated on the word line is 1/6(b 3 ), which is the same as the calculation result of the item.
  • the third current value obtained on the bit line is thus we get the result of softmax( xi ).
  • FIG6 schematically shows a structural diagram of a system for implementing function computing based on storage-computing integration according to another embodiment of the present disclosure.
  • the system for implementing function calculation based on storage-computation integration of this embodiment includes a semiconductor memory device 610 , an analog-to-digital converter 620 , and a calculator 630 .
  • a semiconductor memory device comprises a word line 611 and a bit line 612, wherein a variable resistor 613 is arranged on the word line; the semiconductor memory device is used to receive a pulse voltage on the bit line, and obtain a first current output by the bit line through the variable resistor on the word line, wherein a first conductance value of the variable resistor is obtained by adjusting the value of a first power term; and a voltage value of the pulse voltage is determined according to a coefficient value of a first coefficient corresponding to the first power term;
  • an analog-to-digital converter configured to receive a first current sent by the semiconductor memory device, perform analog-to-digital conversion on the first current, and obtain a first current value corresponding to the first current;
  • the calculator is used to receive a first current value sent by the analog-to-digital converter, and determine a first calculation result of a first function to be calculated based on the first current value.
  • a pulse voltage is input on a word line, and after a current is generated through a resistor on the word line, it converges on a bit line.
  • An analog-to-digital converter may convert a current signal into a digital signal.
  • the calculator may be an accumulation tree.
  • the currents on the four bit lines are respectively converted into analog-to-digital, and the sum is obtained by the calculator to obtain the second calculation result, that is, According to the setting method of the pulse voltage of the word line and the conductance value of the variable resistor in FIG3 , the current on the bit line is converted into analog to digital to obtain the first calculation result, that is, the value of x 2 .
  • the pulse voltage can be set to 1, n, n 2 , and n 3 respectively, and the conductance values of the variable resistors set on the four word lines can be set to 1, 1, and n 3 respectively.
  • the current obtained on the bit line is converted into digital form, and the fourth calculation result representing the magnitude of the current value is the value of en , thereby realizing the calculation of Softmax(x 2 ).
  • the present disclosure also provides a device for realizing function computing based on storage and computing integration.
  • the device will be described in detail below in conjunction with FIG.
  • FIG7 schematically shows a structural block diagram of a device for implementing function computing based on storage and computing integration according to an embodiment of the present disclosure.
  • the device 700 for implementing function computing based on storage and computing integration of this embodiment includes a first adjustment module 710 , a first input module 720 , a first conversion module 730 and a first determination module 740 .
  • the first adjustment module 710 is used to adjust the first conductance value of the variable resistor on the word line corresponding to the first power term in the semiconductor memory device according to the coefficient value of the first coefficient corresponding to the first power term for the first power term in the first Taylor expansion in the first to-be-calculated function.
  • the first adjustment module 710 can be used to perform the operation S210 described above, which will not be repeated here.
  • the first input module 720 is used to input a pulse voltage to the word line through the variable resistor in the semiconductor memory device according to the value of the first power term to obtain the first current output by the bit line.
  • the first input module 720 can be used to perform the operation S220 described above, which will not be repeated here.
  • the first conversion module 730 is used to perform analog-to-digital conversion on the first current to obtain a first current value corresponding to the first current.
  • the first conversion module 730 can be used to perform the operation S230 described above, which will not be described in detail here.
  • the first determination module 740 is used to determine a first calculation result of the first to-be-calculated function based on the first current value. In one embodiment, the first determination module 740 can be used to perform the operation S240 described above, which will not be described in detail herein.
  • the first adjustment module 710 includes a first determining unit and a first adjusting unit.
  • the first determining unit is used to determine the variable resistance on the word line corresponding to the first power term according to the exponent value of the first power term of the first Taylor expansion.
  • the first adjusting unit is used to adjust a first conductance value of a variable resistor corresponding to a first power term in the semiconductor memory device according to a coefficient value of a first coefficient.
  • the first input module 720 includes a second determining unit, an input unit, and a summarizing unit.
  • the second determining unit is used to determine a word line corresponding to the first power term from a plurality of word lines according to the exponential value of the first power term of the first Taylor expansion.
  • the input unit is used to input a pulse voltage corresponding to the coefficient value of the first coefficient to the word line corresponding to the first power term according to the value of the first power term.
  • the summing unit is used for summing up the currents on a plurality of word lines associated with each bit line to obtain a first current output by the bit line.
  • the device 700 for implementing function computing based on storage and computing integration also includes a second adjustment module, a second input module, a second conversion module and a second determination module.
  • the second adjustment module is used to adjust the second conductance value of the variable resistor on the word line corresponding to the first power term in the semiconductor memory device according to the value of the first power term in the first Taylor expansion of the first function to be calculated.
  • the second input module is used to input a pulse voltage to a word line through a variable resistor in the semiconductor memory device according to the coefficient value of the first coefficient corresponding to the first power term to obtain a second current output by the bit line.
  • the second determining module is used to determine a second calculation result of the first to-be-calculated function based on the second current value.
  • the third determining unit is used to determine the variable resistance on the word line corresponding to the first power term according to the exponent value of the first power term of the first Taylor expansion.
  • the second adjusting unit adjusts a second conductance value of a variable resistor corresponding to the first power term in the semiconductor memory device according to the value of the first power term of the first Taylor expansion.
  • the device 700 for implementing function computing based on storage and computing integration also includes a third determination module, a third adjustment module, a third input module, a third conversion module and a fourth determination module.
  • the third determination module is used to determine each second power term in the Maclaurin expansion of the second function to be calculated based on the second calculation result.
  • the third adjustment module is used to adjust the third conductance value of the variable resistor on the word line corresponding to the second power term in the semiconductor memory device according to the value of the second power term for each second power term.
  • the third input module is used to input a pulse voltage to the word line in the semiconductor memory device according to the coefficient value of the second coefficient corresponding to the second power term to obtain a third current output by the bit line.
  • the third conversion module is used to perform analog-to-digital conversion on the third current to obtain a third current value corresponding to the third current.
  • the fourth determination module is used to determine a third calculation result based on the third current value and the first calculation result.
  • the device 700 for implementing function computing based on storage and computing integration further includes a fifth determining module, A fourth regulating module, a fourth input module, a fourth converting module and a sixth determining module.
  • the fifth determination module is used to determine each third power term in the second Taylor expansion of the third function to be calculated based on the third calculation result.
  • the fourth adjustment module is used to adjust, for each third power term, a fourth conductance value of a variable resistor on a word line corresponding to the third power term in the semiconductor memory device according to a coefficient value of a third coefficient corresponding to the third power term.
  • the fourth input module is used to input a pulse voltage to the word line in the semiconductor memory device according to the value of the third power term to obtain a fourth current output by the bit line.
  • the fourth conversion module is used to perform analog-to-digital conversion on the fourth current to obtain a fourth current value corresponding to the fourth current.
  • the sixth determining module is used to determine a fourth calculation result of the third function to be calculated based on the fourth current value.
  • any multiple modules of the first adjustment module 710, the first input module 720, the first conversion module 730 and the first determination module 740 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module.
  • At least one of the first adjustment module 710, the first input module 720, the first conversion module 730 and the first determination module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them.
  • FPGA field programmable gate array
  • PLA programmable logic array
  • ASIC application specific integrated circuit
  • At least one of the first adjustment module 710 , the first input module 720 , the first conversion module 730 and the first determination module 740 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
  • FIG8 schematically shows a block diagram of an electronic device suitable for implementing a method of function calculation based on storage-computation integration according to an embodiment of the present disclosure.
  • the electronic device 800 includes a processor 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803.
  • the processor 801 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and/or a related chipset and/or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc.
  • the processor 801 may also include an onboard memory for caching purposes.
  • the processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
  • RAM 803 various programs and data required for the operation of the electronic device 800 are stored.
  • the processor 801, ROM 802 and RAM 803 are connected to each other through a bus 804.
  • the processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and/or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803.
  • the processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
  • the electronic device 800 may further include an input/output (I/O) interface 805.
  • An output (I/O) interface 805 is also connected to the bus 804.
  • the electronic device 800 may further include one or more of the following components connected to the I/O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc.
  • the communication section 809 performs communication processing via a network such as the Internet.
  • a drive 810 is also connected to the I/O interface 805 as needed.
  • a removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
  • the present disclosure also provides a computer-readable storage medium, which may be included in the device/apparatus/system described in the above embodiments; or may exist independently without being assembled into the device/apparatus/system.
  • the above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
  • a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable storage medium may include the ROM 802 and/or RAM 803 described above and/or one or more memories other than ROM 802 and RAM 803.
  • the embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart.
  • the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
  • the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc.
  • the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and/or installed from a removable medium 811.
  • the program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
  • the computer program can be downloaded and installed from the network through the communication part 809, and/or installed from the removable medium 811.
  • the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed.
  • the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
  • the program code for executing the computer program provided by the embodiments of the present disclosure may be written in any combination of one or more programming languages.
  • these computer programs may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages.
  • Programming languages include, but are not limited to, Java, C++, Python, "C" language, or similar programming languages.
  • the program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device.
  • the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
  • LAN local area network
  • WAN wide area network
  • an Internet service provider to connect through the Internet
  • each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function.
  • the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
  • each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Computer Hardware Design (AREA)
  • Semiconductor Memories (AREA)

Abstract

本公开提供了一种基于存算一体实现函数计算的方法、装置、系统、设备、存储介质,可以应用于人工智能技术领域。该方法包括:针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值;根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流;对第一电流进行模数转换,得到与第一电流相对应的第一电流值;基于第一电流值,确定第一待计算函数的第一计算结果。

Description

基于存算一体实现函数计算的方法、装置、系统 技术领域
本公开涉及人工智能技术领域,尤其涉及基于存算一体实现函数计算的方法、装置、系统。
背景技术
随着深度神经网络的快速发展,参数量和计算量呈指数级增加,为了保证能够满足先进的神经网络算法对于算力的需求,从而顺利完成人工智能计算任务,需要高额的能源以及硬件开销。
在相关技术中,广泛用于加速人工智能算法的图形处理器(Graphics Processing Unit,GPU)是一种基于冯·诺依曼架构的计算系统,这种架构的特点是存储与计算分离,计算单元在进行运算任务时,需要先访问内存,完成计算后再将计算结果写回内存。由于深度神经网络包含大量的参数,因此计算单元需要做大量的内存访问操作,从而产生大量访存带来的时间和功耗的开销。
在神经网络中,Softmax函数是逻辑回归的推广,因此可以用于多分类任务,是最常用的分类函数之一,但在目前,Softmax函数还不能在冯·诺依曼架构中进行高能效处理。
发明内容
鉴于上述问题,本公开提供了一种基于存算一体实现函数计算的方法。
根据本公开的第一个方面,提供了一种基于存算一体实现函数计算的方法,包括:针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值;根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流;对第一电流进行模数转换,得到与第一电流相对应的第一电流值;基于第一电流值,确定第一待计算函数的第一计算结果。
根据本公开的实施例,根据与第一幂次项对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值,包括:根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻;根据 第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第一电导值。
根据本公开的实施例,根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流,包括:根据第一泰勒展开式的第一幂次项的指数值,从多个字线中确定与第一幂次项相对应的字线;根据第一幂次项的数值,对与第一幂次项相对应的字线输入与第一系数的系数值相对应的脉冲电压;对于每个位线,将与位线相关联的多个字线上的电流汇总,得到位线输出的第一电流。
根据本公开的实施例,基于存算一体实现函数计算的方法,还包括:针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第二电导值;根据与第一幂次项相对应的第一系数的系数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第二电流;对第一电流进行模数转换,得到与第一电流相对应的第二电流值;基于第二电流值,确定第一待计算函数的第二计算结果。
根据本公开的实施例,根据第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第二电导值,包括:根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻;根据第一泰勒展开式的第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第二电导值。
根据本公开的实施例,第一待计算函数包括多个第一泰勒展开式;基于第二电流值,确定第一待计算函数的第二计算结果,包括:对多个第二电流值求和,得到第二计算结果。
根据本公开的实施例,基于存算一体实现函数计算的方法,还包括:基于第二计算结果,确定第二待计算函数的麦克劳林展开式中的每个第二幂次项;针对每个第二幂次项,根据第二幂次项的数值,调节半导体存储器件中的与第二幂次项相对应的字线上的可变电阻的第三电导值;根据与第二幂次项相对应的第二系数的系数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第三电流;对第三电流进行模数转换,得到与第三电流相对应的第三电流值;基于第三电流值和第一计算结果,确定第三计算结 果。
根据本公开的实施例,基于存算一体实现函数计算的方法,还包括:基于第三计算结果,确定第三待计算函数的第二泰勒展开式中的每个第三幂次项;针对每个第三幂次项,根据与第三幂次项相对应的第三系数的系数值,调节半导体存储器件中的与第三幂次项相对应的字线上的可变电阻的第四电导值;根据第三幂次项的数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第四电流;对第四电流进行模数转换,得到与第四电流相对应的第四电流值;基于第四电流值,确定第三待计算函数的第四计算结果。
本公开的第二方面提供了一种基于存算一体实现函数计算的装置,包括:
第一调节模块,用于根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值;
第一输入模块,用于根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流;
第一转换模块,用于对第一电流进行模数转换,得到与第一电流相对应的第一电流值;
第一确定模块,用于基于第一电流值,确定第一待计算函数的第一计算结果。
本公开的第三方面提供了一种基于存算一体实现函数计算的系统,包括:
半导体存储器件,包括字线和位线,字线上设置有可变电阻;半导体存储器件用于位线上接收脉冲电压,经字线上的可变电阻,得到位线输出的第一电流,其中,可变电阻的第一电导值是根据与第一幂次项对应的第一系数的系数值调节得到的;脉冲电压的电压值是根据第一幂次项的数值确定的;
模数转换器,用于接收由半导体存储器件发送的第一电流,对第一电流进行模数转换,得到与第一电流相对应的第一电流值;
计算器,用于接收由模数转换器发送的第一电流值,基于第一电流值,确定第一待计算函数的第一计算结果。
本公开的第四方面提供了一种电子设备,包括:一个或多个处理器;存储器,用于存储一个或多个程序,其中,当所述一个或多个程序被所述一个或多个处理器执行时, 使得一个或多个处理器执行上述基于存算一体实现函数计算的方法。
本公开的第五方面还提供了一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器执行上述基于存算一体实现函数计算的方法。
本公开的第六方面还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述基于存算一体实现函数计算的方法。
根据本公开的实施例,使用可变电阻式存储器(Resistive Random Access Memory,RRAM)实现自然指数运算,由于泰勒展开式的多项式系数为常量,根据与所述第一幂次项相对应的第一系数的系数值,设置所述半导体存储器件中可变电阻的电导值,实现了对于固定常量的复用,并且,由于可变电阻式存储器的多比特存储特性,实现利用存内计算可以执行高并行度的矩阵向量乘法的优点的同时,避免了通过多次访问来确定字线上输入的脉冲电压的电压值的操作,进而减少了需要访问内存的次数。同时还减少了利用常用计算机架构进行计算时,由于需要多次从内存空间中读数再计算而导致的计算效率低的问题。
附图说明
通过以下参照附图对本公开实施例的描述,本公开的上述内容以及其他目的、特征和优点将更为清楚,在附图中:
图1示意性示出了根据本公开实施例的基于存算一体实现函数计算的方法、装置、设备、介质和程序产品的应用场景图;
图2示意性示出了根据本公开实施例的基于存算一体实现函数计算的方法的流程图;
图3示意性示出了根据本公开实施例的基于存算一体实现函数计算的系统的结构图;
图4示意性示出了根据本公开实施例的基于存算一体实现Softmax函数计算的方法流程图;
图5示意性示出了根据本公开另一实施例的基于存算一体实现函数计算的方法流程图;
图6示意性示出了根据本公开另一实施例的基于存算一体实现函数计算的系统的结构图;
图7示意性示出了根据本公开实施例的基于存算一体实现函数计算的装置的结构框图;以及
图8示意性示出了根据本公开实施例的适于基于存算一体实现函数计算的电子设备的方框图。
具体实施方式
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。在下面的详细描述中,为便于解释,阐述了许多具体的细节以提供对本公开实施例的全面理解。然而,明显地,一个或多个实施例在没有这些具体细节的情况下也可以被实施。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。
在本公开的技术方案中,所涉及的用户信息(包括但不限于用户个人信息、用户图像信息、用户设备信息,例如位置信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、存储、使用、加工、传输、提供、公开和应用等处理,均遵守相关国家和地区的相关法律法规和标准,采取了必要保密措施,不违背公序良俗,并提供有相应的操作入口,供用户选择授权或者拒绝。
在本公开实施例的技术方案中,在获取或采集用户个人信息之前,均获取了用户的授权或同意。
在实施本公开的过程中发现,Softmax函数的计算需要实现自然指数、自然指数求和、除法三个算子。其中核心的计算是自然指数的计算,常规的计算方法为将自然指数展开成泰勒展开式,通过数字乘法器逐个计算展开项,再通过数字加法器将展开项累加得出结果。由于泰勒展开式的多项式系数为固定的常量,应该被复用。但在冯·诺依曼架构中,按照上述计算方法计算的过程中不能对这些常量进行有效复用,并且使用常规的数字电路需要计算自然指数运算需要巨大的硬件面积开销。
本公开的实施例提供了一种基于存算一体实现函数计算的方法,包括:针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值;根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流;对第一电流进行模数转换,得到与第一电流相对应的第一电流值;基于第一电流值,确定第一待计算函数的第一计算结果。
图1示意性示出了根据本公开实施例的基于存算一体实现函数计算的方法、装置、设备、介质和程序产品的应用场景图。
如图1所示,根据该实施例的应用场景100可以包括第一终端设备101、第二终端设备102、第三终端设备103、网络104以及服务器105。网络104用以在第一终端设备101、第二终端设备102、第三终端设备103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用第一终端设备101、第二终端设备102、第三终端设备103中的至少一个通过网络104与服务器105交互,以接收或发送消息等。第一终端设备101、第二终端设备102、第三终端设备103上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。
第一终端设备101、第二终端设备102、第三终端设备103可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。
服务器105可以是提供各种服务的服务器,例如对用户利用第一终端设备101、第二终端设备102、第三终端设备103所浏览的网站提供支持的后台管理服务器(仅为示例)。后台管理服务器可以对接收到的用户请求等数据进行分析等处理,并将处理结果(例如根据用户请求获取或生成的网页、信息、或数据等)反馈给终端设备。
需要说明的是,本公开实施例所提供的基于存算一体实现函数计算的方法一般可以由服务器105执行。相应地,本公开实施例所提供的基于存算一体实现函数计算的装置一般可以设置于服务器105中。本公开实施例所提供的基于存算一体实现函数计算的方法也可以由不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和/或服务器105通信的服务器或服务器集群执行。相应地,本公开实施例所提供的基于存算一体实现函数计算的装置也可以设置于不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和/或服务器105通信的服务器或服务器集群中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
以下将基于图1描述的场景,通过图2~图4对公开实施例的基于存算一体实现函数计算的方法进行详细描述。
图2示意性示出了根据本公开实施例的基于存算一体实现函数计算的方法的流程图。
如图2所示,该实施例的基于存算一体实现函数计算的方法200包括操作S210~操作S240。
在操作S210,针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值。
根据本公开的实施例,半导体存储器件可以包括N个字线和一个或多个位线,其中每个字线上可以包括一个可变电阻。第一泰勒展开式的项数可以根据半导体存储器件的字线数确定。N个字线与第一待计算函数中从前到后的N项一一对应。将可变电阻的第一电导值设置为与该可变电阻对应的第一幂次项相对应的第一系数的系数值。其中,第一待计算函数的第一系数可以是第一待计算函数中每一项的系数值,其中第一系数与第一幂次项一一对应。
根据本公开的实施例,半导体存储器件可以使用可变电阻式存储器。RRAM是一种非易失性存储器,两侧电极将金属氧化物包夹于中间,因此可以实现低功耗和高速重写,通过向金属氧化物薄膜施加脉冲电压,产生大的电阻差值来存储“0”和“1”。同时,由于RRAM通过调整电阻状态可以实现多比特存储,有利于实现使用较少的硬件存储多位数据。
在操作S220,根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线 输入脉冲电压,得到位线输出的第一电流。
根据本公开的实施例,脉冲电压是根据第一幂次项的数值确定的,对各个字线输入脉冲电压后,经过各个字线上的可变电阻产生电流,电流在位线上汇聚得到第一电流。
在操作S230,对第一电流进行模数转换,得到与第一电流相对应的第一电流值。
根据本公开的实施例,对第一电流进行模数转换,将电流信号转换成数字信号,得到第一电流值。
在操作S240,基于第一电流值,确定第一待计算函数的第一计算结果。
根据本公开的实施例,基于基尔霍夫定律和欧姆定律,位线上汇聚的第一电流可以代表该位线上计算的多项式的值,因此根据第一电流的电流值,即可得到第一待计算函数中目标幂次项对应的值。输入脉冲电压后,可以直接在位线上产生第一电流,无需手动进行求和操作,避免了冯·诺依曼架构中多次访问内存带来的时间和功耗的开销,能够在存储器中原位完成计算,实现存内计算。
图3示意性示出了根据本公开实施例的基于存算一体实现函数计算的半导体存储器件的结构图。
如图3所示,该实施例的基于存算一体实现函数计算的半导体存储器件包括字线310、位线320和可变电阻330。
根据本公开的实施例,图3所示的半导体存储器件可以用来计算 将4个字线与的泰勒展开式中的4个第一幂次项一一对应,根据第一幂次项数值,分别将四个字线上的可变电阻的第一电导值设置为1、1、并根据第一幂次项对应的第一系数的系数值,分别对半导体存储器件中的经可变电阻的字线输入大小为x0 0、x0 1、x0 2、x0 3的脉冲电压。由于电流值=电压值*电导值,四个字线上的电流值分别为1、x0在位线上得到大小为的电流值,根据电流值的大小可以确定的值。
根据本公开的实施例,使用可变电阻式存储器实现自然指数运算,由于泰勒展开式的多项式系数为常量,根据与所述第一幂次项相对应的第一系数的系数值,设置所述半导体存储器件中可变电阻的电导值,实现了对于固定常量的复用,并且,由于可变电阻式存储器的多比特存储特性,实现利用存内计算可以执行高并行度的矩阵向量乘法的优点的同时,避免了通过多次访问来确定字线上输入的脉冲电压的电压值的操作,进而减少了需要访问内存的次数。同时还减少了利用常用计算机架构进行计算时,由于需要多次从内存空间中读数再计算而导致的计算效率低的问题。
根据本公开的实施例,根据与第一幂次项对应的第一系数的系数值,调节半导体存 储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值,包括:根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻;根据第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第一电导值。
根据本公开的实施例,第一待计算函数可以取函数ex泰勒展开式前N项,第一幂次项按照指数从小到大为x0、x1、x2、…、xN-2、xN-1。首先确定字线上的可变电阻与第一泰勒展开式中的各个项对应关系,即次数为n的项与第(n+1)个字线对应,再根据各个项的系数值调节与该项对应的可变电阻的电导值。
根据本公开的实施例,根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流,包括:根据第一泰勒展开式的第一幂次项的指数值,从多个字线中确定与第一幂次项相对应的字线;根据第一幂次项的数值,对与第一幂次项相对应的字线输入与第一系数的系数值相对应的脉冲电压;对于每个位线,将与位线相关联的多个字线上的电流汇总,得到位线输出的第一电流。
根据本公开的实施例,由于字线上的各个可变电阻与各个第一幂次项的对应关系已经确定,将其中各个幂次项对应的数值大小的脉冲电压输入到与该项对应的字线,得到该字线输出的电流。与位线相关联的所有字线上的电流会在该位线上汇总,得到位线的第一电流。
根据本公开的实施例,基于存算一体实现函数计算的方法,还包括:针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第二电导值;根据与第一幂次项相对应的第一系数的系数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第二电流;对第一电流进行模数转换,得到与第一电流相对应的第二电流值;基于第二电流值,确定第一待计算函数的第二计算结果。
根据本公开的实施例,根据第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第二电导值,包括:根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻;根据第一泰勒展开式的第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第二电导值。
根据本公开的实施例,第一待计算函数可以取函数ex泰勒展开式前N项,第一幂次项按照指数从小到大为x0、x1、x2、…、xN-2、xN-1。首先确定字线上的可变电阻与第一 泰勒展开式中的各个项对应关系,即次数为n的项与第(n+1)个字线对应,再根据各个项的指数值与自变量取值调节与该项对应的可变电阻的电导值。
根据本公开的实施例,第一待计算函数包括多个第一泰勒展开式;基于第二电流值,确定第一待计算函数的第二计算结果,包括:对多个第二电流值求和,得到第二计算结果。
根据本公开的实施例,在半导体存储器件设置多个位线的情况下,在得到各个位线的多个第二电流,并进行模数转换得到第二电流值后,将多个第二电流值求和,可以得到表征半导体存储器件上计算的第一待计算函数中多个泰勒展开式的函数值加和的第二计算结果。
根据本公开的实施例,由于将字线上的可变电阻的电导值设置为与该可变电阻对应的第一待计算函数的项的幂次项,该字线的脉冲电压是根据第一系数的系数值确定的,因此该字线上产生的电流大小就是该项的结果。
例如,在第一待计算函数取ex泰勒展开式前N项的情况下,当x=x0时,对应位线的第二电流经过模数转换得到的第二电流值大小为的结果。在半导体存储器件中有三个位线,且x分别取x0、x1、x2的情况下,将三个位线的第二电流值求和,可以得到的计算结果。因此,可以使用半导体存储器件计算的值,其中d为半导体存储器件的位线数量。
根据本公开的实施例,Softmax函数的运算为式(1):
通过第一电流值得到函数的第二计算结果后,通过式(2)实现除法运算:
其中,因此除法运算可以转换为计算
图4示意性示出了根据本公开实施例的基于存算一体实现函数计算的方法的流程图。
如图4所示,该实施例的基于存算一体实现函数计算的方法400包括操作S410~操作S450。
在操作S410,基于第二计算结果,确定第二待计算函数的麦克劳林展开式中的每个第二幂次项。
根据本公开的实施例,第二待计算函数的第二幂次项的底数可以在数值上等于第二计算结果。
在操作S420,针对每个第二幂次项,根据第二幂次项的数值,调节半导体存储器 件中的与第二幂次项相对应的字线上的可变电阻的第三电导值。
根据本公开的实施例,半导体存储器件可以包括M个字线和一个位线,其中每个字线上可以包括一个可变电阻。第二待计算函数的项数可以根据半导体存储器件的字线数确定。则M个字线与第二待计算函数中从前到后的M项一一对应。将可变电阻的第三电导值设置为与该可变电阻对应的第二待计算函数的项的第二幂次项的数值。
在操作S430,根据与第二幂次项相对应的第二系数的系数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第三电流。
根据本公开的实施例,第二待计算函数的第二系数可以是第二待计算函数中每一项的系数值,其中第二系数与第二幂次项一一对应。各个字线上的脉冲电压是根据第二系数的系数值确定的,对各个字线输入脉冲电压后,经过各个字线上的可变电阻产生电流。将与位线相关联的多个字线上的电流汇总,得到位线的第三电流。
在操作S440,对第三电流进行模数转换,得到与第三电流相对应的第三电流值。
根据本公开的实施例,对第三电流进行模数转换,将电流信号转换成数字信号,得到第三电流值。
在操作S450,基于第三电流值和第一计算结果,确定第三计算结果。
根据本公开的实施例,使用第一计算结果与第三电流值作差,得到第三计算结果,其中,作差可以使用电流差分放大器实现。
根据本公开的实施例,使用半导体存储器件,计算底数为第二计算结果的自然对数的值,通过使用对数函数的性质,将除法转换成减法进行计算,避免了常用计算机架构中进行除法运算时需要进行的移位、累加等操作,提高了运算效率。
根据本公开的实施例,第二待计算函数可以取ln(1+a)的麦克劳林展开式的前M项,其中(1+a)在数值上可以等于第一计算结果。则第二幂次项按照指数从小到大为(1+a)1、(1+a)2、…、(1+a)M-1、(1+a)M。首先根据各个第二幂次项的指数,确定字线上的可变电阻与麦克劳林展开式中的各个第二幂次项的对应关系,即第m个第二幂次项对应第m个字线上的可变电阻,再根据各个项的幂次项的数值调节与该项对应的可变电阻的第三电导值。
例如,第二待计算函数中的一项为1/3(1+a)3,第二计算结果为p,则与该项对应的字线上的可变电阻的电导值被设置为p3,该字线输入的脉冲电压是1/3,该字线上产生的电流大小为1/3(p3),与该项的计算结果相同。位线上得到的第三电流值的大小即为使用x=xi对应的位线上的第一计算结果与第三电流值作差即可得到第三计算结果。
根据本公开的示例性实施例,还可以提供一种基于存算一体实现Softmax函数计算的方法,在包括如图4所示的操作S410~操作S450的基础上,还可以包括:基于第三计算结果,确定第三待计算函数的第二泰勒展开式中的每个第三幂次项;针对每个第三幂次项,根据与第三幂次项相对应的第三系数的系数值,调节半导体存储器件中的与第三幂次项相对应的字线上的可变电阻的第四电导值;根据第三幂次项的数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第四电流;对第四电流进行模数转换,得到与第四电流相对应的第四电流值;基于第四电流值,确定第三待计算函数的第四计算结果。
根据本公开的实施例,通过第一计算结果和第三电流值得到第三计算结果后,通过式(3)即可完成Softmax函数的计算:
图5示意性示出了根据本公开实施例的基于存算一体实现Softmax函数计算的方法的流程图。
如图5所示,该实施例的基于存算一体实现Softmax函数计算的方法500包括操作S510~操作S550。
在操作S510,基于第三计算结果,确定第三待计算函数的第二泰勒展开式中的每个第三幂次项。
根据本公开的实施例,第三待计算函数的第三幂次项的底数可以在数值上等于第三计算结果。
在操作S520,针对每个第三幂次项,根据与第三幂次项相对应的第三系数的系数值,调节半导体存储器件中的与第三幂次项相对应的字线上的可变电阻的第四电导值。
根据本公开的实施例,第三待计算函数的第三系数可以是第三待计算函数中每一项的系数值,其中第三系数与第三幂次项一一对应。半导体存储器件可以包括P个字线和一个位线,其中每个字线上可以包括一个可变电阻。第三待计算函数的项数可以根据半导体存储器件的字线数确定。则P个字线与第三待计算函数中的P项一一对应。将可变电阻的电导值设置为第三系数的系数值。
在操作S530,根据第三幂次项的数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第四电流。
根据本公开的实施例,各个字线上的脉冲电压是根据与该可变电阻对应的第三待计算函数的项的第三幂次项的数值确定的,对各个字线输入脉冲电压后,经过各个字线上的可变电阻产生电流。将与位线相关联的多个字线上的电流汇总,得到位线的第四电流。
在操作S540,对第四电流进行模数转换,得到与第四电流相对应的第四电流值。
根据本公开的实施例,对第四电流进行模数转换,将电流信号转换成数字信号,得到第四电流值。
在操作S550,基于第四电流值,确定第三待计算函数的第四计算结果。
根据本公开的实施例,第三待计算函数的第四计算结果在数值上可以等于第四电流值的大小。
根据本公开的实施例,使用半导体存储器件,计算由自然常数作为底数,第三计算结果作为指数的值。通过对数函数与幂函数的反函数关系,得到Softmax函数的结果。此外,由于将自然指数的泰勒展开式的系数设置为可变电阻的第四电导值,仅需要改变字线上脉冲电压的电压值即可得到计算结果,实现了对于常量的复用。
根据本公开的实施例,可以使用图3所示的基于存算一体实现函数计算的系统计算第三待计算函数的第四计算结果。根据本公开的实施例,第三待计算函数可以取eb泰勒展开式的前P项,其中b在数值上可以等于第二计算结果。则第三参数按照指数从小到大为b0、b1、…、bP-2、bP-1。首先确定字线上的可变电阻与泰勒展开式中的各个项对应关系,再根据各个项的系数值调节与该项对应的可变电阻的电导值。
例如,第三待计算函数中的一项为1/6(b3),则与该项对应的字线输入的脉冲电压是b3,该字线上的可变电阻的电导值被设置为1/6,该字线上产生的电流大小为1/6(b3),与该项的计算结果相同。位线上得到的第三电流值大小即为从而得出了softmax(xi)的结果。
图6示意性示出了根据本公开另一实施例的基于存算一体实现函数计算的系统的结构图。
如图6所示,该实施例的基于存算一体实现函数计算的系统包括半导体存储器件610、模数转换器620和计算器630。
半导体存储器件,包括字线611和位线612,字线上设置有可变电阻613;半导体存储器件用于位线上接收脉冲电压,经字线上的可变电阻,得到位线输出的第一电流,其中,可变电阻的第一电导值是根据第一幂次项的数值调节得到的;脉冲电压的电压值是根据与第一幂次项相对应的第一系数的系数值确定的;
模数转换器,用于接收由半导体存储器件发送的第一电流,对第一电流进行模数转换,得到与第一电流相对应的第一电流值;
计算器,用于接收由模数转换器发送的第一电流值,基于第一电流值,确定第一待计算函数的第一计算结果。
根据本公开的实施例,在字线上输入脉冲电压,经过字线上的电阻产生电流后,在位线上汇聚。模数转换器可以将电流信号转换成数字信号。计算器可以是累加树。
例如,计算Softmax(x2)时,按照图6中对字线的脉冲电压以及可变电阻的电导值的设置方式,将四个位线上的电流分别进行模数转换,并通过计算器求和得到第二计算结果,即的值。按照图3中对字线的脉冲电压以及可变电阻的电导值的设置方式,将位线上的电流进行模数转换,得到第一计算结果,即x2的值。
将第二计算结果设为m,计算ln(softmax(x2))就需要计算x2-lnm。计算lnm时,按照lnm的麦克劳林公式展开,即计算在使用五个字线计算麦克劳林公式结果的情况下,将脉冲电压分别设置为 将五个字线上设置的可变电阻的电导值分别设置为(m-1)、(m-1)2、(m-1)3、(m-1)4、(m-1)5。将位线上得到的电流进行模数转换,电流值大小就是lnm的值。使用第一计算结果与第三电流值作差,计算x2-lnm,得到第三计算结果。
将第三计算结果设为n,计算Softmax(x2)就转换成了计算即en的结果。可以按照图3中各个字线的脉冲电压设置方式,将脉冲电压分别设置为1、n、n2、n3,并将四个字线上设置的可变电阻的电导值分别设置为1、1、将位线上得到的电流进行模数转换,表征电流值大小的第四计算结果就是en的值,从而实现了Softmax(x2)的计算。
基于上述基于存算一体实现函数计算的方法和系统,本公开还提供了一种基于存算一体实现函数计算的装置。以下将结合图8对该装置进行详细描述。
图7示意性示出了根据本公开实施例的基于存算一体实现函数计算的装置的结构框图。
如图7所示,该实施例的基于存算一体实现函数计算的装置700包括第一调节模块710、第一输入模块720、第一转换模块730和第一确定模块740。
第一调节模块710用于针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据与第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第一电导值。在一实施例中,第一调节模块710可以用于执行前文描述的操作S210,在此不再赘述。
第一输入模块720用于根据第一幂次项的数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第一电流。在一实施例中,第一输入模块720可以用于执行前文描述的操作S220,在此不再赘述。
第一转换模块730用于对第一电流进行模数转换,得到与第一电流相对应的第一电流值。在一实施例中,第一转换模块730可以用于执行前文描述的操作S230,在此不再赘述。
第一确定模块740用于基于第一电流值,确定第一待计算函数的第一计算结果。在一实施例中,第一确定模块740可以用于执行前文描述的操作S240,在此不再赘述。
根据本公开的实施例,第一调节模块710包括第一确定单元和第一调节单元。
第一确定单元,用于根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻。
第一调节单元,用于根据第一系数的系数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第一电导值。
根据本公开的实施例,第一输入模块720包括第二确定单元、输入单元和汇总单元。
第二确定单元,用于根据第一泰勒展开式的第一幂次项的指数值,从多个字线中确定与第一幂次项相对应的字线。
输入单元,用于根据第一幂次项的数值,对与第一幂次项相对应的字线输入与第一系数的系数值相对应的脉冲电压。
汇总单元,用于对于每个位线,将与位线相关联的多个字线上的电流汇总,得到位线输出的第一电流。
根据本公开的实施例,基于存算一体实现函数计算的装置700还包括第二调节模块、第二输入模块、第二转换模块和第二确定模块。
第二调节模块,用于针对第一待计算函数中的第一泰勒展开式中的第一幂次项,根据第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的字线上的可变电阻的第二电导值。
第二输入模块,用于根据与第一幂次项相对应的第一系数的系数值,对半导体存储器件中的经可变电阻的字线输入脉冲电压,得到位线输出的第二电流。
第二转换模块,对第一电流进行模数转换,得到与第一电流相对应的第二电流值。
第二确定模块,用于基于第二电流值,确定第一待计算函数的第二计算结果。
根据本公开的实施例,第二调节模块包括第三确定单元和第二调节单元。
第三确定单元,用于根据第一泰勒展开式的第一幂次项的指数值,确定与第一幂次项相对应的字线上的可变电阻。
第二调节单元,根据第一泰勒展开式的第一幂次项的数值,调节半导体存储器件中的与第一幂次项相对应的可变电阻的第二电导值。
根据本公开的实施例,第二确定模块包括求和单元。
求和单元,用于对多个第二电流值求和,得到第二计算结果。
根据本公开的实施例,基于存算一体实现函数计算的装置700还包括第三确定模块、第三调节模块、第三输入模块、第三转换模块和第四确定模块。
第三确定模块,用于基于第二计算结果,确定第二待计算函数的麦克劳林展开式中的每个第二幂次项。
第三调节模块,用于针对每个第二幂次项,根据第二幂次项的数值,调节半导体存储器件中的与第二幂次项相对应的字线上的可变电阻的第三电导值。
第三输入模块,用于根据与第二幂次项相对应的第二系数的系数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第三电流。
第三转换模块,用于对第三电流进行模数转换,得到与第三电流相对应的第三电流值。
第四确定模块,用于基于第三电流值和第一计算结果,确定第三计算结果。
根据本公开的实施例,基于存算一体实现函数计算的装置700还包括第五确定模块、 第四调节模块、第四输入模块、第四转换模块和第六确定模块。
第五确定模块,用于基于第三计算结果,确定第三待计算函数的第二泰勒展开式中的每个第三幂次项。
第四调节模块,用于针对每个第三幂次项,根据与第三幂次项相对应的第三系数的系数值,调节半导体存储器件中的与第三幂次项相对应的字线上的可变电阻的第四电导值。
第四输入模块,用于根据第三幂次项的数值,对半导体存储器件中的字线输入脉冲电压,得到位线输出的第四电流。
第四转换模块,用于对第四电流进行模数转换,得到与第四电流相对应的第四电流值。
第六确定模块,用于基于第四电流值,确定第三待计算函数的第四计算结果。
根据本公开的实施例,第一调节模块710、第一输入模块720、第一转换模块730和第一确定模块740中的任意多个模块可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本公开的实施例,第一调节模块710、第一输入模块720、第一转换模块730和第一确定模块740中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,第一调节模块710、第一输入模块720、第一转换模块730和第一确定模块740中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。
图8示意性示出了根据本公开实施例的适于基于存算一体实现函数计算的方法的电子设备的方框图。
如图8所示,根据本公开实施例的电子设备800包括处理器801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储部分808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。处理器801例如可以包括通用微处理器(例如CPU)、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC))等等。处理器801还可以包括用于缓存用途的板载存储器。处理器801可以包括用于执行根据本公开实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。
在RAM 803中,存储有电子设备800操作所需的各种程序和数据。处理器801、ROM 802以及RAM 803通过总线804彼此相连。处理器801通过执行ROM 802和/或RAM 803中的程序来执行根据本公开实施例的方法流程的各种操作。需要注意,所述程序也可以存储在除ROM 802和RAM 803以外的一个或多个存储器中。处理器801也可以通过执行存储在所述一个或多个存储器中的程序来执行根据本公开实施例的方法流程的各种操作。
根据本公开的实施例,电子设备800还可以包括输入/输出(I/O)接口805,输入/ 输出(I/O)接口805也连接至总线804。电子设备800还可以包括连接至I/O接口805的以下部件中的一项或多项:包括键盘、鼠标等的输入部分806;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分807;包括硬盘等的存储部分808;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分809。通信部分809经由诸如因特网的网络执行通信处理。驱动器810也根据需要连接至I/O接口805。可拆卸介质811,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器810上,以便于从其上读出的计算机程序根据需要被安装入存储部分808。
本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的设备/装置/系统中所包含的;也可以是单独存在,而未装配入该设备/装置/系统中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被执行时,实现根据本公开实施例的方法。
根据本公开的实施例,计算机可读存储介质可以是非易失性的计算机可读存储介质,例如可以包括但不限于:便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。例如,根据本公开的实施例,计算机可读存储介质可以包括上文描述的ROM 802和/或RAM 803和/或ROM 802和RAM 803以外的一个或多个存储器。
本公开的实施例还包括一种计算机程序产品,其包括计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。当计算机程序产品在计算机系统中运行时,该程序代码用于使计算机系统实现本公开实施例所提供的方法。
在该计算机程序被处理器801执行时执行本公开实施例的系统/装置中限定的上述功能。根据本公开的实施例,上文描述的系统、装置、模块、单元等可以通过计算机程序模块来实现。
在一种实施例中,该计算机程序可以依托于光存储器件、磁存储器件等有形存储介质。在另一种实施例中,该计算机程序也可以在网络介质上以信号的形式进行传输、分发,并通过通信部分809被下载和安装,和/或从可拆卸介质811被安装。该计算机程序包含的程序代码可以用任何适当的网络介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。
在这样的实施例中,该计算机程序可以通过通信部分809从网络上被下载和安装,和/或从可拆卸介质811被安装。在该计算机程序被处理器801执行时,执行本公开实施例的系统中限定的上述功能。根据本公开的实施例,上文描述的系统、设备、装置、模块、单元等可以通过计算机程序模块来实现。
根据本公开的实施例,可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例提供的计算机程序的程序代码,具体地,可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。程序设计语言包括但不限于诸如Java,C++,python,“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、部分在远程计算设备上执行、或者完全在远 程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
本领域技术人员可以理解,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合或/或结合,即使这样的组合或结合没有明确记载于本公开中。特别地,在不脱离本公开精神和教导的情况下,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本公开的范围。
以上对本公开的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本公开的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本公开的范围由所附权利要求及其等同物限定。不脱离本公开的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本公开的范围之内。

Claims (10)

  1. 一种基于存算一体实现函数计算的方法,包括:
    针对第一待计算函数中的第一泰勒展开式中的第一幂次项,
    根据与所述第一幂次项对应的第一系数的系数值,调节半导体存储器件中的与所述第一幂次项相对应的字线上的可变电阻的第一电导值;
    根据所述第一幂次项的数值,对所述半导体存储器件中的经所述可变电阻的字线输入脉冲电压,得到位线输出的第一电流;
    对所述第一电流进行模数转换,得到与所述第一电流相对应的第一电流值;
    基于所述第一电流值,确定所述第一待计算函数的第一计算结果。
  2. 根据权利要求1所述的方法,其中,所述根据与所述第一幂次项对应的第一系数的系数值,调节半导体存储器件中的与所述第一幂次项相对应的字线上的可变电阻的第一电导值,包括:
    根据所述第一泰勒展开式的所述第一幂次项的指数值,确定与所述第一幂次项相对应的所述字线上的所述可变电阻;
    根据所述第一系数的系数值,调节所述半导体存储器件中的与所述第一幂次项相对应的所述可变电阻的第一电导值。
  3. 根据权利要求1所述的方法,其中,所述根据所述第一幂次项的数值,对所述半导体存储器件中的经所述可变电阻的字线输入脉冲电压,得到位线输出的第一电流,包括:
    根据所述第一泰勒展开式的第一幂次项的指数值,从多个字线中确定与所述第一幂次项相对应的所述字线;
    根据所述第一幂次项的数值,对与所述第一幂次项相对应的所述字线输入与所述第一系数的系数值相对应的脉冲电压;
    对于每个所述位线,将与所述位线相关联的多个所述字线上的电流汇总,得到所述位线输出的所述第一电流。
  4. 根据权利要求1所述的方法,还包括:
    针对第一待计算函数中的第一泰勒展开式中的每个第一幂次项,
    根据所述第一幂次项的数值,调节半导体存储器件中的与所述第一幂次项相对应的字线上的可变电阻的第二电导值;
    根据与所述第一幂次项相对应的第一系数的系数值,对所述半导体存储器件中的 经所述可变电阻的字线输入脉冲电压,得到位线输出的第二电流;
    对所述第一电流进行模数转换,得到与所述第一电流相对应的第二电流值;
    基于所述第二电流值,确定所述第一待计算函数的第二计算结果。
  5. 根据权利要求4所述的方法,其中,所述根据所述第一幂次项的数值,调节半导体存储器件中的与所述第一幂次项相对应的字线上的可变电阻的第二电导值,包括:
    根据所述第一泰勒展开式的所述第一幂次项的指数值,确定与所述第一幂次项相对应的所述字线上的所述可变电阻;
    根据所述第一泰勒展开式的所述第一幂次项的数值,调节所述半导体存储器件中的与所述第一幂次项相对应的所述可变电阻的第二电导值。
  6. 根据权利要求4所述的方法,其中,所述第一待计算函数包括多个第一泰勒展开式;
    所述基于所述第二电流值,确定所述第一待计算函数的第二计算结果,包括:
    对多个所述第二电流值求和,得到所述第二计算结果。
  7. 根据权利要求1所述的方法,还包括:
    基于所述第二计算结果,确定第二待计算函数的麦克劳林展开式中的每个第二幂次项;
    针对每个所述第二幂次项,根据所述第二幂次项的数值,调节所述半导体存储器件中的与所述第二幂次项相对应的字线上的可变电阻的第三电导值;
    根据与所述第二幂次项相对应的第二系数的系数值,对所述半导体存储器件中的所述字线输入脉冲电压,得到位线输出的第三电流;
    对所述第三电流进行模数转换,得到与所述第三电流相对应的第三电流值;
    基于所述第三电流值和所述第一计算结果,确定第三计算结果。
  8. 根据权利要求1所述的方法,还包括:
    基于所述第三计算结果,确定第三待计算函数的第二泰勒展开式中的每个第三幂次项;
    针对每个所述第三幂次项,根据与所述第三幂次项相对应的第三系数的系数值,调节所述半导体存储器件中的与所述第三幂次项相对应的字线上的可变电阻的第四电导值;
    根据所述第三幂次项的数值,对所述半导体存储器件中的所述字线输入脉冲电压,得到位线输出的第四电流;
    对所述第四电流进行模数转换,得到与所述第四电流相对应的第四电流值;
    基于所述第四电流值,确定第三待计算函数的第四计算结果。
  9. 一种基于存算一体实现函数计算的装置,包括:
    第一调节模块,用于根据与所述第一幂次项相对应的第一系数的系数值,调节半导体存储器件中的与所述第一幂次项相对应的字线上的可变电阻的第一电导值;
    第一输入模块,用于根据所述第一幂次项的数值,对所述半导体存储器件中的经所述可变电阻的字线输入脉冲电压,得到位线输出的第一电流;
    第一转换模块,用于对所述第一电流进行模数转换,得到与所述第一电流相对应的第一电流值;
    第一确定模块,用于基于所述第一电流值,确定所述第一待计算函数的第一计算结果。
  10. 一种基于存算一体实现函数计算的系统,包括:
    半导体存储器件,包括字线和位线,所述字线上设置有可变电阻;所述半导体存储器件用于所述位线上接收脉冲电压,经所述字线上的可变电阻,得到所述位线输出的第一电流,其中,所述可变电阻的第一电导值是根据与第一幂次项对应的第一系数的系数值调节得到的;所述脉冲电压的电压值是根据所述第一幂次项的数值确定的;
    模数转换器,用于接收由所述半导体存储器件发送的所述第一电流,对所述第一电流进行模数转换,得到与所述第一电流相对应的第一电流值;
    计算器,用于接收由所述模数转换器发送的所述第一电流值,基于所述第一电流值,确定所述第一待计算函数的第一计算结果。
PCT/CN2023/120690 2023-09-22 2023-09-22 基于存算一体实现函数计算的方法、装置、系统 Pending WO2025060063A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2023/120690 WO2025060063A1 (zh) 2023-09-22 2023-09-22 基于存算一体实现函数计算的方法、装置、系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2023/120690 WO2025060063A1 (zh) 2023-09-22 2023-09-22 基于存算一体实现函数计算的方法、装置、系统

Publications (1)

Publication Number Publication Date
WO2025060063A1 true WO2025060063A1 (zh) 2025-03-27

Family

ID=95073240

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/120690 Pending WO2025060063A1 (zh) 2023-09-22 2023-09-22 基于存算一体实现函数计算的方法、装置、系统

Country Status (1)

Country Link
WO (1) WO2025060063A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140755A1 (en) * 2006-12-12 2008-06-12 Brian Remy Mixed-signal system for performing taylor series function approximations
CN111095417A (zh) * 2017-09-07 2020-05-01 松下电器产业株式会社 使用非易失性半导体存储元件的神经网络运算电路
CN113094970A (zh) * 2021-03-12 2021-07-09 苏州芯启微电子科技有限公司 一种基于泰勒展开的函数计算加速装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140755A1 (en) * 2006-12-12 2008-06-12 Brian Remy Mixed-signal system for performing taylor series function approximations
CN111095417A (zh) * 2017-09-07 2020-05-01 松下电器产业株式会社 使用非易失性半导体存储元件的神经网络运算电路
CN113094970A (zh) * 2021-03-12 2021-07-09 苏州芯启微电子科技有限公司 一种基于泰勒展开的函数计算加速装置

Similar Documents

Publication Publication Date Title
CN113408702B (zh) 音乐神经网络模型预训练方法及电子设备和存储介质
CN113591999B (zh) 一种端边云联邦学习模型训练系统及方法
CN111582314A (zh) 目标用户确定方法、装置及电子设备
CN116127164A (zh) 码本量化模型的训练方法、搜索数据量化方法及其装置
WO2023185125A1 (zh) 产品资源的数据处理方法及装置、电子设备、存储介质
CN110717788A (zh) 一种目标用户的筛选方法及装置
CN114692970A (zh) 用户意向预测模型训练方法、用户意向预测方法及装置
CN117370798B (zh) 模型压缩方法、训练方法、多媒体数据处理方法及装置
WO2024051456A1 (zh) 多方协同模型训练方法、装置、设备和介质
CN114638221B (zh) 基于业务需求的业务模型生成方法及装置
CN110909908B (zh) 一种用于物品拣选时长预测的方法和装置
CN111612506A (zh) 金融资源抵扣方法、装置及电子设备
WO2025060063A1 (zh) 基于存算一体实现函数计算的方法、装置、系统
CN114610996A (zh) 一种信息推送的方法和装置
CN111858916B (zh) 用于聚类句子的方法和装置
CN117275542A (zh) 基于存算一体实现函数计算的方法、装置、系统
CN118114039A (zh) 时间序列模型的训练方法、时间序列的预测方法及其设备
CN118626536A (zh) 对象挖掘方法、装置、设备及存储介质
CN114626379B (zh) 基于注意力机制挖掘目标实体的方法及装置
CN113159177B (zh) 基于批归一化参数定点化的目标检测方法、系统、设备
CN112950003B (zh) 用户资源配额调整方法、装置及电子设备
CN113469721B (zh) 一种处理用户信息的方法及装置
CN113641909B (zh) 信息推送方法、装置、电子设备和计算机可读介质
CN115048561A (zh) 推荐信息确定方法及装置、电子设备和可读存储介质
CN115409635A (zh) 信息预测方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23952718

Country of ref document: EP

Kind code of ref document: A1