IP Library › Granted Patent US 12,566,940
Granted Patent B2
US 12,566,940 · App. 17/192,048 · Granted Mar 3, 2026

Method and apparatus for quantizing parameters of neural network

Inventors: Gunhee Kim (Seoul, KR); Seungwon Lee (Hwaseong-si, KR)
Assignee: Samsung Electronics Co., Ltd.
G06N3/04
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,566,940
App. No.
17/192,048
Granted
Mar 3, 2026
Kind
B2
Abstract

A method of quantizing parameters of a neural network includes acquiring a parameter of a floating-point format used in a process of inferring by the neural network, quantizing, based on statistics of a weight included in the parameter, the weight into a fixed-point format, determining, based on statistics of an activation of one or more layers configuring the neural network included in the parameter, a dynamic range of the activation, and quantizing, based on statistics of input data of the neural network, the input data into a fixed-point format.

Claims (67)

1 . A computer-implemented method of quantizing parameters of a neural network, the method comprising:

acquiring, from a first memory, a parameter of a floating-point format used in a process of inferring by the neural network;

quantizing, by a quantization device, based on statistics of a weight included in the parameter, the weight into a fixed-point format;

determining, based on statistics of an activation of one or more layers configuring the neural network included in the parameter, a dynamic range of the activation, wherein the determining of the dynamic range of the activation comprises:

calculating a relational expression between an Lp norm of an output activation and an Lp norm of an input activation of the one or more layers based on the parameter; and

inferring an Lp norm of an output activation of the one or more layers based on the relational expression and an Lp norm of an output activation of a previous layer of the one or more layers;

quantizing, by the quantization device, based on statistics of input data of the neural network, the input data into a fixed-point format;

inputting, to the neural network, the quantized input data stored in a second memory;

performing, by a NPU, an operation between a quantized input activation of a current layer of the neural network and a quantized weight of the current layer and generating an output activation of the current laver; and

quantizing the output activation of the current layer based on the dynamic range of the activation, into the fixed-point format.

2 . The method of claim 1 , wherein the quantizing of the weight into the fixed-point format comprises:

calculating an Lp norm of the weight;

determining a dynamic range of the weight based on the Lp norm of the weight; and

quantizing the weight into the fixed-point format based on the dynamic range of the weight.

3 . The method of claim 1 , wherein the determining of the dynamic range of the activation comprises: determining a dynamic range of the output activation of the one or more layers based on the Lp norm of the output activation of the one or more layers.

4 . The method of claim 1 , wherein the determining of the dynamic range of the activation comprises:

classifying the one or more layers into a first layer comprising a normalization layer and a second layer that does not comprise the normalization layer;

inferring an Lp norm of an output activation of the first layer based on a normalization parameter of the first layer included in the parameter; and

inferring an Lp norm of an output activation of the second layer based on the parameter and the Lp norm of the output activation of the first layer.

5 . The method of claim 4 , wherein the inferring of the Lp norm of the output activation of the second layer comprises:

calculating a relational expression between an Lp norm of an input activation and an Lp norm of the output activation of the second layer based on the parameter;

determining the Lp norm of the input activation of the second layer based on the Lp norm of the output activation of the first layer; and

inferring the Lp norm of the output activation of the second layer based on the Lp norm of the input activation of the second layer and the relational expression.

6 . The method of claim 4 , wherein the determining of the dynamic range of the activation comprises:

determining a dynamic range of the output activation of the first layer based on the Lp norm of the output activation of the first layer; and

determining a dynamic range of the output activation of the second layer based on the Lp norm of the output activation of the second layer.

7 . A neural network quantization apparatus for quantizing parameters of a neural network, the apparatus comprising:

a first memory:

a second memory; and

a processor configured to:

acquire, from the first memory, a parameter of a floating-point format used in a process of inferring by the neural network,

quantize, based on statistics of a weight included in the parameter, the weight into a fixed-point format,

determine, based on statistics of an activation of one or more layers configuring the neural network included in the parameter, a dynamic range of the activation, wherein the processor is configured to:

calculate a relational expression between an Lp norm of an output activation and an Lp norm of an input activation of the one or more layers based on the parameter, and

infer an Lp norm of an output activation of the one or more layers based on the relational expression and an Lp norm of an output activation of a previous layer of the one or more layers,

quantize, based on statistics of input data of the neural network, the input data into a fixed-point format;

input, to the neural network, the quantized input data stored in the second memory;

perform an operation between a quantized input activation of a current layer of the neural network and a quantized weight of the current layer and generating an output activation of the current layer; and

quantize the output activation of the current layer, based on the dynamic range of the activation, into the fixed-point format.

8 . The neural network quantization apparatus of claim 7 , wherein the processor is configured to:

calculate an Lp norm of the weight,

determine a dynamic range of the weight based on the Lp norm of the weight, and

quantize the weight into the fixed-point format based on the dynamic range of the weight.

9 . The neural network quantization apparatus of claim 7 , wherein the processor is configured to determine a dynamic range of the output activation of the one or more layers based on the Lp norm of the output activation of the one or more layers.

10 . The neural network quantization apparatus of claim 7 , wherein the processor is configured to:

classify the one or more layers into a first layer comprising a normalization layer and a second layer that does not comprise the normalization layer,

infer an Lp norm of an output activation of the first layer based on a normalization parameter of the first layer included in the parameter, and

infer an Lp norm of an output activation of the second layer based on the parameter and the Lp norm of the output activation of the first layer.

11 . The neural network quantization apparatus of claim 10 , wherein the processor is configured to:

calculate a relational expression between an Lp norm of an input activation and an Lp norm of the output activation of the second layer based on the parameter,

determine the Lp norm of the input activation of the second layer based on the Lp norm of the output activation of the first layer, and

infer an Lp norm of the output activation of the second layer based on the Lp norm of the input activation of the second layer and the relational expression.

12 . The neural network quantization apparatus of claim 10 , wherein the processor is configured to:

determine a dynamic range of the output activation of the first layer based on the Lp norm of the output activation of the first layer, and

determine a dynamic range of the output activation of the second layer based on the Lp norm of the output activation of the second layer.

13 . A neural processing unit (NPU) comprising:

a memory comprising an Lp norm of a weight, an Lp norm of an output activation of layers, and an Lp norm of input data; and

a neural network quantization apparatus configured to:

determine a dynamic range of the weight based on the Lp norm of the weight,

quantize the weight into a fixed-point format based on the dynamic range of the weight:

determine a dynamic range of the output activation of the layers based on the Lp norm of the output activation of the layers, wherein the determining of the dynamic range of the activation comprises:

calculating a relational expression between an Lp norm of an output activation and an Lp norm of an input activation of the one or more layers based on the parameter; and

inferring an Lp norm of an output activation of the one or more layers based on the relational expression and an Lp norm of an output activation of a previous layer of the one or more lavers:

determine a dynamic range of the input data based on the Lp norm of the input data:

quantize the input data into a fixed-point format based on the dynamic range of the input data; and

an arithmetic logic unit (ALU) configured to perform an operation between a quantized input activation of a current layer of the neural network and a quantized weight of the current layer and generate an output activation of the current layer,

wherein the neural network quantization apparatus is configured to quantize the output activation of the current layer based on the dynamic range of the output activation.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 4, 2021
From: KIM, GUNHEE; LEE, SEUNGWON
To: SAMSUNG ELECTRONICS CO., LTD
Reel/Frame 055494/0400 →
Priority Claims (1)
KR 10-2020-0123172 · Sep 23, 2020 · national
Continuity (1)
Related Publication 20220092384A1 · Mar 24, 2022
References Cited (51)
US 8301576B2 · Meng et al. · 2012 [cited by applicant]
US 9710265B1 · Temam et al. · 2017 [cited by applicant]
US 10007876B1 · Young · 2018 [cited by applicant]
US 10096134B2 · Yan et al. · 2018 [cited by applicant]
US 10373050B2 · Lin et al. · 2019 [cited by applicant]
US 11520561B1 · Afzal · 2022 [cited by examiner]
US 11861492B1 · Hsu · 2024 [cited by examiner]
US 20120330870A1 · Aparin · 2012 [cited by applicant]
US 20150256840A1 · Sato · 2015 [cited by examiner]
US 20160328646A1 · Lin et al. · 2016 [cited by applicant]
US 20160328647A1 · Lin et al. · 2016 [cited by applicant]
US 20170193361A1 · Chilimbi et al. · 2017 [cited by applicant]
US 20190034784A1 · Li · 2019 [cited by examiner]
US 20190034796A1 · Li · 2019 [cited by examiner]
US 20190042948A1 · Lee · 2019 [cited by examiner]
US 20190138882A1 · Choi · 2019 [cited by examiner]
US 20190251436A1 · Son et al. · 2019 [cited by applicant]
US 20190279072A1 · Gao et al. · 2019 [cited by applicant]
US 20200082269A1 · Gao · 2020 [cited by examiner]
US 20210034955A1 · Sather · 2021 [cited by examiner]
US 20210150334A1 · Wolfe · 2021 [cited by examiner]
US 20210174172A1 · Qadeer · 2021 [cited by examiner]
US 20210224069A1 · Chen · 2021 [cited by examiner]
US 20210255860A1 · Morrison · 2021 [cited by examiner]
US 20210279574A1 · Liu · 2021 [cited by examiner]
US 20210279635A1 · Gadelrab · 2021 [cited by examiner]
US 20210294874A1 · Tang · 2021 [cited by examiner]
US 20210312328A1 · Danjo · 2021 [cited by examiner]
US 20220044114A1 · Sriram · 2022 [cited by examiner]
US 20220067527A1 · Xu · 2022 [cited by examiner]
US 20230118802A1 · Gong · 2023 [cited by examiner]
CN 108432249A · 2018 [cited by applicant]
CN 109800865A · 2019 [cited by applicant]
CN 110413255A · 2019 [cited by applicant]
CN 111178514A · 2020 [cited by applicant]
KR 1020180120967A · 2018 [cited by applicant]
KR 1020190014900A · 2019 [cited by applicant]
KR 1020190034985A · 2019 [cited by applicant]
KR 1020190043849A · 2019 [cited by applicant]
KR 1020190044878A · 2019 [cited by applicant]
KR 1020190050141A · 2019 [cited by applicant]
KR 1020190054454A · 2019 [cited by applicant]
KR 1020190068255A · 2019 [cited by applicant]
KR 1020190125141A · 2019 [cited by applicant]
KR 1020190130443A · 2019 [cited by applicant]
KR 1020200004700A · 2020 [cited by applicant]
De Prado, Miguel, et al., “QUENN: Quantization Engine for low-power Neural Networks”, Proceedings of the 15th ACM International Conference on Computing Frontiers. arXiv;1811.05896v1 [cs.NE], Nov. 14, 2018. (9 pages in E… [cited by applicant]
Tambe, Thierry, et al., “Algorithm-Hardware Co-Design of Adaptive Floating-Point Encodings for Resilient Deep Learning Inference”, 2020 57th ACM/IEEE Design Automation Conference (DAC). IEEE, 2020. (6 pages in English). [cited by applicant]
Oh, Jihun, et al., “Weight Equalizing Shift Scaler-Coupled Post-training Quantization”, arXiv preprint arXiv:2008.05767 Aug. 13, 2020 (9 pages in English). [cited by applicant]
Extended European search report issued on Apr. 11, 2022, in counterpart European Patent Application No. 21185895.6 (11 pages in English). [cited by applicant]
Chinese Office Action issued on Dec. 10, 2025, in counterpart Chinese Patent Application No. 202110266381.8 (31 pages in English, 15 pages in Chinese). [cited by applicant]