Method and apparatus for storing floating-point number, storage device, medium and computer program product

By utilizing the sub-threshold state characteristics of programmable semiconductor devices in neural networks, efficient storage and operation of floating-point numbers is achieved, which solves the problems of floating-point number storage efficiency and accuracy and improves computing performance.

CN118673976APending Publication Date: 2024-09-20BEIJING ZHICUN (WITIN) TECH CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410763547.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

In neural network calculations, the storage efficiency and accuracy of floating-point numbers cannot meet the needs of complex calculations, and existing technology cannot effectively utilize the characteristics of programmable semiconductor devices for efficient storage.

Method used

Determine the value to be stored based on floating point numbers and write it into the programmable semiconductor device. Utilize the super-linear relationship characteristics of the programmable semiconductor device in the sub-threshold state to realize the storage and operation of floating point numbers, using floating gate transistors, etc. structure is implemented.

Benefits of technology

It improves the storage efficiency and computing performance of floating point numbers, reduces analog-to-digital conversion and data transmission overhead, and improves processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673976A
    Figure CN118673976A
Patent Text Reader

Abstract

Provided are a method and apparatus for storing a floating-point number, a storage device, a medium and a computer program product, the implementation method comprising: determining one or more numerical values to be stored based on a numerical value of the floating-point number, the sum of the one or more numerical values to be stored being the numerical value of the floating-point number; and for each to-be-stored numerical value, based on the to-be-stored numerical value, causing the to-be-stored numerical value to be written into the programmable semiconductor device corresponding to the to-be-stored numerical value, where different to-be-stored numerical values correspond to different programmable semiconductor devices, where the programmable semiconductor devices are in a sub-threshold state, and where the programmable semiconductor devices are in a sub-threshold state. When the one or more to-be-stored numerical values are multiple to-be-stored numerical values, the first terminals of the programmable semiconductor devices corresponding to the one or more to-be-stored numerical values are connected, and the first terminals of the programmable semiconductor devices are source terminals or drain terminals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to data storage, and in particular to storage for floating point numbers. Background Art

[0002] Neural networks are the core of artificial intelligence technology. At present, neural networks have been widely studied and paid attention to, and are applied in many artificial intelligence application fields including computer vision, speech recognition, robotics, and autonomous driving.

[0003] In practical applications, the data (e.g., weights) involved in neural network calculations are often floating point numbers. Therefore, the floating point numbers involved need to be stored in order to perform neural network calculations.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] According to one aspect of the present disclosure, a method for storing floating-point numbers is provided, comprising: determining one or more values ​​to be stored based on the numerical value of the floating-point number, wherein the sum of the one or more values ​​to be stored is the numerical value of the floating-point number; and for each value to be stored, based on the value to be stored, causing the value to be stored to be written into a programmable semiconductor device corresponding to the value to be stored, wherein different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor device is in a subthreshold state, and wherein, when the one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected, wherein the first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

[0006] According to another aspect of the present disclosure, there is provided an apparatus for storing floating-point numbers, comprising: a numerical determination module, configured to: determine one or more numerical values ​​to be stored based on the numerical value of the floating-point number, wherein the sum of the one or more numerical values ​​to be stored is the numerical value of the floating-point number; and a writing module, configured to: for each numerical value to be stored, based on the numerical value to be stored, write the numerical value to be stored into a programmable semiconductor device corresponding to the numerical value to be stored, wherein different numerical values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor device is in a subthreshold state, and wherein, when the one or more numerical values ​​to be stored are multiple numerical values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more numerical values ​​to be stored are connected, wherein the first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

[0007] According to yet another aspect of the present disclosure, a storage device is provided, comprising: a plurality of programmable semiconductor devices; and a controller, wherein the controller is configured to execute instructions to implement any of the methods described in the present disclosure.

[0008] According to yet another aspect of the present disclosure, a computer-readable storage medium is provided, comprising instructions, which, when executed by a controller of the storage device as described in the present disclosure, cause the controller to execute the method as described in the present disclosure.

[0009] According to yet another aspect of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a controller of the storage device according to the present disclosure, cause the controller to execute the method according to the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0011] Figure 1 A flow chart of a method for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown;

[0012] Figure 2 A schematic diagram showing a programmable semiconductor device according to an exemplary embodiment of the present disclosure is shown;

[0013] Figure 3A-3B A schematic diagram of a programmable semiconductor device for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown;

[0014] Figure 4 A schematic diagram of a memory array for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown;

[0015] Figure 5 A flowchart of a method for storing floating point numbers in a neural network according to an exemplary embodiment of the present disclosure is shown;

[0016] Figure 6 A structural block diagram of a device for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown;

[0017] Figure 7 A structural block diagram of an exemplary storage device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0018] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0019] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0020] In the present disclosure, a floating point number is a computer numerical representation method for representing real numbers (i.e., numbers with decimal parts). Unlike fixed-point numbers, floating point numbers allow the decimal point to "float", that is, the decimal point can be in different positions, which can more efficiently represent very large or very small values. Usually, floating point numbers are represented in the form of exponents. For example, for the number 12345.6789, its floating point representation can be 1.23456789×10^4.

[0021] Because of the above characteristics of floating-point numbers, floating-point numbers are widely used in neural network calculations. For example, weights may become very large or very small during training, and floating-point numbers can flexibly handle such changes. For another example, floating-point numbers provide higher computing flexibility to support complex mathematical operations (for example, matrix multiplication operations).

[0022] Therefore, it is desirable to provide storage for floating-point numbers in order to perform floating-point number related calculations.

[0023] At least to solve the above-mentioned problem, the present disclosure provides a method for storing floating-point numbers, comprising: determining one or more values ​​to be stored based on the numerical value of the floating-point number, wherein the sum of the one or more values ​​to be stored is the numerical value of the floating-point number; and for each value to be stored, based on the value to be stored, causing the value to be stored to be written into a programmable semiconductor device corresponding to the value to be stored, wherein different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor device is in a subthreshold state, and wherein, when the one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected, wherein the first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

[0024] Figure 1FIG. 1 is a flow chart of a method 100 for storing floating point numbers according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the method 100 includes:

[0025] Step S101: determining one or more values ​​to be stored based on the value of the floating-point number, wherein the sum of the one or more values ​​to be stored is the value of the floating-point number; and

[0026] Step S102: For each value to be stored, based on the value to be stored, the value to be stored is written into a programmable semiconductor device corresponding to the value to be stored, wherein different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor device is in a subthreshold state, and wherein, when one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected, wherein the first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

[0027] According to the embodiments disclosed herein, the characteristic that the drain current or source current of a programmable semiconductor device in a subthreshold state has a superlinear relationship with the charge stored therein is utilized to perform floating-point number storage, wherein the value to be stored is written into the programmable semiconductor device corresponding to the value to be stored so that the leakage current of each programmable semiconductor device can correspond to the corresponding value to be stored, so that the leakage current of a single programmable semiconductor device (for example, when there is only one floating-point value to be stored) or the sum of the leakage currents of multiple programmable semiconductor devices (for example, when there are multiple floating-point values ​​to be stored) used for storage corresponds to the stored floating-point number.

[0028] In particular, since the drain current or source current of the programmable semiconductor device is in a subthreshold state and has a superlinear relationship with the charge stored therein, the above-mentioned superlinear relationship characteristics of the programmable semiconductor device are used to represent floating-point numbers, so that the floating-point numbers can be easily stored in the programmable semiconductor device.

[0029] According to some embodiments, the programmable semiconductor device may be implemented using a floating gate transistor, the structure of which is as follows: Figure 2 As shown, the floating gate transistor includes a substrate, an insulating layer, a third terminal G, a first terminal S / D1, a second terminal S / D2 and a floating gate F. The floating gate is arranged between the third terminal G and the insulating layer. The insulating layer is arranged between the floating gate and the substrate to protect the electrons in the floating gate from leakage. The floating gate can store electrons. By adjusting the number of electrons in the floating gate, the threshold voltage of the floating gate transistor is dynamically adjusted, thereby adjusting the leakage current of the floating gate transistor.

[0030] According to some embodiments, an appropriate third terminal voltage is added to the third terminal of the programmable semiconductor device corresponding to one or more numerical values ​​to be stored to set the programmable semiconductor device in a subthreshold state. For example, a third terminal voltage lower than the threshold voltage of one or more programmable semiconductor devices is applied to the third terminal of the one or more programmable semiconductor devices so that the one or more programmable semiconductor devices are in a subthreshold state.

[0031] According to some embodiments, the third terminal of the programmable semiconductor device is a gate terminal.

[0032] Figure 3A-3B A schematic diagram of a programmable semiconductor device for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown.

[0033] According to some embodiments, according to the characteristics of the programmable semiconductor device in a subthreshold device, the current of the first terminal of the programmable semiconductor device is the product of the voltage of the second terminal of the programmable semiconductor device and the stored value of the programmable semiconductor device, that is, I D / S =V S / D ×W, where I D / S is the first terminal current of the programmable semiconductor device, V S / D is the second terminal voltage of the programmable semiconductor device, and W is the stored value of the programmable semiconductor device, wherein W is adjusted according to the charge written into the programmable semiconductor device in the above-mentioned writing process. According to some embodiments, the relationship between the stored value W of the programmable semiconductor device and the charge in the programmable semiconductor device is W=k×exp(e*c), wherein e is the stored charge of the programmable semiconductor device, and k and c are constants.

[0034] Figure 3A The case of using a programmable semiconductor device 301 to store floating-point numbers is shown. According to some embodiments, the value to be stored is the value of the floating-point number, wherein the stored data W of the programmable semiconductor device 301 corresponds to the value of the floating-point number. As described above, the first terminal current of the programmable semiconductor device 301 is the product of the second terminal voltage of the programmable semiconductor device 301 and the stored value of the programmable semiconductor device 301. According to some embodiments, the one programmable semiconductor device 301 can be used to implement the multiplication operation of the floating-point number, for example, the second terminal voltage of the programmable semiconductor device is adjusted according to the multiplier (for example, the input value in the neural network), and the product of the multiplication operation is determined according to the first terminal current of the programmable semiconductor device 301. According to some embodiments, according to the first terminal current of the programmable semiconductor device 301, the value of the floating-point number can be read from the one programmable semiconductor device 301, for example, the value of the floating-point number is determined according to the first terminal current of the programmable semiconductor device 301.

[0035] Figure 3B The embodiment shows a case where a plurality of programmable semiconductor devices 301-30N are used to store floating point numbers. According to some embodiments, each programmable semiconductor device is used to store a corresponding value to be stored, and the corresponding values ​​to be stored W1-W2 in the plurality of programmable semiconductor devices 301-30N are N According to some embodiments, as described above, for each programmable semiconductor device, the first terminal current is the product of the second terminal voltage of the programmable semiconductor device and the stored value of the programmable semiconductor device. For example, for the i-th programmable semiconductor device, the first terminal current I of the i-th programmable semiconductor device is D / Si is the second terminal voltage V of the programmable semiconductor device S / Di The stored value W of the programmable semiconductor device i The product of D / Si =V S / Di ×W i .

[0036] According to some embodiments, a plurality of programmable semiconductor devices 301 ˜ 30N may be used to implement the floating point multiplication operation, wherein, since the first terminals of the plurality of programmable semiconductor devices 301 ˜ 30N are connected, according to Kirchhoff's current law, the output terminal current I D / S is the first terminal current I of the plurality of programmable semiconductor devices 301 ˜ 30N D / S1 ~I D / SN For example, the second terminal voltages V of the plurality of programmable semiconductor devices 301 to 30N are adjusted according to the multiplier (eg, the input value in the neural network). S / D1 ~V S / DN , and, according to the first terminal current I of the plurality of programmable semiconductor devices 301 ˜ 30N D / S1 ~I D / SN The product of the multiplication operation is determined by summing the values.

[0037] According to some embodiments, according to the first terminal current I D / S1 ~I D / SN , the first terminal current I of the plurality of programmable semiconductor devices 301 ˜ 30N can be D / S1 ~I D / SN To read the value of the floating point number, for example, according to the first terminal current I of the plurality of programmable semiconductor devices 301 ˜ 30N D / S1 ~I D / SN The sum is used to determine the value of the floating-point number.

[0038] According to some embodiments, the same second terminal voltage may be applied to the plurality of programmable semiconductor devices 301 ˜ 30N, so that the stored values ​​stored in the plurality of programmable semiconductor devices 301 ˜ 30N are equivalent to the values ​​of the stored floating-point numbers.

[0039] According to some embodiments, based on the value of the floating-point number, determining one or more values ​​to be stored includes: in response to the value of the floating-point number being within the storage range of a single programmable semiconductor device, determining that the value to be stored is the value of the floating-point number; and in response to the value of the floating-point number exceeding the storage range of the single programmable semiconductor device, dividing the value of the floating-point number into multiple values ​​to be stored based on the precision range of the single programmable semiconductor device. According to the embodiments as described in the present disclosure, one or more values ​​to be stored are determined based on the storage range of the programmable semiconductor device, for example, whether the value of the floating-point number needs to be divided and how to divide the value of the floating-point number, so that the storage capacity of the programmable semiconductor device can be fully utilized and the precision of the stored floating-point number can still be guaranteed.

[0040] According to some embodiments, the storage range of a single programmable semiconductor device is determined based on characteristics of the programmable semiconductor device, for example, the total number of charges that can be stored in a floating gate of a programmable floating gate semiconductor device.

[0041] According to some embodiments, in response to the value of a floating-point number exceeding the storage range of a single programmable semiconductor device, when the value of the floating-point number is divided into multiple values ​​to be stored based on the precision range of the single programmable semiconductor device, the value of the floating-point number is divided once or multiple times based on the precision range of the single programmable semiconductor device. For example, when the value of a floating-point number exceeds the storage range of a single programmable semiconductor device, a first value to be stored is determined based on the precision range of the single programmable semiconductor device, and the undivided portion of the value of the floating-point number, that is, the difference between the value of the floating-point number and the first value to be stored, is calculated; then, it is determined whether the undivided portion of the value of the floating-point number exceeds the storage range of the single programmable semiconductor device, wherein, if so, the division of the value to be stored as described above is continued to determine the second value to be stored based on the precision range of the single programmable semiconductor device, and the undivided portion of the value of the floating-point number is updated, that is, the difference between the original undivided value of the floating-point number and the second value to be stored, and, if not, the second value to be stored is determined as the undivided portion of the value of the floating-point number; ...; and so on, until the undivided portion of the value of the floating-point number does not exceed the storage range of the single programmable semiconductor device, then the undivided portion of the value of the floating-point number is determined as the last value to be stored.

[0042] According to some embodiments, when one or more values ​​to be stored are multiple values ​​to be stored, the programmable semiconductor devices corresponding to the one or more values ​​to be stored are located in the same row in the memory array, wherein the memory array includes a plurality of programmable semiconductor devices arranged in an array, wherein the second terminals of all programmable semiconductor devices in each column are connected, the third terminals of all programmable semiconductor devices in each row are connected, and the first terminals of all programmable semiconductor devices in each row are connected, wherein the third terminal of the programmable semiconductor device is a gate terminal, and when the first terminal of the programmable semiconductor device is a source terminal, the second terminal of the programmable semiconductor device is a drain terminal, and when the first terminal of the programmable semiconductor device is a drain terminal, the second terminal of the programmable semiconductor device is a source terminal. According to the embodiments as described in the present disclosure, by using programmable semiconductor devices in the same row to store multiple values ​​with storage, it is convenient to simultaneously control multiple programmable semiconductor devices to perform a read operation or a multiplication operation.

[0043] Figure 4 A schematic diagram of a memory array 400 for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown.

[0044] According to some embodiments, Figure 4 As shown, the memory array 400 includes N second terminal voltage input terminals V1-V N , an M-row×N-column programmable semiconductor device array, M third-terminal voltage input terminals, and M first-terminal current output terminals, wherein in the programmable semiconductor device array, the second terminals of all programmable semiconductor devices in each column are connected to the same second-terminal voltage input terminal, the N-column programmable semiconductor devices are correspondingly connected to the N second-terminal voltage input terminals, the third terminals of all programmable semiconductor devices in each row are connected to the same third-terminal voltage input terminal, the M-row programmable semiconductor devices are correspondingly connected to the M third-terminal voltage input terminals, the first terminals of all programmable semiconductor devices in each row are connected to the same first-terminal current output terminal, the M-row programmable semiconductor devices are correspondingly connected to the M first-terminal current output terminals, wherein the threshold voltage of each programmable semiconductor device can be adjusted according to the value to be stored, for example, by controlling the amount of charge written into the programmable semiconductor device during the writing phase.

[0045] According to some embodiments, one or more programmable semiconductor devices in the same row can be used to store floating-point numbers, so that the aggregated first-terminal current of one or more programmable semiconductor devices can be received through the first-terminal current output end of each row, and the one or more programmable semiconductor devices can be uniformly controlled to be turned on / off through the third-terminal voltage input end of each row, so as to perform a read operation or multiplication operation corresponding to the floating-point number.

[0046] According to some embodiments, the same row in the memory array 400 can be used to store one or more floating point numbers, wherein a first group of programmable semiconductor devices in the same row in the memory array 400 is used to store a first floating point number, and a second group of programmable semiconductor devices in the same row in the memory array 400 is used to store a second floating point number.

[0047] According to some embodiments, when performing a multiplication operation, the same first-second terminal voltage may be applied to the second terminals of a first group of programmable semiconductor devices in the same row for storing a first floating-point number, and the same second-second terminal voltage may be applied to the second terminals of a second group of programmable semiconductor devices in the same row for storing a second floating-point number, wherein the first-second terminal voltage corresponds to a first multiplier for multiplication with the first floating-point number, and the second-second terminal voltage corresponds to a second multiplier for multiplication with the second floating-point number, and accordingly, the first terminal output current of the row corresponds to the sum of the product of the first floating-point number and the first multiplier, and the product of the second floating-point number and the second multiplier.

[0048] For example, the 1st to ith programmable semiconductor devices in the first row of the memory array 400 may be used to store the value of a first floating point number, and the (i+1)th to jth programmable semiconductor devices in the same row may be used to store the value of a second floating point number, wherein when the values ​​stored in the 1st to ith programmable semiconductor devices are W 1,1 ~W 1,i , and the values ​​stored in the (i+1)th to jth programmable semiconductor devices are W 1,(i+1) ~W 1,j , corresponding to the first and second terminal voltages of the 1st to ith programmable semiconductor devices are V S / D1 , corresponding to the second second terminal voltage of the (i+1)th to jth programmable semiconductor devices is V S / D2 When the output current of the first terminal of the row is V S / D1 ×

[0049] (W1+W2+…+W i )+V S / D2 ×(W (i+1) +W (i+2) +…+W j )=V S / D1 ×N f1 +V S / D2 ×N f2 , where N f1 is the first floating point number, and N f2 The second floating point number.

[0050] According to some embodiments, different rows of programmable semiconductor devices in the memory array 400 may be used to store different floating point numbers, thereby achieving the effect of matrix multiplication.

[0051] According to some embodiments, the method for storing floating-point numbers as described in the present disclosure also includes: applying a second terminal voltage to a second terminal of a programmable semiconductor device corresponding to one or more numerical values ​​to be stored, wherein the second terminal voltage is determined based on another multiplier multiplied with the floating-point number; and determining the product of the multiplication operation based on the sum of the first terminal currents of the programmable semiconductor devices corresponding to the one or more numerical values ​​to be stored.

[0052] According to some embodiments, the present disclosure utilizes programmable semiconductor devices to implement floating-point operations. Because programmable semiconductor devices have high integration, fast response speed, and low power consumption, the floating-point operations implemented using programmable semiconductor devices effectively reduce the overhead caused by analog-to-digital conversion, digital-to-analog conversion, data transmission, etc., and their processing performance is greatly improved.

[0053] According to some embodiments, when performing the multiplication operation, the same third terminal voltage is applied to the third terminals of the programmable semiconductor device corresponding to one or more values ​​to be stored.

[0054] According to some embodiments, determining the product of the multiplication operation based on the sum of the first terminal currents of the programmable semiconductor devices corresponding to one or more values ​​to be stored includes: determining the product of the multiplication operation based on the sign bit of the floating-point number and the sum of the first terminal currents of the programmable semiconductor devices corresponding to one or more values ​​to be stored. According to the embodiments as described in the present disclosure, by determining the product of the multiplication operation based on the sign bit of the floating-point number and the sum of the first terminal currents of the programmable semiconductor devices corresponding to one or more values ​​to be stored, the operation of the floating-point number to be signed can be implemented.

[0055] According to some embodiments, the floating point number may be stored outside of one or more programmable semiconductor devices (e.g., Figure 3A The programmable semiconductor device 300 shown, Figure 3B The plurality of programmable semiconductor devices 301 to 30N shown in FIG. Figure 4 A multiplier and a storage unit for storing sign bit data of a floating point number are provided outside the programmable semiconductor device in the memory array 400 in the memory array, wherein the multiplier multiplies the sign bit data of the floating point number by the sum of the first terminal currents of one or more programmable semiconductor devices.

[0056] According to some embodiments, in addition to the multiplication operation described above, floating point data stored in the one or more programmable semiconductor devices may be read based on the first terminal current of the one or more programmable semiconductor devices.

[0057] According to some embodiments, the method for storing floating-point numbers as described in the present disclosure further includes, for each value to be stored, after performing a write operation on a programmable semiconductor device corresponding to one or more values ​​to be stored based on the value to be stored: applying a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to one or more values ​​to be stored; and determining the stored value stored in the programmable semiconductor device corresponding to one or more values ​​to be stored based on the sum of the first terminal currents of the programmable semiconductor device corresponding to one or more values ​​to be stored. According to the embodiments as described in the present disclosure, the present disclosure utilizes programmable semiconductor devices to implement floating-point number storage. Because programmable semiconductor devices have high integration, fast response speed, and low power consumption, the floating-point number storage implemented by programmable semiconductor devices effectively reduces the overhead caused by analog-to-digital conversion, digital-to-analog conversion, data transmission, etc., and its processing performance is greatly improved.

[0058] According to some embodiments, when performing the above-mentioned read operation, the same second terminal voltage (e.g., 1V) is applied to the third terminal of the programmable semiconductor device corresponding to one or more values ​​to be stored. According to some embodiments, when performing the above-mentioned read operation, the same third terminal voltage is applied to the third terminal of the programmable semiconductor device corresponding to one or more values ​​to be stored.

[0059] According to some embodiments, in order to ensure the correctness of the values ​​to be stored written to one or more programmable semiconductor devices, it is necessary to read and verify the data just written after the write operation to check whether any errors have occurred, such as data corruption or write errors, to help correct the write errors in time and thus maintain data integrity.

[0060] According to some embodiments, the method for storing floating-point numbers as described in the present disclosure further includes: based on the stored value and the value of the floating-point number, verifying the write operation of the programmable semiconductor device corresponding to one or more values ​​to be stored; and in response to the write operation of the programmable semiconductor device corresponding to one or more values ​​to be stored failing the verification, repeating the write operation of the programmable semiconductor device corresponding to one or more values ​​to be stored based on the value to be stored. In the embodiments as described in the present disclosure, by performing read verification and rewriting when the verification fails, data integrity is ensured, system reliability is improved, performance is optimized, and potential failures are prevented.

[0061] According to some embodiments, in performing the Figure 1 After the writing described in step S102 in , the values ​​stored in the one or more programmable semiconductor devices are read, and verification is performed based on the read values ​​and the value of the floating point number.

[0062] According to some embodiments, a difference between a stored value stored in a programmable semiconductor device corresponding to one or more values ​​to be stored and a value of a floating-point number is determined, and a judgment is made as to whether the difference exceeds a verification threshold, wherein, in response to the difference between the stored value and the value of the floating-point number being greater than the verification threshold, it is judged as failing the verification, and, in response to the difference between the stored value and the value of the floating-point number being less than or equal to the verification threshold, it is judged as passing the verification.

[0063] According to some embodiments, in response to the write operation of the programmable semiconductor device corresponding to one or more values ​​to be stored passing the verification, the writing of the value of the floating point number is terminated. According to one embodiment, verification can be performed after each floating point number is stored to confirm that the value of the floating point number is accurately stored. According to other embodiments, verification of multiple floating point numbers can be performed after storing multiple floating point numbers, for example, in the case of Figure 4 After performing write operations corresponding to a plurality of floating point numbers, the programmable semiconductor devices in a row or the entire memory array 400 shown perform verification operations corresponding to the plurality of floating point numbers.

[0064] According to some embodiments, the method for storing floating point numbers as described in the present disclosure further includes, before determining one or more values ​​to be stored based on the numerical value of the floating point number: quantizing the original data into floating point numbers, wherein the precision of the floating point number is lower than the precision of the original data.

[0065] According to some embodiments, in the application of neural networks, it is necessary to convert model parameters and activation values ​​from high-precision representation to low-precision representation, so as to reduce the storage requirements of the model, reduce the computing cost, and speed up the reasoning speed, especially in resource-constrained devices (e.g., mobile devices or embedded systems).

[0066] According to some embodiments, the quantization operation described in the present disclosure may be post-training quantization (PTQ) to quantize the parameters of the trained model. For example, first, the model is range-set to determine the value range of each parameter in the model. Then, the high-precision parameter values ​​are quantized to low-precision values ​​according to these ranges. According to other embodiments, the quantization operation described in the present disclosure may also be quantization-aware training (QAT) to introduce quantization operations during the model training process, so that the model can adapt to the constraints and errors caused by quantization during training.

[0067] Figure 5 FIG. 5 is a flow chart of a method 500 for storing floating point numbers in a neural network according to an exemplary embodiment of the present disclosure. Figure 5 As shown, the method 500 includes:

[0068] Step S501: Determine weight;

[0069] Step S502: quantizing the weights, wherein the weight quantization may be post-training quantization (PTQ) or quantization-aware training (QAT);

[0070] Step S503: storing weights, wherein the process of storing weights can be the same as that of reference Figure 1 The process of the described method 100 is similar;

[0071] Step S504: Determine whether the written weight has passed verification, if yes, proceed to step S505, and if no, proceed to step S506, wherein determining whether the written weight has passed verification may be achieved by determining whether the difference between the read value and the stored weight exceeds a threshold;

[0072] Step S505: store the weights again, wherein the process of storing the weights can be the same as that of reference Figure 1 The process of the described method 100 is similar; and

[0073] Step S506: Complete the storage process.

[0074] According to another aspect of the present disclosure, a device for storing floating point numbers is also provided. Figure 6 A structural block diagram of an apparatus 600 for storing floating point numbers according to an exemplary embodiment of the present disclosure is shown.

[0075] like Figure 6 As shown, the device 600 for storing floating point numbers includes:

[0076] The value determination module 601 is configured to: determine one or more values ​​to be stored based on the value of the floating point number, wherein the sum of the one or more values ​​to be stored is the value of the floating point number; and

[0077] The writing module 602 is configured to: for each value to be stored, based on the value to be stored, write the value to be stored into the programmable semiconductor device corresponding to the value to be stored,

[0078] Wherein, different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor devices are in a subthreshold state, and wherein, when one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected.

[0079] According to some embodiments, the numerical determination module 601 includes: a first determination submodule, configured to: in response to the numerical value of the floating-point number being within the storage range of a single programmable semiconductor device, determine that the numerical value to be stored is the numerical value of the floating-point number; and a second determination submodule, configured to: in response to the numerical value of the floating-point number exceeding the storage range of the single programmable semiconductor device, divide the numerical value of the floating-point number into multiple numerical values ​​to be stored based on the precision range of the single programmable semiconductor device.

[0080] According to some embodiments, when one or more values ​​to be stored are multiple values ​​to be stored, the programmable semiconductor devices corresponding to the one or more values ​​to be stored are located in the same row in a memory array, wherein the memory array includes a plurality of programmable semiconductor devices arranged in an array, wherein the second terminals of all programmable semiconductor devices in each column are connected, the third terminals of all programmable semiconductor devices in each row are connected, and the first terminals of all programmable semiconductor devices in each row are connected.

[0081] According to some embodiments, the device 600 also includes: a voltage application module, configured to apply a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to one or more numerical values ​​to be stored, wherein the second terminal voltage is determined based on another multiplier for multiplication with a floating-point number; and a product determination module, configured to determine the product of the multiplication operation based on the sum of the first terminal currents of the programmable semiconductor device corresponding to one or more numerical values ​​to be stored.

[0082] According to some embodiments, the product determination module includes: a product determination submodule configured to: determine the product of the multiplication operation based on the sign bit of the floating point number and the sum of the first terminal current of the programmable semiconductor device corresponding to one or more values ​​to be stored.

[0083] According to some embodiments, the device 600 also includes: a voltage application module, configured to apply a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to one or more numerical values ​​to be stored; and a numerical value reading module, configured to determine a storage value stored in the programmable semiconductor device corresponding to one or more numerical values ​​to be stored based on the sum of the first terminal currents of the programmable semiconductor device corresponding to the one or more numerical values ​​to be stored.

[0084] According to some embodiments, the device 600 also includes: a verification module, configured to: verify the write operation of the programmable semiconductor device corresponding to the value to be stored based on the stored numerical value and the numerical value of the floating-point number; and a re-write module, configured to: in response to the write operation of the programmable semiconductor device corresponding to the value to be stored failing the verification, repeat the write operation of the programmable semiconductor device corresponding to the value to be stored based on the value to be stored.

[0085] According to some embodiments, the apparatus 600 further comprises: a quantization module configured to: quantize the original data into floating point numbers, wherein the precision of the floating point numbers is lower than the precision of the original data.

[0086] It should be understood that Figure 6 The various modules of the apparatus 600 shown in FIG. 6 can be used in conjunction with the reference Figure 1 The steps in the method 100 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 100 are also applicable to the apparatus 600 and the modules included therein. For the sake of brevity, some operations, features and advantages are not described in detail here.

[0087] Although specific functions are discussed above with reference to specific modules, it should be noted that the functions of the various modules discussed herein can be divided into multiple modules, and / or at least some functions of multiple modules can be combined into a single module. The specific module discussed herein performs an action including the specific module itself performing the action, or alternatively the specific module calls or otherwise accesses another component or module that performs the action (or performs the action in conjunction with the specific module). Therefore, the specific module that performs an action can include the specific module itself that performs the action and / or the specific module calls or otherwise accesses another module that performs the action. For example, the numerical determination module 601 and the write module 602 described above can be combined into a single module in some embodiments.

[0088] Figure 7 1 shows a block diagram of an exemplary storage device 700 that can be used to implement the embodiments of the present disclosure. Figure 7 As shown, the storage device 700 includes: a plurality of programmable semiconductor devices 701-70N; and a controller 710, the controller being configured to execute instructions to implement the method described in the present disclosure (for example, as described in reference Figure 1 Method 100 described herein).

[0089] In an example, the controller includes a microcontroller or computer that executes instructions stored in firmware and / or software. The controller may be programmable to perform the functions described herein. As used herein, the term computer is not limited to these integrated circuits known in the art as computers, but broadly refers to computers, processors, microcontrollers, microcomputers, programmable logic controllers, application specific integrated circuits, and other programmable circuits, and these terms are used interchangeably herein.

[0090] According to another aspect of the present disclosure, a computer-readable storage medium is provided, comprising instructions, which, when executed by a controller of the storage device as described in the present disclosure, cause the controller to execute the method as described in the present disclosure.

[0091] According to yet another aspect of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a controller of the storage device according to the present disclosure, causes the controller to execute the method according to the present disclosure.

[0092] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for storing floating point numbers, comprising: Based on the value of the floating-point number, determining one or more values ​​to be stored, wherein the sum of the one or more values ​​to be stored is the value of the floating-point number; and For each value to be stored, based on the value to be stored, the value to be stored is written into a programmable semiconductor device corresponding to the value to be stored, Wherein, different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor devices are in a subthreshold state, and Wherein, when the one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected, The first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

2. The method of claim 1, wherein: The determining one or more values ​​to be stored based on the value of the floating-point number comprises: In response to the value of the floating point number being within the storage range of the single programmable semiconductor device, determining that the value to be stored is the value of the floating point number; and In response to the value of the floating point number exceeding the storage range of the single programmable semiconductor device, the value of the floating point number is divided into a plurality of values ​​to be stored based on the precision range of the single programmable semiconductor device.

3. The method of claim 2, wherein: When the one or more values ​​to be stored are multiple values ​​to be stored, the programmable semiconductor devices corresponding to the one or more values ​​to be stored are located in the same row in the memory array, The memory array includes a plurality of programmable semiconductor devices arranged in an array, wherein the second terminals of all programmable semiconductor devices in each column are connected, the third terminals of all programmable semiconductor devices in each row are connected, and the first terminals of all programmable semiconductor devices in each row are connected. The third terminal of the programmable semiconductor device is a gate terminal, and When the first terminal of the programmable semiconductor device is a source terminal, the second terminal of the programmable semiconductor device is a drain terminal, and When the first terminal of the programmable semiconductor device is a drain terminal, the second terminal of the programmable semiconductor device is a source terminal.

4. The method according to any one of claims 1 to 3, further comprising: applying a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to the one or more values ​​to be stored, wherein the second terminal voltage is determined based on another multiplier multiplied by the floating point number; and A product of the multiplication operation is determined based on a sum of first terminal currents of the programmable semiconductor device corresponding to the one or more values ​​to be stored.

5. The method according to claim 4, wherein: Determining the product of the multiplication operation based on the sum of the first terminal currents of the programmable semiconductor device corresponding to the one or more values ​​to be stored comprises: A product of the multiplication operation is determined based on a sign bit of the floating point number and a sum of a first terminal current of the programmable semiconductor device corresponding to the one or more values ​​to be stored.

6. The method according to any one of claims 1 to 3, further comprising, after performing a write operation of the programmable semiconductor device corresponding to each value to be stored based on the value to be stored: applying a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to the one or more values ​​to be stored; and A storage value stored in the programmable semiconductor device corresponding to the one or more values ​​to be stored is determined based on the sum of the first terminal currents of the programmable semiconductor devices corresponding to the one or more values ​​to be stored.

7. The method of claim 6, further comprising: Based on the stored value and the value of the floating point number, verifying a write operation of the programmable semiconductor device corresponding to the one or more values ​​to be stored; as well as In response to the write operation of the programmable semiconductor device corresponding to the stored value failing verification, the write operation of the programmable semiconductor device corresponding to the one or more values ​​to be stored is repeated based on the value to be stored.

8. The method according to any one of claims 1 to 3, further comprising, before determining one or more values ​​to be stored based on the value of the floating-point number: The original data is quantized into the floating point number, where The precision of the floating point number is lower than the precision of the original data.

9. A device for storing floating point numbers, comprising: a value determination module, configured to: determine one or more values ​​to be stored based on the value of the floating-point number, wherein the sum of the one or more values ​​to be stored is the value of the floating-point number; and The writing module is configured to: for each value to be stored, based on the value to be stored, write the value to be stored into the programmable semiconductor device corresponding to the value to be stored, Wherein, different values ​​to be stored correspond to different programmable semiconductor devices, the programmable semiconductor devices are in a subthreshold state, and Wherein, when the one or more values ​​to be stored are multiple values ​​to be stored, the first terminals of the programmable semiconductor devices corresponding to the one or more values ​​to be stored are connected, The first terminal of the programmable semiconductor device is a source terminal or a drain terminal.

10. The device of claim 9, wherein: The value determination module comprises: A first determining submodule is configured to: in response to the value of the floating point number being within the storage range of the single programmable semiconductor device, determine that the value to be stored is the value of the floating point number; and The second determining submodule is configured to: in response to the value of the floating point number exceeding the storage range of the single programmable semiconductor device, divide the value of the floating point number into multiple values ​​to be stored based on the precision range of the single programmable semiconductor device.

11. The device of claim 10, wherein: When the one or more values ​​to be stored are multiple values ​​to be stored, the programmable semiconductor devices corresponding to the one or more values ​​to be stored are located in the same row in the memory array. The memory array includes a plurality of programmable semiconductor devices arranged in an array, wherein the second terminals of all programmable semiconductor devices in each column are connected, the third terminals of all programmable semiconductor devices in each row are connected, and the first terminals of all programmable semiconductor devices in each row are connected. The third terminal of the programmable semiconductor device is a gate terminal, and When the first terminal of the programmable semiconductor device is a source terminal, the second terminal of the programmable semiconductor device is a drain terminal, and When the first terminal of the programmable semiconductor device is a drain terminal, the second terminal of the programmable semiconductor device is a source terminal.

12. The apparatus according to any one of claims 9 to 11, further comprising: a voltage applying module configured to: apply a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to the one or more values ​​to be stored, wherein the second terminal voltage is determined based on another multiplier multiplied by the floating point number; and The product determination module is configured to determine the product of the multiplication operation based on the sum of the first terminal currents of the programmable semiconductor device corresponding to the one or more values ​​to be stored.

13. The device according to claim 12, wherein: The product determination module comprises: The product determination submodule is configured to determine the product of the multiplication operation based on the sign bit of the floating point number and the sum of the first terminal currents of the programmable semiconductor device corresponding to the one or more values ​​to be stored.

14. The apparatus according to any one of claims 9 to 11, further comprising: A voltage applying module is configured to: apply a second terminal voltage to a second terminal of the programmable semiconductor device corresponding to the one or more values ​​to be stored; as well as The value reading module is configured to determine a storage value stored in the programmable semiconductor device corresponding to the one or more values ​​to be stored based on the sum of the first terminal currents of the programmable semiconductor devices corresponding to the one or more values ​​to be stored.

15. The apparatus of claim 14, further comprising: A verification module is configured to: verify a write operation of a programmable semiconductor device corresponding to the value to be stored based on the stored value and the value of the floating point number; as well as The rewriting module is configured to: in response to the write operation of the programmable semiconductor device corresponding to the value to be stored failing verification, repeat the write operation of the programmable semiconductor device corresponding to the value to be stored based on the value to be stored.

16. The apparatus according to any one of claims 9 to 11, further comprising: The quantization module is configured to: quantize the original data into the floating point number, wherein the precision of the floating point number is lower than the precision of the original data.

17. A storage device comprising: a plurality of programmable semiconductor devices; as well as A controller, wherein the controller is configured to execute instructions to implement the method according to any one of claims 1 to 8.

18. A computer-readable storage medium comprising instructions, which, when executed by a controller of the storage device of claim 17, cause the controller to perform the method of any one of claims 1-8.

19. A computer program product comprising instructions, which, when executed by a controller of the storage device of claim 17, cause the controller to perform the method of any one of claims 1-8.

Citation Information

Cited By

  • Method and apparatus for storing data, storage device, medium, and computer program product

    WO2025256629A1