WO2025089498A1 - Low-precision floating-point friendly quantization method and apparatus - Google Patents
Low-precision floating-point friendly quantization method and apparatus Download PDFInfo
- Publication number
- WO2025089498A1 WO2025089498A1 PCT/KR2023/020765 KR2023020765W WO2025089498A1 WO 2025089498 A1 WO2025089498 A1 WO 2025089498A1 KR 2023020765 W KR2023020765 W KR 2023020765W WO 2025089498 A1 WO2025089498 A1 WO 2025089498A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- quantization
- channel
- weights
- quantization method
- predetermined
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/15—Correlation function computation including computation of convolution operations
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/483—Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0495—Quantised networks; Sparse networks; Compressed networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/096—Transfer learning
Definitions
- the present invention relates to a low-precision floating-point friendly quantization method and device.
- a CNN Convolutional Neural Network
- multiple convolutional layers and multiple fully connected layers can be provided between the input layer and the output layer.
- one convolutional layer can have as many filters as the number of channels of the input image, and the output image of the convolutional layer is generated by applying the filter assigned to each channel.
- a convolutional layer that applies a 3x3 sized filter to a 4x4x1 tensor-shaped input image
- a 2x2x1 tensor-shaped image is generated through a convolution operation on the image and the filter.
- FP32 is generally used as a format for expressing the weights that constitute the filter, but it requires a lot of computational power and memory resources.
- quantization is often performed.
- the weights and activations of the network can be quantized.
- Quantization can be performed to convert them into a data type with a lower bit rate than the most commonly used basic format, FP32.
- the types being converted include fixed-point formats such as INT16, INT8, and INT4, and floating-point formats such as FP16 and FP8. Because they use a lower bit width than the default FP32, they are also expressed as reduced precision.
- FP32 and FP16 are standardized in IEEE-754 format, but the remaining formats, such as INT8 and FP8, are not standardized. Therefore, there are various detailed implementations depending on the developer. In addition, there are various formats for neural networks, such as BFLOAT16, Flexpoint, and Tensor Float 32.
- Running a model with reduced precision has the advantage of reducing execution time due to reduced computational effort and memory usage. However, it has the disadvantage of reducing accuracy due to information loss caused by using a lower bit width to represent numbers.
- QTT Quantization-Aware Training
- PTQ Post-Training Quantization
- the QAT method can create a model suitable for the target type and produce high accuracy results because the effect of reduced precision is reflected during model learning, but training data is required for learning.
- the PTQ method does not require training data, but it has a problem in that the accuracy performance is low due to the loss that occurs when applying the reduced precision type. Calibration can be performed to solve this problem.
- Calibration is the process of running a model in advance using sample data (calibration set) and checking the statistical distribution of values within the model. Through this process, the values of some of the variables used in the quantization process can be appropriately set.
- Floating-point types are divided into sign, exponent, and mantissa parts.
- the IEEE-754 single-precision floating-point type has 1 sign bit, 8 exponent bits, and 23 mantissa bits.
- Types other than FP32 have different bit configurations for the exponent and mantissa.
- FP16 has 1 sign bit, 5 exponent bits, and 10 mantissa bits.
- the FP8 type recently used in deep learning has no fixed standard.
- the configuration of sign-exponent-mantissa is mainly attempted in various ways such as 1-5-2, 1-4-3, 1-3-4, 1-2-5, etc., and the details may be slightly different depending on the developer.
- the basic form of the formula is the same as the IEEE-754 single-precision floating-point type.
- the dynamic range is controlled by the exponent, and the precision is controlled by the mantissa.
- the precision is controlled by the mantissa.
- 7 bits are used for precision if the sign is expressed, and 8 bits are used if the sign is not expressed, while FP8 uses fewer bits for precision.
- FP quantization increases the quantization error as the number increases.
- the present invention has been made in consideration of these points, and aims to provide a quantization method capable of improving the decrease in accuracy that occurs when general quantization is applied.
- Another object of the present invention is to provide a quantization method which can significantly reduce the amount of computation, memory usage and power consumption when using reduced precision.
- the quantization device of the present invention outputs a reduced-precision floating-point deep learning model from an input model.
- the quantization device according to a preferred embodiment of the present invention comprises a target layer detection unit that detects a target layer from an input model, a channel detection unit that detects a problematic channel for the layer detected by the target layer detection unit, and a quantization unit that selects weights to which a predetermined quantization method is to be applied for the channel detected by the channel detection unit, and applies the predetermined quantization method to the selected weights.
- the target layer detection unit detects a depth-based convolution or a convolution having a predetermined number or less of input channels as a target layer.
- the channel detection unit calculates a predetermined metric for each channel of the target layer, and determines that the channel is problematic if the metric satisfies a predetermined condition.
- the predetermined condition one of the following may be used: the calculated metric being equal to or greater than a predetermined threshold value; or the calculated metric being equal to or greater than a certain upper percentage when sorted by size.
- the metric is defined to indicate how widely the weights are distributed or the sizes of the weights.
- the metric may use any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights per channel, the maximum value of weights per channel, and the square of the maximum value of weights per channel.
- the quantization unit may select weights to which the predetermined quantization method is to be applied by using any one of a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel.
- the predetermined quantization method may be any one of a first quantization method (Rounding Away From Zero) that selects a value far from 0, a second quantization method (Rounding Towards Zero) that selects a value close to 0, and a method of selecting a combination in which the sum of squares of quantization errors for the entire target weight is minimized when both the first quantization method and the second quantization method are applied.
- a quantization method is a quantization method for outputting a reduced-precision floating-point deep learning model from an input model, comprising: a target layer detection step for detecting a target layer in an input model; a channel detection step for detecting a problematic channel for the layer detected by the target layer detection unit; and a quantization step for selecting weights to which a predetermined quantization method is to be applied for the channel detected by the channel detection unit, and applying the predetermined quantization method to the selected weights.
- a depth-based convolution or a convolution having a predetermined number or less of input channels is detected as the target layer.
- the channel detection step calculates a predetermined metric for each channel of the target layer, and determines that the channel is problematic if the metric satisfies a predetermined condition.
- the predetermined condition may be one of the following: that the calculated metric is equal to or greater than a predetermined threshold value, or that the calculated metric is equal to or greater than a certain upper percentage when sorted by size.
- the metric any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights per channel, the maximum value of weights per channel, and the square of the maximum value of weights per channel may be used.
- the quantization step may select weights to which the predetermined quantization method is to be applied by using any one of a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel.
- the predetermined quantization method may be any one of a first quantization method (Rounding Away From Zero) that selects a value far from 0, a second quantization method (Rounding Towards Zero) that selects a value close to 0, and a method of selecting a combination in which the sum of squares of quantization errors for the entire target weight is minimized when both the first quantization method and the second quantization method are applied.
- the present invention by finding a channel that is problematic in a depth-based convolution operation and then using a quantization method according to the present invention, it is possible to significantly recover the accuracy degradation that occurs when applying general quantization.
- the accuracy degradation can be recovered.
- FIG. 1 is a block diagram showing the configuration of a low-precision floating-point friendly quantization device according to a preferred embodiment of the present invention.
- FIG. 2 is a flowchart showing the operation flow of a low-precision floating-point friendly quantization method according to a preferred embodiment of the present invention.
- Figure 3 is a diagram explaining an example of selecting weights according to index values.
- Figure 4 is a diagram illustrating several examples of quantization methods.
- symbols such as first, second, i), ii), a), b), etc. may be used. These symbols are only for distinguishing the components from other components, and the nature, order, or sequence of the corresponding components are not limited by the symbols.
- a part in the specification is said to 'include' or 'provide' a component, this does not mean that other components are excluded, but rather that other components can be further included, unless explicitly stated to the contrary.
- terms such as 'part' and 'module' described in the specification mean a unit that processes at least one function or operation, and this can be implemented by hardware, software, or a combination of hardware and software.
- reduced precision floating point can have various bit widths, such as FP8, FP10, FP6, and FP4.
- FP16 is considered to have a precision close to FP32 and is not considered reduced precision.
- all floating point data types less than 16 bits can be considered reduced precision.
- Figure 1 is a block diagram showing the configuration of a low-precision floating-point friendly quantization device according to a preferred embodiment of the present invention.
- a deep learning model developed with high precision can be input to the floating-point friendly quantization device.
- an FP16 or FP32 deep learning model can be input.
- a floating-point friendly quantization device comprises a target layer detection unit (110), a channel detection unit (120), and a quantization unit (130).
- the target layer detection unit (110) detects a target operation or layer in the input model.
- the target layer detection unit (110) can detect a depth-based convolution or a convolution with a small input channel.
- the channel detection unit (120) detects a problematic channel for the operation (layer) detected by the target layer detection unit (110). In one embodiment, the channel detection unit (120) calculates a predetermined metric for each channel of the target layer and finds a case where the metric is large. In order to detect a problematic channel, it is preferable to measure the metric for each channel. As the metric, any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights for each channel, the maximum value of weights for each channel, and the square of the maximum value of weights for each channel can be used.
- the quantization unit (130) applies the proposed quantization method to the channel detected by the channel detection unit (120).
- the quantization unit (130) quantizes in a different way from the existing RTN (Rounding to nearest) method that quantizes to the nearest value.
- the quantization unit (130) selects weights to which the different quantization method is applied in order to reduce errors in a channel that generates many quantization errors, and applies the different quantization method to the selected weights.
- Various methods may be used as weight selection methods, such as a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel.
- RAFZ Rounding Away From Zero
- RTZ Rounding Towards Zero
- Figure 2 is a flow chart showing the operation flow of a low-precision floating-point friendly quantization method according to a preferred embodiment of the present invention.
- a deep learning model developed with high precision can be input to a floating-point friendly quantization device.
- a floating-point friendly quantization device For example, an FP16 or FP32 deep learning model can be input.
- a floating-point friendly quantization device detects a target operation or layer from an input model (step S110).
- a problematic channel is detected for the detected operation (layer) (step S120).
- a proposed quantization method is applied to the detected channel (step S130). Through this process, a reduced-precision floating-point deep learning model is output. In other words, the same model using a bit-width smaller than the precision of the input model is output.
- the criteria for whether the input channels are small can be set by the user. Preferably, it can be determined that the number of input channels is small if it is 3 or less, but it is not limited to this value. It is also possible to target convolutions with larger input channels, in which case additional operations may be required. Although the performance (accuracy) after applying the method of the present invention does not deteriorate further, it is not guaranteed that the performance will be improved even if the method of the present invention is applied when the input channels are large.
- a predetermined metric is calculated for each channel of the target layer and the case where this metric is large is found.
- the predetermined metric should be a metric that can represent the wide distribution of the weights among the input tensor and the weights, which are the operation inputs, or the size of the values. In order to detect the problematic channel, the metric is measured for each channel.
- W_FP32 represents a weight expressed in the FP32 type
- W_target_type represents a weight expressed in the target type, for example, the FP8 type.
- the metrics are described based on two dimensions, and accordingly, two letters i and j are used. In other embodiments, the metrics can be applied to one dimension or three dimensions. In one-dimensional metrics, only the letter i is used, and in three-dimensional metrics, three letters, i, j, and k, are used.
- the mean squared error of the weight quantization error can be used as a metric.
- the sum of weighted quantization errors expressed as in mathematical expression 2 can be used as a metric.
- the variance of channel-specific weights can be used as a metric.
- the maximum value of the channel-specific weights expressed as in mathematical expression 4 can be used as a metric.
- the square of the maximum value of the channel-specific weights can be used as a metric.
- a metric being "large” can be judged as being greater than some arbitrary threshold value obtained experimentally, or as being in the upper range when the metrics are sorted by size.
- a “top range” can be defined as being greater than a certain percentage, such as the top 10%.
- the threshold value or the lower the ratio value the more target channels there are, and the higher the possibility of recovering accuracy.
- the execution overhead execution time of the result model, complexity of applying the new method, etc.
- the accuracy degradation will not be recovered indefinitely. Therefore, it is desirable to select an appropriate value.
- the target channel has k2 weights, and among these weights, weights to which a new quantization method is to be applied are selected, and the new quantization method is applied to the selected weights. Meanwhile, in n-dimensional convolution and deconvolution, the number of weights can be k n .
- the target weight can be specified in various ways as follows.
- the quantization error can be defined as the value obtained by subtracting the value when converted to the target type from the value of W_FP32. In one embodiment, if the two with the largest absolute values of quantization errors are selected, one positive weight and one negative weight can be selected.
- the weight with the largest exponent is selected. That is, when the weights are converted to the target type, all weights with the largest exponent among sign-exponent-decimal are selected.
- a large exponent means that the size of the corresponding weight is large.
- the largest and second largest exponents can be selected.
- FIG. 3 illustrates an example of selecting weights according to exponent values.
- Method 2-1 is for selecting the largest exponent value
- Method 2-2 is for selecting the largest and second largest exponent values.
- weights 4 and 6, which have the largest exponent value of "1100” are selected
- weights 4 and 6, which have the largest exponent value of "1100” and weights 7 and 9, which have the second largest exponent value of "1011" are selected.
- the accuracy was compared when the existing FP32 format was quantized to NF8 format and when the method of the present invention was applied to the entire depth-wise convolution.
- the existing method quantized to NF8 format recorded an accuracy of 81% compared to the FP32 format
- the present method quantized to NF8 format recorded an accuracy of 94% compared to the FP32 format.
- the existing method quantized to NF8 format recorded an accuracy of 91% compared to the FP32 format
- the present method quantized to NF8 format recorded an accuracy of 97% compared to the FP32 format.
- Each component of the device or method according to the present invention may be implemented as hardware or software, or as a combination of hardware and software.
- the function of each component may be implemented as software, and a microprocessor may be implemented to execute the function of the software corresponding to each component.
- Various implementations of the systems and techniques described herein can be implemented as digital electronic circuits, integrated circuits, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include implementations of one or more computer programs executable on a programmable system.
- the programmable system includes at least one programmable processor (which may be a special purpose processor or a general purpose processor) coupled to receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
- Computer programs also known as programs, software, software applications, or code
- a computer-readable recording medium includes any type of recording device that stores data that can be read by a computer system.
- a computer-readable recording medium can be a non-volatile or non-transitory medium, such as a ROM, a CD-ROM, a magnetic tape, a floppy disk, a memory card, a hard disk, a magneto-optical disk, a storage device, and may further include a transitory medium, such as a data transmission medium.
- the computer-readable recording medium can be distributed over a network-connected computer system, so that the computer-readable code can be stored and executed in a distributed manner.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Mathematical Optimization (AREA)
- Software Systems (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Analysis (AREA)
- Computational Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Health & Medical Sciences (AREA)
- Nonlinear Science (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
본 발명은 저정밀도 부동소수점 친화적인 양자화 방법 및 장치에 관한 것이다.The present invention relates to a low-precision floating-point friendly quantization method and device.
CNN(Convolutional Neural Network)에서는 입력층과 출력층 사이에 복수의 합성곱층(Convolutional Layers)과 복수의 전결합층(Fully Connected Layers)를 구비할 수 있다. CNN을 사용하여 이미지를 처리하는 경우에, 하나의 합성곱 계층에는 입력되는 이미지의 채널 개수만큼 필터가 존재할 수 있으며, 각 채널에 할당된 필터를 적용함으로써 합성곱 계층의 출력 이미지가 생성된다. 예를 들어 4x4x1인 텐서 형태의 입력 이미지에 대해 3x3 크기의 필터를 적용하는 합성곱 계층에서는 이미지와 필터에 대한 합성곱(convolution) 연산을 통해 2x2x1 텐서(tensor) 형태의 이미지가 생성된다. 필터를 구성하는 가중치를 표현하는 포맷으로는 FP32가 일반적으로 사용되고 있지만 많은 연산량과 메모리 자원이 필요하다. In a CNN (Convolutional Neural Network), multiple convolutional layers and multiple fully connected layers can be provided between the input layer and the output layer. When processing an image using a CNN, one convolutional layer can have as many filters as the number of channels of the input image, and the output image of the convolutional layer is generated by applying the filter assigned to each channel. For example, in a convolutional layer that applies a 3x3 sized filter to a 4x4x1 tensor-shaped input image, a 2x2x1 tensor-shaped image is generated through a convolution operation on the image and the filter. FP32 is generally used as a format for expressing the weights that constitute the filter, but it requires a lot of computational power and memory resources.
따라서 신경망을 효율적으로 실행시키기 위하여 양자화(quantization)를 실행하는 경우가 많다. 네트워크의 가중치(weight)와 활성화(activation)가 양자화 대상이 될 수 있다. 양자화를 실행하여 가장 일반적으로 사용되는 기본 포맷인 FP32보다 더 낮은 비트의 데이터 타입으로 변환할 수 있다.Therefore, in order to efficiently execute neural networks, quantization is often performed. The weights and activations of the network can be quantized. Quantization can be performed to convert them into a data type with a lower bit rate than the most commonly used basic format, FP32.
변환되는 타입은 고정소수점 포맷으로는 예를 들면 INT16, INT8, INT4가 있고 부동소수점 포맷으로는 예를 들면 FP16, FP8 타입이 있다. 디폴트로 사용되는 FP32보다 더 낮은 비트 폭을 사용하기 때문에 감축된 정밀도(reduced precision)라고 표현하기도 한다.The types being converted include fixed-point formats such as INT16, INT8, and INT4, and floating-point formats such as FP16 and FP8. Because they use a lower bit width than the default FP32, they are also expressed as reduced precision.
FP32와 FP16은 IEEE-754 포맷으로 규격이 정해져 있으나, INT8, FP8 등 나머지 포맷들은 규격이 정해져 있지 않다. 따라서 개발 주체에 따라 세부적으로 다양한 구현이 존재한다. 또한 BFLOAT16, Flexpoint, Tensor Float 32 등과 같이 신경망을 위한 다양한 포맷들이 존재한다.FP32 and FP16 are standardized in IEEE-754 format, but the remaining formats, such as INT8 and FP8, are not standardized. Therefore, there are various detailed implementations depending on the developer. In addition, there are various formats for neural networks, such as BFLOAT16, Flexpoint, and Tensor Float 32.
감축된 정밀도로 모델을 실행하면 연산량, 메모리 사용량 등이 감소하여 실행시간이 줄어드는 장점이 있다. 하지만 숫자를 표현할 때 더 낮은 비트 폭을 사용하기 때문에 정보 손실이 발생하여 정확도가 떨어지는 단점이 있다.Running a model with reduced precision has the advantage of reducing execution time due to reduced computational effort and memory usage. However, it has the disadvantage of reducing accuracy due to information loss caused by using a lower bit width to represent numbers.
양자화를 적용하여 모델을 만드는 방법은 크게 두가지가 있다. 모델 학습시에 감축된 정밀도의 효과를 반영해 학습하는 양자화 인식 학습(Quantization-Aware Training, "QAT") 방식과, FP32로 미리 학습된 모델을 감축된 정밀도로 변환하는 학습후 양자화(Post-Training Quantization, "PTQ") 방식이 있다. There are two main ways to create a model by applying quantization. There is the Quantization-Aware Training (QAT) method, which learns by reflecting the effect of reduced precision during model training, and the Post-Training Quantization (PTQ) method, which converts a model pre-trained in FP32 to reduced precision.
QAT 방식은 모델 학습시에 감축된 정밀도의 효과가 반영되기 때문에 목표로 하는 타입에 적합한 모델이 만들어질 수 있고 정확도 결과가 높게 나오지만 학습을 위한 훈련 데이터가 필요하다. The QAT method can create a model suitable for the target type and produce high accuracy results because the effect of reduced precision is reflected during model learning, but training data is required for learning.
PTQ 방식은 훈련 데이터가 필요하지 않지만 감축된 정밀도 타입을 적용하게 되면서 발생한 손실로 인해 정확도 성능이 낮게 나오는 문제가 있다. 이러한 문제를 해결하기 위해 캘리브레이션을 수행할 수 있다. The PTQ method does not require training data, but it has a problem in that the accuracy performance is low due to the loss that occurs when applying the reduced precision type. Calibration can be performed to solve this problem.
캘리브레이션은 샘플 데이터(캘리브레이션 세트)를 이용해 미리 모델을 실행시켜보고 모델 내부의 값들에 대한 통계적인 분포를 확인하는 과정이다. 이 과정을 통해 양자화 과정에서 사용되는 변수 중 일부의 값을 적절히 설정할 수 있다.Calibration is the process of running a model in advance using sample data (calibration set) and checking the statistical distribution of values within the model. Through this process, the values of some of the variables used in the quantization process can be appropriately set.
부동소수점 타입은 부호(sign), 지수(exponent), 가수(mantissa) 부분으로 나뉘어진다. 예를 들면, IEEE-754 단일-정밀도 부동소수점(Single-Precision Floating-Point) 타입은 부호 1 비트, 지수 8 비트, 가수 23 비트를 가진다. FP32가 아닌 다른 타입들은 지수, 가수의 비트 구성이 달라진다. 예를 들면 FP16은 부호 1비트, 지수 5 비트, 가수 10 비트이다.Floating-point types are divided into sign, exponent, and mantissa parts. For example, the IEEE-754 single-precision floating-point type has 1 sign bit, 8 exponent bits, and 23 mantissa bits. Types other than FP32 have different bit configurations for the exponent and mantissa. For example, FP16 has 1 sign bit, 5 exponent bits, and 10 mantissa bits.
딥러닝에서 최근 사용되는 FP8 타입은 정해진 규격이 없다. 부호-지수-가수의 구성은 주로 1-5-2, 1-4-3, 1-3-4, 1-2-5 등이 다양하게 시도되고 있으며 개발 주체에 따라 세부 사항은 조금씩 다를 수 있다. 하지만 수식의 기본 형태는 IEEE-754 단일-정밀도 부동소수점 타입과 동일하다.The FP8 type recently used in deep learning has no fixed standard. The configuration of sign-exponent-mantissa is mainly attempted in various ways such as 1-5-2, 1-4-3, 1-3-4, 1-2-5, etc., and the details may be slightly different depending on the developer. However, the basic form of the formula is the same as the IEEE-754 single-precision floating-point type.
즉, 지수로 다이나믹 레인지를 조절하고 가수로 정밀도를 조절한다. INT8 타입의 경우 부호(sign)를 표현한다면 7비트, 부호를 표현하지 않는다면 8 비트를 정밀도에 사용하는 반면에, FP8은 정밀도에 더 적은 비트를 사용한다. FP 양자화는 숫자가 클수록 양자화 에러가 증가한다.That is, the dynamic range is controlled by the exponent, and the precision is controlled by the mantissa. In the case of the INT8 type, 7 bits are used for precision if the sign is expressed, and 8 bits are used if the sign is not expressed, while FP8 uses fewer bits for precision. FP quantization increases the quantization error as the number increases.
신경망의 동작 중에는 깊이별 합성곱(depthwise convolution) 연산이 있다. 이 연산은 MobileNet 류와 EfficientNet 류의 널리 알려진 네트워크의 핵심 요소이며 기타 다른 네트워크에도 널리 사용되는 연산이다. 깊이별 합성곱은 입력 채널에 독립적인 연산을 하는 합성곱 연산인데, 이 연산은 일반적인 합성곱과 달리 입력 채널에 대해서는 값을 누적(accumulation) 하지 않는다. 즉, 깊이별 합성곱의 필터 크기만큼의 요소들에 대해 연산을 수행한다. 예를 들어 필터의 크기가 3인 2차원(2-dimensional) 깊이별 합성곱 연산(Pytorch: DWConv2D(k=3))이라면 입력 텐서의 3*3 영역과 필터의 3*3 영역에 대한 행렬 곱 및 누적(matrix multiply and accumulation) 연산을 수행한다.Among the operations of neural networks, there is a depthwise convolution operation. This operation is a core element of well-known networks such as MobileNet and EfficientNet, and is also widely used in other networks. Depthwise convolution is a convolution operation that performs operations independent of the input channel. Unlike general convolution, this operation does not accumulate values for the input channels. In other words, it performs operations on elements as large as the filter size of the depthwise convolution. For example, if it is a 2-dimensional depthwise convolution operation (Pytorch: DWConv2D (k = 3)) with a filter size of 3, it performs matrix multiply and accumulation operations on the 3 * 3 region of the input tensor and the 3 * 3 region of the filter.
그런데, 깊이별 합성곱 연산은 감축된 정밀도 부동소수점 연산을 적용했을 때 정확도 저하가 큰 편이다. 일반적인 합성곱의 경우에도, 입력 채널이 작아 연산이 되는 요소(element)의 개수가 작다면 감축된 정밀도 부동소수점 타입(예: FP8)을 사용할 때 에러가 크게 발생해 정확도 저하가 발생할 수 있다.However, depth-wise convolution operations tend to have a large decrease in accuracy when applying reduced-precision floating-point operations. Even in the case of general convolution, if the input channels are small and the number of elements to be operated is small, errors may occur significantly when using reduced-precision floating-point types (e.g. FP8), resulting in a decrease in accuracy.
본 발명은 이러한 점을 감안하여 이루어진 것으로서, 일반적인 양자화를 적용했을 때 발생하는 정확도 저하를 개선할 수 있는 양자화 방법을 제공하는 것을 목적으로 한다.The present invention has been made in consideration of these points, and aims to provide a quantization method capable of improving the decrease in accuracy that occurs when general quantization is applied.
본 발명의 다른 목적은 감축된 정밀도를 사용하는 경우 연산량, 메모리 사용량 및 전력 소모를 대폭 줄일 수 있는 양자화 방법을 제공하는 것이다.Another object of the present invention is to provide a quantization method which can significantly reduce the amount of computation, memory usage and power consumption when using reduced precision.
본 발명의 양자화 장치는 입력 모델로부터 감축된 정밀도 부동소수점 심층학습 모델을 출력한다. 본 발명의 바람직한 실시예에 따른 양자화 장치는, 입력 모델에서 대상이 되는 레이어를 검출하는 대상 레이어 검출부, 상기 대상 레이어 검출부에서 검출된 레이어에 대해서 문제가 되는 채널을 검출하는 채널검출부, 및 상기 채널검출부에서 검출된 채널에 대해서 소정의 양자화 방법을 적용할 가중치들을 선택하고, 선택된 가중치들에 대해 상기 소정의 양자화 방법을 적용하는 양자화부를 구비한다. The quantization device of the present invention outputs a reduced-precision floating-point deep learning model from an input model. The quantization device according to a preferred embodiment of the present invention comprises a target layer detection unit that detects a target layer from an input model, a channel detection unit that detects a problematic channel for the layer detected by the target layer detection unit, and a quantization unit that selects weights to which a predetermined quantization method is to be applied for the channel detected by the channel detection unit, and applies the predetermined quantization method to the selected weights.
일 실시예에서, 상기 대상 레이어 검출부는 깊이별 합성곱 또는 입력 채널수가 소정 수 이하인 합성곱을 대상 레이어로 검출한다. 일 실시예에서 상기 채널검출부는, 대상 레이어의 채널 별로 소정의 메트릭을 계산하여 이 메트릭이 소정의 조건을 만족하는 경우에 문제가 되는 채널이라고 판단할 수 있다. 상기 소정의 조건으로는, 상기 계산된 메트릭이 소정의 임계 값 이상인 것 또는 상기 계산된 메트릭이 크기별로 정렬했을 때의 상위 일정 비율 이상인 것 중의 하나를 사용할 수 있다. 상기 메트릭은 가중치들이 얼마나 넓게 분포하는지 또는 가중치들의 크기를 나타내도록 정의된다. 일 실시예에서, 상기 메트릭은 가중치 양자화 에러(Weight Quantization error)의 평균제곱오차, 가중치 양자화 에러의 합, 채널 별 가중치의 분산(variance), 채널 별 가중치의 최대값, 채널 별 가중치의 최대값의 제곱 중의 어느 하나를 사용할 수 있다. In one embodiment, the target layer detection unit detects a depth-based convolution or a convolution having a predetermined number or less of input channels as a target layer. In one embodiment, the channel detection unit calculates a predetermined metric for each channel of the target layer, and determines that the channel is problematic if the metric satisfies a predetermined condition. As the predetermined condition, one of the following may be used: the calculated metric being equal to or greater than a predetermined threshold value; or the calculated metric being equal to or greater than a certain upper percentage when sorted by size. The metric is defined to indicate how widely the weights are distributed or the sizes of the weights. In one embodiment, the metric may use any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights per channel, the maximum value of weights per channel, and the square of the maximum value of weights per channel.
일 실시예에서 상기 양자화부는, 해당 채널에서 양자화 에러의 절대값이 가장 큰 소정 개수의 가중치를 선택하는 방법, 지수 값이 가장 큰 가중치를 선택하는 방법, 해당 채널의 가중치 전체를 선택하는 방법 중의 어느 하나의 방법을 사용하여 상기 소정의 양자화 방법을 적용할 가중치들을 선택할 수 있다. In one embodiment, the quantization unit may select weights to which the predetermined quantization method is to be applied by using any one of a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel.
일 실시예에서 상기 소정의 양자화 방법으로는, 0에서 먼 값을 선택하는 제1 양자화 방법(Rounding Away From Zero), 0에 가까운 값을 선택하는 제2 양자화 방법(Rounding Towards Zero), 상기 제1 양자화 방법과 상기 제2 양자화 방법을 모두 적용해보았을 때 대상 가중치 전체에 대한 양자화 에러의 제곱의 합이 최소가 되는 조합을 선택하는 방법 중의 어느 하나를 사용할 수 있다. In one embodiment, the predetermined quantization method may be any one of a first quantization method (Rounding Away From Zero) that selects a value far from 0, a second quantization method (Rounding Towards Zero) that selects a value close to 0, and a method of selecting a combination in which the sum of squares of quantization errors for the entire target weight is minimized when both the first quantization method and the second quantization method are applied.
본 발명의 바람직한 실시예에 따른 양자화 방법은, 입력 모델로부터 감축된 정밀도 부동소수점 심층학습 모델을 출력하는 양자화 방법으로서, 입력 모델에서 대상이 되는 레이어를 검출하는 대상 레이어 검출단계, 상기 대상 레이어 검출부에서 검출된 레이어에 대해서 문제가 되는 채널을 검출하는 채널검출단계, 및 상기 채널검출부에서 검출된 채널에 대해서 소정의 양자화 방법을 적용할 가중치들을 선택하고, 선택된 가중치들에 대해 상기 소정의 양자화 방법을 적용하는 양자화 단계를 구비한다. A quantization method according to a preferred embodiment of the present invention is a quantization method for outputting a reduced-precision floating-point deep learning model from an input model, comprising: a target layer detection step for detecting a target layer in an input model; a channel detection step for detecting a problematic channel for the layer detected by the target layer detection unit; and a quantization step for selecting weights to which a predetermined quantization method is to be applied for the channel detected by the channel detection unit, and applying the predetermined quantization method to the selected weights.
일 실시예에서, 상기 대상 레이어 검출단계에서 깊이별 합성곱 또는 입력 채널수가 소정 수 이하인 합성곱을 대상 레이어로 검출한다.In one embodiment, in the target layer detection step, a depth-based convolution or a convolution having a predetermined number or less of input channels is detected as the target layer.
일 실시예에서, 상기 채널검출단계는, 대상 레이어의 채널 별로 소정의 메트릭을 계산하여 이 메트릭이 소정의 조건을 만족하는 경우에 문제가 되는 채널이라고 판단한다. 상기 소정의 조건은, 상기 계산된 메트릭이 소정의 임계 값 이상인 것 또는 상기 계산된 메트릭이 크기별로 정렬했을 때의 상위 일정 비율 이상인 것 중의 하나일 수 있다. 상기 메트릭으로는, 가중치 양자화 에러(Weight Quantization error)의 평균제곱오차, 가중치 양자화 에러의 합, 채널 별 가중치의 분산(variance), 채널 별 가중치의 최대값, 채널 별 가중치의 최대값의 제곱 중의 어느 하나를 사용할 수 있다. In one embodiment, the channel detection step calculates a predetermined metric for each channel of the target layer, and determines that the channel is problematic if the metric satisfies a predetermined condition. The predetermined condition may be one of the following: that the calculated metric is equal to or greater than a predetermined threshold value, or that the calculated metric is equal to or greater than a certain upper percentage when sorted by size. As the metric, any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights per channel, the maximum value of weights per channel, and the square of the maximum value of weights per channel may be used.
일 실시예에서 상기 양자화 단계는, 해당 채널에서 양자화 에러의 절대값이 가장 큰 소정 개수의 가중치를 선택하는 방법, 지수 값이 가장 큰 가중치를 선택하는 방법, 해당 채널의 가중치 전체를 선택하는 방법 중의 어느 하나의 방법을 사용하여 상기 소정의 양자화 방법을 적용할 가중치들을 선택할 수 있다.In one embodiment, the quantization step may select weights to which the predetermined quantization method is to be applied by using any one of a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel.
일 실시예에서 상기 소정의 양자화 방법으로는, 0에서 먼 값을 선택하는 제1 양자화 방법(Rounding Away From Zero), 0에 가까운 값을 선택하는 제2 양자화 방법(Rounding Towards Zero), 상기 제1 양자화 방법과 상기 제2 양자화 방법을 모두 적용해보았을 때 대상 가중치 전체에 대한 양자화 에러의 제곱의 합이 최소가 되는 조합을 선택하는 방법 중의 어느 하나를 사용할 수 있다.In one embodiment, the predetermined quantization method may be any one of a first quantization method (Rounding Away From Zero) that selects a value far from 0, a second quantization method (Rounding Towards Zero) that selects a value close to 0, and a method of selecting a combination in which the sum of squares of quantization errors for the entire target weight is minimized when both the first quantization method and the second quantization method are applied.
본 발명의 일 실시예에 따르면, 깊이별 합성곱 연산에 문제가 되는 채널을 찾은 뒤에 본 발명에 따른 양자화 방법을 사용함으로써 일반적인 양자화를 적용했을 때 발생하는 정확도 저하를 많이 회복할 수 있다. According to one embodiment of the present invention, by finding a channel that is problematic in a depth-based convolution operation and then using a quantization method according to the present invention, it is possible to significantly recover the accuracy degradation that occurs when applying general quantization.
본 발명의 일 실시예에 따르면, 감축된 정밀도를 사용하는 경우 연산량, 메모리 사용량 및 전력 소모를 줄일 수 있다. According to one embodiment of the present invention, when using reduced precision, computational amount, memory usage and power consumption can be reduced.
본 발명의 일 실시예에 따르면, 일반적인 합성곱의 경우에 입력 채널이 작아 연산이 되는 요소의 개수가 작아도 정확도 저하를 회복할 수 있다.According to one embodiment of the present invention, in the case of general convolution, even if the input channel is small and the number of elements to be operated is small, the accuracy degradation can be recovered.
도 1은 본 발명의 바람직한 실시예에 따른 저정밀도 부동소수점 친화적인 양자화 장치의 구성을 보여주는 블록도이다.FIG. 1 is a block diagram showing the configuration of a low-precision floating-point friendly quantization device according to a preferred embodiment of the present invention.
도 2는 본 발명의 바람직한 실시예에 따른 저정밀도 부동소수점 친화적인 양자화 방법의 동작 흐름을 보여주는 흐름도이다.FIG. 2 is a flowchart showing the operation flow of a low-precision floating-point friendly quantization method according to a preferred embodiment of the present invention.
도 3은 지수 값에 따라 가중치를 선택하는 예를 설명하기 위한 도면이다.Figure 3 is a diagram explaining an example of selecting weights according to index values.
도 4는 양자화 방법의 몇가지 예를 설명하기 위한 도면이다.Figure 4 is a diagram illustrating several examples of quantization methods.
이하, 본 개시의 일부 실시예들을 예시적인 도면을 이용해 상세하게 설명한다. 각 도면의 구성 요소들에 참조 부호를 부가함에 있어서, 동일한 구성 요소들에 대해서는 비록 다른 도면 상에 표시되더라도 가능한 한 동일한 부호를 가지도록 하고 있음에 유의해야 한다. 또한, 본 개시를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 개시의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.Hereinafter, some embodiments of the present disclosure will be described in detail using exemplary drawings. When adding reference numerals to components of each drawing, it should be noted that the same numerals are used for identical components as much as possible even if they are shown in different drawings. In addition, when describing the present disclosure, if it is determined that a specific description of a related known configuration or function may obscure the gist of the present disclosure, the detailed description thereof will be omitted.
본 개시에 따른 실시예의 구성요소를 설명하는 데 있어서, 제1, 제2, i), ii), a), b) 등의 부호를 사용할 수 있다. 이러한 부호는 그 구성요소를 다른 구성 요소와 구별하기 위한 것일 뿐, 그 부호에 의해 해당 구성요소의 본질 또는 차례나 순서 등이 한정되지 않는다. 명세서에서 어떤 부분이 어떤 구성요소를 '포함' 또는 '구비'한다고 할 때, 이는 명시적으로 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한 명세서에 기재된 '부', '모듈' 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다.In describing components of embodiments according to the present disclosure, symbols such as first, second, i), ii), a), b), etc. may be used. These symbols are only for distinguishing the components from other components, and the nature, order, or sequence of the corresponding components are not limited by the symbols. When a part in the specification is said to 'include' or 'provide' a component, this does not mean that other components are excluded, but rather that other components can be further included, unless explicitly stated to the contrary. In addition, terms such as 'part' and 'module' described in the specification mean a unit that processes at least one function or operation, and this can be implemented by hardware, software, or a combination of hardware and software.
첨부된 도면과 함께 이하에 개시될 발명의 설명은 본 발명의 예시적인 실시 형태를 설명하고자 하는 것이며, 본 발명이 실시될 수 있는 유일한 실시 형태를 나타내고자 하는 것이 아니다.The following description of the invention, together with the accompanying drawings, is intended to explain exemplary embodiments of the invention and is not intended to represent the only embodiments in which the invention may be practiced.
이하의 설명에서는 편의를 위해 FP8을 기준으로 작성되었지만, 감축된 정밀도 부동소수점에는 FP8 뿐만이 아닌 FP10, FP6, FP4 등 다양한 비트-폭를 가질 수 있다. FP16은 FP32에 가까운 정밀도를 가진 것으로 보고 감축된 정밀도로 간주하지 않는다. 하지만 16 비트 미만의 모든 부동소수점 데이터 타입은 감축된 정밀도로 볼 수 있다.The following description is based on FP8 for convenience, but reduced precision floating point can have various bit widths, such as FP8, FP10, FP6, and FP4. FP16 is considered to have a precision close to FP32 and is not considered reduced precision. However, all floating point data types less than 16 bits can be considered reduced precision.
도 1은 본 발명의 바람직한 실시예에 따른 저정밀도 부동소수점 친화적인 양자화 장치의 구성을 보여주는 블록도이다. 부동소수점 친화적인 양자화 장치에는 고정밀도로 개발된 심층학습 모델이 입력될 수 있다. 예를 들면, FP16 또는 FP32 심층학습 모델이 입력될 수 있다.Figure 1 is a block diagram showing the configuration of a low-precision floating-point friendly quantization device according to a preferred embodiment of the present invention. A deep learning model developed with high precision can be input to the floating-point friendly quantization device. For example, an FP16 or FP32 deep learning model can be input.
본 발명의 일 실시예에 의한 부동소수점 친화적인 양자화 장치는 대상 레이어 검출부(110), 채널검출부(120), 및 양자화부(130)를 구비한다.A floating-point friendly quantization device according to one embodiment of the present invention comprises a target layer detection unit (110), a channel detection unit (120), and a quantization unit (130).
대상 레이어 검출부(110)는 입력 모델에서 대상이 되는 동작(operation) 또는 레이어(layer)을 검출한다. 대상 레이어 검출부(110)는 깊이별 합성곱 또는 입력 채널이 작은 합성곱을 검출할 수 있다. The target layer detection unit (110) detects a target operation or layer in the input model. The target layer detection unit (110) can detect a depth-based convolution or a convolution with a small input channel.
채널검출부(120)는 대상 레이어 검출부(110)에서 검출된 동작(레이어)에 대해서 문제가 되는 채널을 검출한다. 일 실시예에서, 채널검출부(120)는 대상 레이어의 채널 별로 소정의 메트릭을 계산하여 이 메트릭이 큰 경우를 찾는다. 문제가 되는 채널을 검출하기 위해 상기 메트릭은 채널별로 각각 측정하는 것이 바람직하다. 상기 메트릭으로는, 가중치 양자화 에러(Weight Quantization error)의 평균제곱오차, 가중치 양자화 에러의 합, 채널 별 가중치의 분산(variance), 채널 별 가중치의 최대값, 채널 별 가중치의 최대값의 제곱 중의 어느 하나를 사용할 수 있다.The channel detection unit (120) detects a problematic channel for the operation (layer) detected by the target layer detection unit (110). In one embodiment, the channel detection unit (120) calculates a predetermined metric for each channel of the target layer and finds a case where the metric is large. In order to detect a problematic channel, it is preferable to measure the metric for each channel. As the metric, any one of the mean square error of weight quantization error, the sum of weight quantization errors, the variance of weights for each channel, the maximum value of weights for each channel, and the square of the maximum value of weights for each channel can be used.
양자화부(130)는 채널검출부(120)에서 검출된 채널에 대해 제안하는 양자화 방법을 적용한다. 일 실시예에서, 양자화부(130)는 가장 가까운 값으로 양자화 시키는 기존의 RTN(Rounding to nearest) 방식과는 다른 방식으로 양자화한다. 양자화부(130)는 양자화 에러를 많이 발생시키는 채널에 대해 에러를 감소시키기 위하여 상기 다른 양자화 방법을 적용할 가중치들을 선택하고, 선택된 가중치들에 대해 상기 다른 양자화 방법을 적용한다. 가중치 선택 방법으로는, 해당 채널에서 양자화 에러의 절대값이 가장 큰 소정 개수의 가중치를 선택하는 방법, 지수 값이 가장 큰 가중치를 선택하는 방법, 해당 채널의 가중치 전체를 선택하는 방법 등 다양한 방법이 사용될 수 있다. 상기 다른 양자화 방법으로는, 0에서 먼 값을 선택하는 RAFZ(Rounding Away From Zero), 0에 가까운 값을 선택하는 RTZ(Rounding Towards Zero), RAFZ와 RTZ를 모두 적용해보았을 때 대상 가중치 전체에 대한 양자화 에러의 제곱의 합이 최소가 되는 조합을 선택하는 방법 등을 사용할 수 있다.The quantization unit (130) applies the proposed quantization method to the channel detected by the channel detection unit (120). In one embodiment, the quantization unit (130) quantizes in a different way from the existing RTN (Rounding to nearest) method that quantizes to the nearest value. The quantization unit (130) selects weights to which the different quantization method is applied in order to reduce errors in a channel that generates many quantization errors, and applies the different quantization method to the selected weights. Various methods may be used as weight selection methods, such as a method of selecting a predetermined number of weights having the largest absolute value of quantization error in the corresponding channel, a method of selecting a weight having the largest exponent value, and a method of selecting all of the weights of the corresponding channel. Other quantization methods that can be used include Rounding Away From Zero (RAFZ) that selects values far from 0, Rounding Towards Zero (RTZ) that selects values close to 0, and a method that selects a combination that minimizes the sum of squares of quantization errors for all target weights when applying both RAFZ and RTZ.
이러한 과정을 거쳐서 감축된 정밀도 부동소수점 심층학습 모델이 출력된다. 즉, 입력 모델의 정밀도보다 적은 비트-폭를 사용하는 동일 모델이 출력된다.Through this process, a reduced-precision floating-point deep learning model is output. That is, the same model that uses a bit-width smaller than the precision of the input model is output.
도 2는 본 발명의 바람직한 실시예에 따른 저정밀도 부동소수점 친화적인 양자화 방법의 동작 흐름을 보여주는 흐름도이다. 부동소수점 친화적인 양자화 장치에는 고정밀도로 개발된 심층학습 모델이 입력될 수 있다. 예를 들면, FP16 또는 FP32 심층학습 모델이 입력될 수 있다.Figure 2 is a flow chart showing the operation flow of a low-precision floating-point friendly quantization method according to a preferred embodiment of the present invention. A deep learning model developed with high precision can be input to a floating-point friendly quantization device. For example, an FP16 or FP32 deep learning model can be input.
부동소수점 친화적인 양자화 장치는 입력 모델에서 대상이 되는 동작(operation) 또는 레이어(layer)을 검출한다(단계 S110). 검출된 동작(레이어)에 대해서 문제가 되는 채널을 검출한다(단계 S120). 검출된 채널에 대해 제안하는 양자화 방법을 적용한다(단계 S130). 이러한 과정을 거쳐서 감축된 정밀도 부동소수점 심층학습 모델이 출력된다. 즉, 입력 모델의 정밀도보다 적은 비트-폭를 사용하는 동일 모델이 출력된다.A floating-point friendly quantization device detects a target operation or layer from an input model (step S110). A problematic channel is detected for the detected operation (layer) (step S120). A proposed quantization method is applied to the detected channel (step S130). Through this process, a reduced-precision floating-point deep learning model is output. In other words, the same model using a bit-width smaller than the precision of the input model is output.
이하에서 각 동작 단계에 대해서 상세히 설명한다.Each operation step is described in detail below.
1. 대상 동작 검출 (단계 S110)1. Target motion detection (step S110)
깊이별 합성곱 또는 입력 채널이 작은 합성곱을 검출한다. 입력 채널이 작은지에 대한 기준은 사용자가 정할 수 있다. 바람직하게는 입력 채널 수가 3 이하이면 작다고 판단할 수 있지만, 이 값에 한정되는 것은 아니다. 입력 채널이 더 큰 합성곱까지도 대상으로 지정할 수 있는데 이 경우에는 연산이 추가적으로 더 필요할 수 있다. 본 발명의 방법을 적용한 이후의 성능(정확도)이 더 저하되는 것은 아니지만, 입력 채널이 큰 경우에는 본 발명의 방법을 적용하여도 성능이 향상된다고 보장할 수는 없다. Detects depth-based convolutions or convolutions with small input channels. The criteria for whether the input channels are small can be set by the user. Preferably, it can be determined that the number of input channels is small if it is 3 or less, but it is not limited to this value. It is also possible to target convolutions with larger input channels, in which case additional operations may be required. Although the performance (accuracy) after applying the method of the present invention does not deteriorate further, it is not guaranteed that the performance will be improved even if the method of the present invention is applied when the input channels are large.
2. 대상 채널 검출 방법 (단계 S120)2. Target channel detection method (step S120)
대상 레이어의 채널 별로 소정의 메트릭을 계산하여 이 메트릭이 큰 경우를 찾는다. 상기 소정의 메트릭으로는 동작(operation) 입력인 입력 텐서와 가중치 중 가중치의 넓은 분포 또는 그 값의 크기를 나타낼 수 있는 메트릭이어야 한다. 문제가 되는 채널을 검출하기 위해 상기 메트릭은 채널별로 각각 측정한다.A predetermined metric is calculated for each channel of the target layer and the case where this metric is large is found. The predetermined metric should be a metric that can represent the wide distribution of the weights among the input tensor and the weights, which are the operation inputs, or the size of the values. In order to detect the problematic channel, the metric is measured for each channel.
메트릭으로는 예를 들면 다음과 같은 메트릭을 사용할 수 있다. 이하의 식에서 W_FP32는 FP32 타입으로 표현된 가중치를 나타내며, W_target_type은 목적하는 타입, 예를 들면 FP8 타입으로 표현된 가중치를 나타낸다.For example, the following metrics can be used as metrics. In the equation below, W_FP32 represents a weight expressed in the FP32 type, and W_target_type represents a weight expressed in the target type, for example, the FP8 type.
이하에서, 메트릭들은 2차원을 기준으로 설명되며, 이에 따라 2개의 문자 i 및 j가 이용된다. 다른 실시예에서는 1차원 또는 3차원에 메트릭들이 적용될 수 있다. 1차원 메트릭에서 문자 i만 이용되고, 3차원 메트릭에서는 i, j, k 총 3개의 문자들이 사용된다.In the following, the metrics are described based on two dimensions, and accordingly, two letters i and j are used. In other embodiments, the metrics can be applied to one dimension or three dimensions. In one-dimensional metrics, only the letter i is used, and in three-dimensional metrics, three letters, i, j, and k, are used.
< 메트릭1 > <
수학식 1과 같이 표현되는 가중치 양자화 에러(Weight Quantization error)의 평균제곱오차(Mean Squared Error)를 메트릭으로 사용할 수 있다.The mean squared error of the weight quantization error, expressed as
< 메트릭2 > <
수학식 2와 같이 표현되는 가중치 양자화 에러의 합을 메트릭으로 사용할 수 있다.The sum of weighted quantization errors expressed as in
< 메트릭3 > <
수학식 3과 같이 표현되는 채널 별 가중치의 분산(variance)을 메트릭으로 사용할 수 있다.The variance of channel-specific weights, expressed as in
< 메트릭4 > <
수학식 4와 같이 표현되는 채널 별 가중치의 최대값을 메트릭으로 사용할 수 있다.The maximum value of the channel-specific weights expressed as in
< 메트릭5 > <
수학식 5와 같이 표현되는 채널 별 가중치의 최대값의 제곱을 메트릭으로 사용할 수 있다.The square of the maximum value of the channel-specific weights, expressed as in
메트릭이 "크다"는 것은 실험적으로 구한 임의의 임계 값 이상인 것으로 판단할 수도 있고, 메트릭을 크기별로 정렬(sorting) 했을 때의 상위값인지 여부로 판단할 수도 있다. "상위값"이라 함은 예를 들면 상위 10%와 같이 일정 비율(percentage) 이상인 것으로 정할 수 있다.A metric being "large" can be judged as being greater than some arbitrary threshold value obtained experimentally, or as being in the upper range when the metrics are sorted by size. A "top range" can be defined as being greater than a certain percentage, such as the top 10%.
임계 값이 낮을수록, 또는 비율 값이 낮을수록 대상이 되는 채널의 개수가 많아지며 정확도를 회복할 가능성이 높다. 대상 채널에 대해 어떤 해결 방법을 적용하는지에 따라 실행 오버헤드(결과 모델의 실행 시간, 새 방법 적용 복잡도 등)가 달라지므로 무조건 크게 할 수는 없다. 또한 무조건 크게 한다고 해서 정확도 저하가 무한정 회복되는 것도 아니다. 따라서 적절한 값을 선택하는 것이 바람직하다.The lower the threshold value or the lower the ratio value, the more target channels there are, and the higher the possibility of recovering accuracy. Depending on which solution method is applied to the target channel, the execution overhead (execution time of the result model, complexity of applying the new method, etc.) will vary, so it cannot be made large unconditionally. Also, even if it is made large unconditionally, the accuracy degradation will not be recovered indefinitely. Therefore, it is desirable to select an appropriate value.
3. 문제 채널에 대해 적용하는 양자화 방법 (단계 S130)3. Quantization method applied to the problem channel (step S130)
양자화 에러를 많이 발생시키는 채널에 대해 에러를 감소시키기 위하여 다음과 같은 방법을 적용할 수 있다. 대상 채널에는 k2 개의 가중치가 있는데, 이 가중치들 중 새로운 양자화 방법을 적용할 가중치들을 선택하고, 선택된 가중치들에 대해 새로운 양자화 방법을 적용한다. 한편, n차원의 컨볼루션 및 디컨볼루션에서, 가중치의 개수는 kn개일 수 있다.In order to reduce errors in channels that generate a lot of quantization errors, the following method can be applied. The target channel has k2 weights, and among these weights, weights to which a new quantization method is to be applied are selected, and the new quantization method is applied to the selected weights. Meanwhile, in n-dimensional convolution and deconvolution, the number of weights can be k n .
채널에 존재하는 k2 개의 가중치 중 대상이 되는 가중치는 다음과 같이 다양한 방법으로 지정할 수 있다.Among the k 2 weights existing in the channel, the target weight can be specified in various ways as follows.
< 가중치 선택 방법1 ><
해당 채널에서 양자화 에러의 절대값이 가장 큰 소정 개수의 가중치를 선택하는 방법이다. 양자화 에러는 W_FP32의 값에서 목적하는 타입으로 변환했을 때의 값을 뺀 값으로 정의할 수 있다. 일 실시예에서 양자화 에러의 절대값이 가장 큰 2개를 선택하게 되면 양수 가중치 1개, 음수 가중치 1개를 선택할 수 있다.This is a method of selecting a predetermined number of weights with the largest absolute value of quantization error in the corresponding channel. The quantization error can be defined as the value obtained by subtracting the value when converted to the target type from the value of W_FP32. In one embodiment, if the two with the largest absolute values of quantization errors are selected, one positive weight and one negative weight can be selected.
< 가중치 선택 방법2 > <
지수 값이 가장 큰 가중치를 선택한다. 즉, 가중치를 목적하는 타입으로 변환하였을 때 부호-지수-소수 중 지수값이 가장 큰 수를 가지는 모든 가중치를 선택한다. 지수 값이 크면 해당 가중치의 크기가 큰 것을 의미한다. 다른 실시예에서 지수 값이 가장 큰 것과 두번째로 큰 것까지 선택할 수 있다.The weight with the largest exponent is selected. That is, when the weights are converted to the target type, all weights with the largest exponent among sign-exponent-decimal are selected. A large exponent means that the size of the corresponding weight is large. In another embodiment, the largest and second largest exponents can be selected.
도 3에 지수 값에 따라 가중치를 선택하는 예가 도시되어 있다. 방법2-1은 지수 값이 가장 큰 것을 선택하는 경우이며, 방법 2-2는 지수 값이 가장 큰 것과 두번째로 큰 것을 선택하는 경우이다. 도 3의 예에서 방법 2-1의 경우에는 지수 값이 "1100"으로서 가장 큰 4번, 6번의 가중치가 선택되고, 방법 2-2의 경우에는 지수 값이 "1100"으로 가장 큰 4번, 6번, 그리고 지수 값이 "1011"로 두번째로 큰 7번, 9번 가중치가 선택된다.FIG. 3 illustrates an example of selecting weights according to exponent values. Method 2-1 is for selecting the largest exponent value, and Method 2-2 is for selecting the largest and second largest exponent values. In the example of FIG. 3, in the case of Method 2-1,
< 가중치 선택 방법3 > <
해당 채널의 가중치 전체를 선택할 수 있다. 즉, 특정 조건을 만족하는 가중치만 고르는 것이 아니고 모든 가중치를 선택한다.You can select all the weights of a given channel, that is, you select all the weights, not just those that satisfy a specific condition.
일반적으로는 양자화를 할 때는 실수 값을 가장 가까운 정수 값으로 라운딩을 한다(rounding to nearest). 예를 들면 도 4의 (a)에 도시한 것처럼 -3.5와 -3.25 사이의 값인 -3.36은, -3.5와의 차이는 0.14이고 -3.25와의 차이는 0.12이므로, 차이값이 더 작은 -3.25로 양자화한다. 3과 3.25 사이의 값인 3.19는, 차이값이 0.06으로 차이값이 0.19인 3.00보다 차이값이 작은 3.25로 양자화한다. In general, when quantizing, real numbers are rounded to the nearest integer value. For example, as shown in (a) of Fig. 4, -3.36, which is between -3.5 and -3.25, is quantized to -3.25, which has a smaller difference value, since the difference between -3.5 and -3.25 is 0.14 and the difference between -3.25 and -3.36 is 0.12. 3.19, which is between 3 and 3.25, is quantized to 3.25, which has a smaller difference value of 0.06 than 3.00, which has a difference value of 0.19.
본 발명에서는 선택된 가중치들에 대해서 양자화할 때 일반적인 라운딩 방식 대신에 다음의 양자화 방법 중의 하나를 적용할 수 있다.In the present invention, when quantizing selected weights, one of the following quantization methods can be applied instead of the general rounding method.
< 양자화 방법1 > Rounding away from zero<
0에서 먼 값으로 라운딩한다. 예를 들면 도 4의 (b)에 도시한 것처럼 -3.5와 -3.25 사이의 값인 -3.36은, -3.25보다는 0에서 더 먼 값인 -3.5로 양자화한다. 3과 3.25 사이의 값인 3.19는, 3.00보다는 0에서 더 먼 값인 3.25로 양자화한다. Rounding to values farther from 0. For example, as shown in (b) of Fig. 4, -3.36, which is a value between -3.5 and -3.25, is quantized to -3.5, which is a value farther from 0 than -3.25. 3.19, which is a value between 3 and 3.25, is quantized to 3.25, which is a value farther from 0 than 3.00.
< 양자화 방법2 > Rounding towards zero <
0에 가까운 값으로 라운딩한다. 예를 들면 도 4의 (c)에 도시한 것처럼 -3.5와 -3.25 사이의 값인 -3.36은, -3.5보다는 0에서 더 가까운 값인 -3.25로 양자화한다. 3과 3.25 사이의 값인 3.19는, 3.25보다는 0에서 더 가까운 값인 3.00으로 양자화한다. Rounding to a value closer to 0. For example, as shown in (c) of Fig. 4, -3.36, which is a value between -3.5 and -3.25, is quantized to -3.25, which is a value closer to 0 than -3.5. 3.19, which is a value between 3 and 3.25, is quantized to 3.00, which is a value closer to 0 than 3.25.
< 양자화 방법3 > <
대상 가중치에 대해 양자화 방법1(Rounding away from zero)과 양자화 방법2(Rounding towards zero)를 모두 적용해보았을 때 대상 가중치 전체에 대한 양자화 에러의 제곱의 합이 최소가 되는 조합을 선택한다.When applying both quantization method 1 (Rounding away from zero) and quantization method 2 (Rounding towards zero) to the target weights, the combination that minimizes the sum of the squares of the quantization errors for the entire target weights is selected.
기존의 FP32 포맷을 NF8 포맷으로 양자화하였을 때와 본 발명의 방법을 전체 깊이별 합성곱에 적용하였을 때의 정확도를 비교하였다. MobileNetV1에 적용한 경우에 기존의 방식으로 NF8 포맷으로 양자화한 경우에는 FP32 포맷에 비하여 81%의 정확도를 기록한 것에 반하여, 본 발명의 방법으로 NF8 포맷으로 양자화한 경우는 FP32 포맷에 비하여 94%의 정확도를 기록하였다. MobileNetV2에 적용한 경우에는 기존의 방식으로 NF8 포맷으로 양자화한 경우에 FP32 포맷에 비하여 91%의 정확도를 기록한 것에 반하여, 본 발명의 방법으로 NF8 포맷으로 양자화한 경우는 FP32 포맷에 비하여 97%의 정확도를 기록하였다. The accuracy was compared when the existing FP32 format was quantized to NF8 format and when the method of the present invention was applied to the entire depth-wise convolution. When applied to MobileNetV1, the existing method quantized to NF8 format recorded an accuracy of 81% compared to the FP32 format, whereas the present method quantized to NF8 format recorded an accuracy of 94% compared to the FP32 format. When applied to MobileNetV2, the existing method quantized to NF8 format recorded an accuracy of 91% compared to the FP32 format, whereas the present method quantized to NF8 format recorded an accuracy of 97% compared to the FP32 format.
본 발명에 따른 장치 또는 방법의 각 구성요소는 하드웨어 또는 소프트웨어로 구현되거나, 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다. 또한, 각 구성요소의 기능이 소프트웨어로 구현되고 마이크로프로세서가 각 구성요소에 대응하는 소프트웨어의 기능을 실행하도록 구현될 수도 있다.Each component of the device or method according to the present invention may be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component may be implemented as software, and a microprocessor may be implemented to execute the function of the software corresponding to each component.
본 명세서에 설명되는 시스템 및 기법들의 다양한 구현예들은, 디지털 전자 회로, 집적회로, FPGA(field programmable gate array), ASIC(application specific integrated circuit), 컴퓨터 하드웨어, 펌웨어, 소프트웨어, 및/또는 이들의 조합으로 실현될 수 있다. 이러한 다양한 구현예들은 프로그래밍가능 시스템 상에서 실행 가능한 하나 이상의 컴퓨터 프로그램들로 구현되는 것을 포함할 수 있다. 프로그래밍가능 시스템은, 저장 시스템, 적어도 하나의 입력 디바이스, 그리고 적어도 하나의 출력 디바이스로부터 데이터 및 명령들을 수신하고 이들에게 데이터 및 명령들을 전송하도록 결합되는 적어도 하나의 프로그래밍가능 프로세서(이것은 특수 목적 프로세서일 수 있거나 혹은 범용 프로세서일 수 있음)를 포함한다. 컴퓨터 프로그램들(이것은 또한 프로그램들, 소프트웨어, 소프트웨어 애플리케이션들 혹은 코드로서 알려져 있음)은 프로그래밍가능 프로세서에 대한 명령어들을 포함하며 "컴퓨터가 읽을 수 있는 기록매체"에 저장된다.Various implementations of the systems and techniques described herein can be implemented as digital electronic circuits, integrated circuits, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include implementations of one or more computer programs executable on a programmable system. The programmable system includes at least one programmable processor (which may be a special purpose processor or a general purpose processor) coupled to receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device. Computer programs (also known as programs, software, software applications, or code) include instructions for the programmable processor and are stored on a "computer-readable medium."
컴퓨터가 읽을 수 있는 기록매체는, 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 이러한 컴퓨터가 읽을 수 있는 기록매체는 ROM, CD-ROM, 자기 테이프, 플로피디스크, 메모리 카드, 하드 디스크, 광자기 디스크, 스토리지 디바이스 등의 비휘발성(non-volatile) 또는 비일시적인(non-transitory) 매체일 수 있으며, 또한 데이터 전송 매체(data transmission medium)와 같은 일시적인(transitory) 매체를 더 포함할 수도 있다. 또한, 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수도 있다.A computer-readable recording medium includes any type of recording device that stores data that can be read by a computer system. Such a computer-readable recording medium can be a non-volatile or non-transitory medium, such as a ROM, a CD-ROM, a magnetic tape, a floppy disk, a memory card, a hard disk, a magneto-optical disk, a storage device, and may further include a transitory medium, such as a data transmission medium. In addition, the computer-readable recording medium can be distributed over a network-connected computer system, so that the computer-readable code can be stored and executed in a distributed manner.
본 명세서의 순서도에서는 각 과정들을 순차적으로 실행하는 것으로 기재하고 있으나, 이는 본 개시의 일 실시예의 기술 사상을 예시적으로 설명한 것에 불과한 것이다. 다시 말해, 본 개시의 일 실시예가 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 개시의 일 실시예의 본질적인 특성에서 벗어나지 않는 범위에서 본 명세서의 순서도에 기재된 순서를 변경하여 실행하거나 각 과정들 중 하나 이상의 과정을 병렬적으로 실행하는 것으로 다양하게 수정 및 변형하여 적용 가능할 것이므로, 본 명세서의 순서도는 시계열적인 순서로 한정되는 것은 아니다.Although the flowchart of this specification describes each process as being executed sequentially, this is only an illustrative description of the technical idea of one embodiment of the present disclosure. In other words, a person having ordinary skill in the art to which one embodiment of the present disclosure belongs may change the order described in the flowchart of this specification without departing from the essential characteristics of one embodiment of the present disclosure, or may modify and modify and apply various modifications and variations such as executing one or more of the processes in parallel. Therefore, the flowchart of this specification is not limited to a chronological order.
이상의 설명은 본 실시예의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 실시예가 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 실시예의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 실시예들은 본 실시예의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 실시예의 기술 사상의 범위가 한정되는 것은 아니다. 본 실시예의 보호범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 실시예의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely an example of the technical idea of the present embodiment, and those skilled in the art will appreciate that various modifications and variations may be made without departing from the essential characteristics of the present embodiment. Accordingly, the present embodiments are not intended to limit the technical idea of the present embodiment, but rather to explain it, and the scope of the technical idea of the present embodiment is not limited by these embodiments. The protection scope of the present embodiment should be interpreted by the following claims, and all technical ideas within a scope equivalent thereto should be interpreted as being included in the scope of the rights of the present embodiment.
CROSS-REFERENCE TO RELATED APPLICATIONCROSS-REFERENCE TO RELATED APPLICATION
본 특허출원은, 본 명세서에 그 전체가 참고로서 포함되는, 2023년 10월 26일에 한국에 출원한 특허출원번호 제10-2023-0145070호, 2023년 10월 30일에 한국에 출원한 특허출원번호 제10-2023-0146559호, 및 2023년 12월 14일에 한국에 출원한 특허출원번호 제10-2023-0182301호에 대해 우선권을 주장한다.This patent application claims the benefit of Korean patent application No. 10-2023-0145070, filed in Korea on October 26, 2023, Korean patent application No. 10-2023-0146559, filed in Korea on October 30, 2023, and Korean patent application No. 10-2023-0182301, filed in Korea on December 14, 2023, which are incorporated herein by reference in their entirety.
Claims (14)
Applications Claiming Priority (6)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR20230145070 | 2023-10-26 | ||
| KR10-2023-0145070 | 2023-10-26 | ||
| KR20230146559 | 2023-10-30 | ||
| KR10-2023-0146559 | 2023-10-30 | ||
| KR10-2023-0182301 | 2023-12-14 | ||
| KR1020230182301A KR20250060783A (en) | 2023-10-26 | 2023-12-14 | Method and apparatus for low-precision floating point-friendly quantization |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025089498A1 true WO2025089498A1 (en) | 2025-05-01 |
Family
ID=95516185
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/KR2023/020765 Pending WO2025089498A1 (en) | 2023-10-26 | 2023-12-15 | Low-precision floating-point friendly quantization method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2025089498A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20190014900A (en) * | 2017-08-04 | 2019-02-13 | 삼성전자주식회사 | Method and apparatus for quantizing parameter of neural network |
| KR20200104201A (en) * | 2019-02-25 | 2020-09-03 | 주식회사 딥엑스 | Method and system for bit quantization of artificial neural network |
| KR20210083935A (en) * | 2019-12-27 | 2021-07-07 | 삼성전자주식회사 | Method and apparatus for quantizing parameters of neural network |
| KR20210121946A (en) * | 2020-03-31 | 2021-10-08 | 삼성전자주식회사 | Method and apparatus for neural network quantization |
| US20230091541A1 (en) * | 2020-02-24 | 2023-03-23 | Cambricon Technologies Corporation Limited | Data quantization processing method and apparatus, electronic device and storage medium |
-
2023
- 2023-12-15 WO PCT/KR2023/020765 patent/WO2025089498A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20190014900A (en) * | 2017-08-04 | 2019-02-13 | 삼성전자주식회사 | Method and apparatus for quantizing parameter of neural network |
| KR20200104201A (en) * | 2019-02-25 | 2020-09-03 | 주식회사 딥엑스 | Method and system for bit quantization of artificial neural network |
| KR20210083935A (en) * | 2019-12-27 | 2021-07-07 | 삼성전자주식회사 | Method and apparatus for quantizing parameters of neural network |
| US20230091541A1 (en) * | 2020-02-24 | 2023-03-23 | Cambricon Technologies Corporation Limited | Data quantization processing method and apparatus, electronic device and storage medium |
| KR20210121946A (en) * | 2020-03-31 | 2021-10-08 | 삼성전자주식회사 | Method and apparatus for neural network quantization |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4758972A (en) | Precision rounding in a floating point arithmetic unit | |
| WO2021085784A1 (en) | Learning method of object detection model, and object detection device in which object detection model is executed | |
| WO2021225294A1 (en) | Transfer learning apparatus and method using sample-based regularization technique | |
| CN112668716A (en) | Training method and device of neural network model | |
| WO2020045714A1 (en) | Method and system for recognizing contents | |
| WO2021033981A1 (en) | Flexible information-based decoding method of dna storage device, program and apparatus | |
| US4941119A (en) | Method and apparatus for predicting an overflow in an integer multiply | |
| WO1989002119A1 (en) | Apparatus and method for using a single carry chain for leading one detection and for ''sticky'' bit calculation | |
| WO2025089498A1 (en) | Low-precision floating-point friendly quantization method and apparatus | |
| WO2022220354A1 (en) | Fish shoal ecosystem monitoring system device for detecting abnormality in fish shoal ecosystem, and method for operation same | |
| CN112667197A (en) | Parameterized addition and subtraction operation circuit based on POSIT floating point number format | |
| CN114201140B (en) | Exponential function processing unit, method and neural network chip | |
| WO2023106638A1 (en) | Lightweight real-time abnormality detection method using can message analysis and neural network model | |
| CN118587533B (en) | A network training method and application method for remote sensing image classification in an open environment | |
| WO2023014124A1 (en) | Method and apparatus for quantizing neural network parameter | |
| WO2019208869A1 (en) | Method and apparatus for detecting facial features by using learning | |
| WO2023177025A1 (en) | Method and apparatus for computing artificial neural network based on parameter quantization using hysteresis | |
| KR20250060783A (en) | Method and apparatus for low-precision floating point-friendly quantization | |
| US8250126B2 (en) | Efficient leading zero anticipator | |
| WO2023113445A1 (en) | Method and apparatus for floating point arithmetic | |
| KR101922462B1 (en) | A data processing apparatus and method for performing a shift function on a binary number | |
| WO2023128024A1 (en) | Method and system for quantizing deep-learning network | |
| WO2025089499A1 (en) | Data-type recognition weight scaling apparatus and method for floating point quantization | |
| KR102822740B1 (en) | Method And Apparatus for Accelerating Deep learning Neural Network Model Using Cluster | |
| WO2025110327A1 (en) | Calibration method and apparatus using input/output distribution of adjacent layer |
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: 23956931 Country of ref document: EP Kind code of ref document: A1 |