Movatterモバイル変換


[0]ホーム

URL:


KR20250079863A - Quantization learning method for diffusion model, computing device for the same, and image generating device - Google Patents

Quantization learning method for diffusion model, computing device for the same, and image generating device
Download PDF

Info

Publication number
KR20250079863A
KR20250079863AKR1020240133047AKR20240133047AKR20250079863AKR 20250079863 AKR20250079863 AKR 20250079863AKR 1020240133047 AKR1020240133047 AKR 1020240133047AKR 20240133047 AKR20240133047 AKR 20240133047AKR 20250079863 AKR20250079863 AKR 20250079863A
Authority
KR
South Korea
Prior art keywords
quantization
diffusion model
neural network
learning
time step
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
KR1020240133047A
Other languages
Korean (ko)
Inventor
박은혁
소준혁
이중원
Original Assignee
포항공과대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 포항공과대학교 산학협력단filedCritical포항공과대학교 산학협력단
Publication of KR20250079863ApublicationCriticalpatent/KR20250079863A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromKorean

적어도 하나 이상의 명령을 저장하는 메모리, 상기 적어도 하나 이상의 명령을 실행하는 프로세서, 양자화 간격을 생성하기 위한 신경망, 및 확산 모델을 포함하며, 상기 프로세서는, 상기 확산 모델에 대한 현재 시간 단계 정보를 상기 신경망에 입력하여 상기 현재 시간 단계 정보에 대한 양자화 간격 획득하고, 상기 획득한 양자화 간격을 상기 확산 모델의 양자화 연산자에 제공하고, 상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키며, 상기 양자화된 결과를 이용하여 양자화 오차를 생성하고, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격을 학습시키는, 컴퓨팅 시스템을 공개한다.A computing system is disclosed, comprising: a memory storing at least one command; a processor executing the at least one command; a neural network for generating a quantization interval; and a diffusion model, wherein the processor inputs current time step information for the diffusion model into the neural network to obtain a quantization interval for the current time step information, provides the obtained quantization interval to a quantization operator of the diffusion model, causes the quantization operator of the diffusion model to quantize tensor data of the diffusion model using the generated quantization interval, generates a quantization error using the quantized result, and updates the quantization interval using the quantization error, thereby learning the quantization interval of the neural network.

Description

Translated fromKorean
확산 모델을 위한 양자화 학습 방법, 이를 위한 컴퓨팅 장치, 및 이미지 생성 장치 {QUANTIZATION LEARNING METHOD FOR DIFFUSION MODEL, COMPUTING DEVICE FOR THE SAME, AND IMAGE GENERATING DEVICE}{QUANTIZATION LEARNING METHOD FOR DIFFUSION MODEL, COMPUTING DEVICE FOR THE SAME, AND IMAGE GENERATING DEVICE}

본 발명은 확산 모델을 위한 양자화 학습 방법, 이를 위한 컴퓨팅 장치, 및 이미지 생성 장치에 관한 기술로서, 특히 시간 단계 정보에 따라 다른 양자화 간격을 제공할 수 있는 기술에 관한 것이다.The present invention relates to a quantization learning method for a diffusion model, a computing device therefor, and an image generation device, and more particularly, to a technology capable of providing different quantization intervals according to time step information.

확산 모델(Diffusion model)은 이미지 생성 모델의 일종이다. 랜덤 데이터에서 노이즈를 점진적으로 제거하여 상기 랜덤 데이터로부터 깨끗한 이미지를 생성할 수 있다. 이때, 확산 모델의 양자화가 중요하다. 기존 양자화 기술의 경우 확산 모델의 노이즈 제거 과정에 따라 액티베이션 값의 분포가 변화함에도 불구하고 상기 분포의 변화에 대응하는 방법이 없기 때문에 액티베이션 값의 비트 수를 낮춤에 따라 큰 품질 하락이 생기는 문제가 있다.The diffusion model is a type of image generation model. It can gradually remove noise from random data to generate a clean image from the random data. At this time, the quantization of the diffusion model is important. In the case of the existing quantization technology, although the distribution of the activation value changes according to the noise removal process of the diffusion model, there is a problem that a large quality degradation occurs as the number of bits of the activation value is reduced because there is no method to respond to the change in the distribution.

종래의 양자화 방법의 종류로는 QAT(Quantization-aware Training) 및 PTQ(Post-training Quantization) 등이 있다.Conventional quantization methods include Quantization-aware Training (QAT) and Post-training Quantization (PTQ).

상기 QAT는 양자화 연산자를 도입한 후 추가 학습을 적용하여 양자화 연산자의 효과를 고려하여 최종 손실 값을 최소화하는 방향으로 네트워크 파라미터들을 업데이트할 수 있다. 반면 상기 PTQ는 양자화 후 종단간(end-to-end) 순방향/역방향 전파를 적용하지 않는다. 대신 양자화로 인해 발생하는 블록별 재구성 오류를 줄이는 데 중점을 둔다.The above QAT can update the network parameters in the direction of minimizing the final loss value by applying additional learning after introducing the quantization operator and considering the effect of the quantization operator. On the other hand, the above PTQ does not apply end-to-end forward/backward propagation after quantization. Instead, it focuses on reducing the block-by-block reconstruction error caused by quantization.

본 발명에서는 확산 모델에서 시간 단계에 따라 서로 다른 양자화 간격을 사용하는 방법 및 이미지 생성 장치를 제공하고자 한다.The present invention aims to provide a method and an image generating device that use different quantization intervals according to time steps in a diffusion model.

본 발명에서는 시간 단계에 따라 서로 다른 양자화 간격을 사용하기 위해 시간 단계 정보를 입력으로 하는 신경망을 이용하여 시간 단계에 따라 서로 다른 양자화 간격을 생성하는 방법을 제공하고자 한다.The present invention provides a method for generating different quantization intervals according to time steps by using a neural network that takes time step information as input to use different quantization intervals according to time steps.

본 발명의 일 관점에 따라 제공되는 컴퓨팅 장치는, 적어도 하나 이상의 명령을 저장하는 메모리; 상기 적어도 하나 이상의 명령을 실행하는 프로세서; 양자화 간격을 생성하기 위한 신경망; 및 확산 모델을 포함할 수 있다. 상기 프로세서는, 상기 확산 모델에 대한 현재 시간 단계 정보를 상기 신경망에 입력하여 상기 현재 시간 단계 정보에 대한 양자화 간격(quantization interval)을 획득하고, 상기 획득한 양자화 간격을 상기 확산 모델의 양자화 연산자(quantization operator)에 제공하고, 상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키며, 상기 양자화된 결과를 이용하여 양자화 오차를 생성하고, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격을 학습시킬 수 있다.According to one aspect of the present invention, a computing device may include a memory storing at least one command; a processor executing the at least one command; a neural network for generating a quantization interval; and a diffusion model. The processor may input current time step information for the diffusion model into the neural network to obtain a quantization interval for the current time step information, provide the obtained quantization interval to a quantization operator of the diffusion model, cause the quantization operator of the diffusion model to quantize tensor data of the diffusion model using the generated quantization interval, generate a quantization error using the quantized result, and update the quantization interval using the quantization error, thereby learning the quantization interval of the neural network.

이때, 상기 신경망은 경사하강법(gradient descent)을 이용하여 학습될 수 있다.At this time, the neural network can be trained using gradient descent.

이때, 상기 프로세서는, 상기 확산 모델에 대한 현재 시간 단계 정보를 주파수 인코딩하고, 상기 인코딩된 현재 시간 단계 정보를 상기 신경망에 입력할 수 있다.At this time, the processor can frequency encode current time step information for the diffusion model and input the encoded current time step information into the neural network.

이때, 상기 프로세서는, 상기 확산 모델의 각 시간 단계의 양자화 학습을 시작할 때, 상기 신경망의 출력 데이터를 초기화할 수 있다.At this time, the processor can initialize the output data of the neural network when starting quantization learning of each time step of the diffusion model.

본 발명의 일 관점에 따라 제공되는 확산 모델을 위한 양자화 학습 방법은, 확산 모델에 대한 현재 시간 단계 정보를 신경망에 입력하여 상기 현재 시간 단계 정보에 대한 양자화 간격을 획득하는 단계; 상기 획득한 양자화 간격을 상기 확산 모델의 양자화 연산자에 제공하는 단계; 상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키는 단계; 상기 양자화된 결과를 이용하여 양자화 오차를 생성하는 단계; 및 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격을 학습시키는 단계를 포함할 수 있다.According to one aspect of the present invention, a quantization learning method for a diffusion model may include the steps of: inputting current time step information for a diffusion model into a neural network to obtain a quantization interval for the current time step information; providing the obtained quantization interval to a quantization operator of the diffusion model; causing the quantization operator of the diffusion model to quantize tensor data of the diffusion model using the generated quantization interval; generating a quantization error using the quantized result; and updating the quantization interval using the quantization error to learn the quantization interval of the neural network.

이때, 상기 신경망의 양자화 간격을 학습시키는 단계는 경사하강법을 이용하여 학습시키는 단계일 수 있다.At this time, the step of learning the quantization interval of the neural network may be a step of learning using the gradient descent method.

이때, 상기 양자화 간격을 획득하는 단계는, 상기 확산 모델에 대한 현재 시간 단계 정보를 주파수 인코딩하는 단계; 및 상기 인코딩된 현재 시간 단계 정보를 상기 신경망에 입력하는 단계를 포함할 수 있다.At this time, the step of obtaining the quantization interval may include the step of frequency encoding current time step information for the diffusion model; and the step of inputting the encoded current time step information into the neural network.

이때, 상기 양자화 간격을 획득하는 단계 이전에, 상기 신경망의 출력 데이터를 초기화하는 단계를 더 포함할 수 있다.At this time, prior to the step of obtaining the quantization interval, a step of initializing the output data of the neural network may be further included.

본 발명의 일 관점에 따라 제공되는 이미지 생성 장치는, 적어도 하나 이상의 명령을 저장하는 메모리; 상기 적어도 하나 이상의 명령을 실행하는 프로세서; 및 확산 모델을 포함할 수 있다. 상기 프로세서는, 상기 확산 모델에 현재 시간 단계 정보 및 입력 이미지를 입력하여 노이즈가 제거된 출력 이미지를 생성하며, 상기 출력 이미지를 생성하는 과정에서, 상기 현재 시간 단계 정보에 대한 미리 저장된 양자화 간격을 이용하여 상기 확산 모델의 하나 이상의 텐서 데이터를 양자화하며, 상기 미리 저장된 양자화 간격은 상기 확산 모델의 각 시간 단계에 따라 양자화 간격이 서로 다르게 생성되어 저장된 것일 수 있다.According to one aspect of the present invention, an image generating device may include: a memory storing at least one command; a processor executing the at least one command; and a diffusion model. The processor inputs current time step information and an input image to the diffusion model to generate an output image from which noise has been removed, and in the process of generating the output image, quantizes one or more tensor data of the diffusion model using a pre-stored quantization interval for the current time step information, and the pre-stored quantization interval may be generated and stored with a different quantization interval for each time step of the diffusion model.

이때, 상기 신경망은 경사하강법을 이용하여 학습된 것일 수 있다.At this time, the neural network may be trained using gradient descent.

이때, 상기 신경망은, 상기 프로세서가, 상기 확산 모델에 대한 학습용 시간 단계 정보를 학습용 신경망에 입력하여 상기 학습용 시간 단계 정보에 대한 학습용 양자화 간격을 획득하고, 상기 획득한 학습용 양자화 간격을 상기 확산 모델의 양자화 연산자에 제공하고, 상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 학습용 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키며, 상기 양자화된 결과를 이용하여 양자화 오차를 생성하고, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격이 학습되도록 학습된 것이며, 상기 미리 저장된 양자화 간격은, 상기 프로세서가 학습이 완료된 상기 신경망으로부터 상기 확산 모델의 각 시간 단계 정보에 대응하는 양자화 간격을 획득하여 상기 메모리에 저장한 것일 수 있다.At this time, the neural network is learned so that the processor inputs learning time step information for the diffusion model into the learning neural network to obtain a learning quantization interval for the learning time step information, provides the obtained learning quantization interval to the quantization operator of the diffusion model, causes the quantization operator of the diffusion model to quantize tensor data of the diffusion model using the generated learning quantization interval, generates a quantization error using the quantized result, and updates the quantization interval using the quantization error so that the quantization interval of the neural network is learned, and the pre-stored quantization interval may be a quantization interval corresponding to each time step information of the diffusion model obtained by the processor from the neural network for which learning has been completed and stored in the memory.

이때, 상기 신경망은 상기 프로세서가, 상기 확산 모델에 대한 상기 학습용 시간 단계 정보를 주파수 인코딩하고, 상기 인코딩된 학습용 시간 단계 정보를 상기 신경망의 입력으로 제공하도록 학습된 것일 수 있다.At this time, the neural network may be trained so that the processor frequency-encodes the learning time step information for the diffusion model and provides the encoded learning time step information as an input to the neural network.

이때, 상기 신경망은 상기 프로세서가, 상기 확산 모델의 각 시간 단계의 양자화 학습을 시작할 때, 상기 신경망의 출력 데이터를 초기화하도록 학습된 것일 수 있다.At this time, the neural network may be trained so that the processor initializes the output data of the neural network when it starts quantization learning of each time step of the diffusion model.

본 발명에 따르면, 시간에 따른 분포차이에 대응하기 위해 시간정보를 입력으로 하여 각 시간의 양자화 간격을 학습할 수 있는 네트워크를 제공할 수 있다.According to the present invention, a network capable of learning a quantization interval for each time by inputting time information in order to respond to a distribution difference over time can be provided.

본 발명에 따르면, 네트워크(즉, TDQ 모듈)의 빠른 학습을 위해 시간정보를 여러 주파수의 성분을 가지는 정보로 바꾸는 주파수 인코딩 방법을 제공할 수 있다.According to the present invention, a frequency encoding method for changing time information into information having multiple frequency components for rapid learning of a network (i.e., a TDQ module) can be provided.

본 발명에 따르면, 네트워크(즉, TDQ 모듈)의 초기 출력을 원하는 양자화 간격 값으로 초기화하기 위한 편향 초기화 방법을 제공할 수 있다.According to the present invention, a bias initialization method can be provided for initializing the initial output of a network (i.e., a TDQ module) to a desired quantization interval value.

본 발명에 따르면, 종래의 동적 양자화 방법은 양자화 파라미터를 정하기 위해 각 입력 데이터로부터 정보를 추출하는 과정이 필요함에 반해, 본 발명의 양자화 방법은 양자화 간격을 생성하는 과정을 미리 수행해 둘 수 있기 때문에 추론시 추가적인 오버헤드가 없다는 장점이 있다.According to the present invention, while conventional dynamic quantization methods require a process of extracting information from each input data to determine a quantization parameter, the quantization method of the present invention has an advantage in that there is no additional overhead during inference because the process of generating a quantization interval can be performed in advance.

본 발명에 따르면, 변화하는 액티베이션 값의 분포에 잘 대응할 수 있기 때문에, 기존 확산 모델 양자화 방법에 비해 더 낮은 비트 수에서 더 높은 생성 품질을 제공할 수 있다.According to the present invention, since it can respond well to the distribution of changing activation values, it can provide higher generation quality at a lower number of bits compared to the existing diffusion model quantization method.

도 1은 본 발명의 일 실시예에 따라 노이즈 제거 과정을 통한 확산 모델의 이미지 생성 과정을 설명하기 위한 도면이다.
도 2는 본 발명의 일 실시예에 따라 시간 단계에 따른 확산 모델의 액티베이션 값의 분포를 설명하기 위한 도면이다.
도 3은 본 발명의 일 실시예에 따라 시간 변화에 따른 양자화 오류의 변화를 설명하기 위한 도면이다.
도 4는 종래의 비교 실시예에 따른 동적 양자화 방법을 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 TDQ 모듈을 이용한 양자화 방법을 설명하기 위한 도면이다.
도 6은 본 발명의 일 실시예에 따른 TDQ 모듈의 학습을 위한 컴퓨팅 시스템의 개략도이다.
도 7은 본 발명의 일 실시예에 따른 확산 모델을 위한 양자화 학습 방법을 설명하기 위한 순서도이다.
도 8은 본 발명의 일 실시예에 따라 TDQ 모듈을 이용했을 때와 이용하지 않았을 때의 양자화된 확산 모델의 출력 성능 비교를 설명하기 위한 도면이다.
도 9는 본 발명의 일 실시예에 따라 TDQ 모듈을 이용했을 때와 이용하지 않았을 때의 양자화된 확산 모델의 출력 성능 비교를 설명하기 위한 도면이다.
도 10은 도 1 내지 도 7의 과정의 적어도 일부를 수행할 수 있는 일반화된 이미지 생성 장치 또는 컴퓨팅 시스템의 예시를 도시하는 개념도이다.
FIG. 1 is a diagram for explaining an image generation process of a diffusion model through a noise removal process according to one embodiment of the present invention.
FIG. 2 is a diagram for explaining the distribution of activation values of a diffusion model according to time steps according to one embodiment of the present invention.
FIG. 3 is a diagram for explaining changes in quantization error over time according to one embodiment of the present invention.
Fig. 4 is a diagram for explaining a dynamic quantization method according to a conventional comparative example.
FIG. 5 is a diagram for explaining a quantization method using a TDQ module according to one embodiment of the present invention.
FIG. 6 is a schematic diagram of a computing system for learning a TDQ module according to one embodiment of the present invention.
FIG. 7 is a flowchart illustrating a quantization learning method for a diffusion model according to one embodiment of the present invention.
FIG. 8 is a diagram for explaining a comparison of the output performance of a quantized diffusion model when a TDQ module is used and when it is not used according to one embodiment of the present invention.
FIG. 9 is a diagram for explaining a comparison of the output performance of a quantized diffusion model when a TDQ module is used and when it is not used according to one embodiment of the present invention.
FIG. 10 is a conceptual diagram illustrating an example of a generalized image generating device or computing system capable of performing at least part of the processes of FIGS. 1 through 7.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.The present invention can have various modifications and various embodiments, and specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to specific embodiments, but should be understood to include all modifications, equivalents, or substitutes included in the spirit and technical scope of the present invention.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.The terms first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The terms are only used to distinguish one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and/or includes a combination of a plurality of related described items or any one of a plurality of related described items.

본 출원의 실시예들에서, "A 및 B 중에서 적어도 하나"는 "A 또는 B 중에서 적어도 하나" 또는 "A 및 B 중 하나 이상의 조합들 중에서 적어도 하나"를 의미할 수 있다. 또한, 본 출원의 실시예들에서, "A 및 B 중에서 하나 이상"은 "A 또는 B 중에서 하나 이상" 또는 "A 및 B 중 하나 이상의 조합들 중에서 하나 이상"을 의미할 수 있다.In the embodiments of the present application, “at least one of A and B” can mean “at least one of A or B” or “at least one of combinations of one or more of A and B.” Furthermore, in the embodiments of the present application, “at least one of A and B” can mean “at least one of A or B” or “at least one of combinations of one or more of A and B.”

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When it is said that a component is "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components in between. On the other hand, when it is said that a component is "directly connected" or "directly connected" to another component, it should be understood that there are no other components in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in this application is only used to describe specific embodiments and is not intended to limit the present invention. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, it should be understood that the terms "comprises" or "has" and the like are intended to specify the presence of a feature, number, step, operation, component, part or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가진 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Terms defined in commonly used dictionaries, such as those defined in common dictionaries, should be interpreted as having a meaning consistent with the meaning they have in the context of the relevant art, and will not be interpreted in an idealized or overly formal sense unless expressly defined in this application.

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 본 발명을 설명함에 있어 전체적인 이해를 용이하게 하기 위하여 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, with reference to the attached drawings, a preferred embodiment of the present invention will be described in more detail. In order to facilitate an overall understanding in describing the present invention, the same reference numerals are used for the same components in the drawings, and redundant descriptions of the same components are omitted.

도 1은 본 발명의 일 실시예에 따라 노이즈 제거 과정을 통한 확산 모델의 이미지 생성 과정을 설명하기 위한 도면이다.FIG. 1 is a diagram for explaining an image generation process of a diffusion model through a noise removal process according to one embodiment of the present invention.

확산 모델의 프로세스에는 순방향 확산 프로세스와 역방향 확산 프로세스가 있다.The diffusion model process includes the forward diffusion process and the reverse diffusion process.

순방향 확산 프로세스에서는 각 시간 단계(time step)(t)에서 작은 가우시안 노이즈를 추가하여 이미지(x0)를 표준 정규 분포를 따르는 랜덤 데이터(xT)로 점진적으로 변환할 수 있다. 이때, T는 전체 시간 단계(time step)의 길이 혹은 최대 시간 인덱스 값을 나타내고, t는 일반적인 시간에 대한 변수를 나타낼 수 있다.In the forward diffusion process, an image (x0 ) can be gradually transformed into random data (xT ) following a standard normal distribution by adding a small Gaussian noise at each time step (t). Here, T represents the length of the entire time step or the maximum time index value, and t can represent a variable for general time.

역방향 확산 프로세스에서는 반복적인 노이즈 제거 단계를 통해 랜덤 데이터(xT)에서 노이즈를 점진적으로 제거하여 랜덤 데이터(xT)로부터 깨끗한 이미지(x0)를 생성할 수 있다. 따라서 확산 모델은 각 시간 단계에서 주어진 노이즈 데이터(xt)의 노이즈 양을 추정하는 역방향 프로세스를 학습할 수 있다. 순방향(q) 및 역방향(

Figure pat00001
) 프로세스는 다음의 수학식 1 및 수학식 2와 같이 설명할 수 있다.In the backward diffusion process, noise can be gradually removed from random data (xT ) through repeated noise removal steps to generate a clean image (x0 ) from random data (xT ). Therefore, the diffusion model can learn the backward process to estimate the amount of noise in the given noise data (xt ) at each time step. Forward (q) and backward (
Figure pat00001
) The process can be described by the following mathematical expressions 1 and 2.

이때,

Figure pat00004
는 가우시안 노이즈의 크기를 나타낼 수 있다. N은 파라메트릭 노이즈 (parametric noise)를 나타내며, 일반적으로 정규 분포 (normal distribution)를 의미할 수 있다.는 정규 분포의 평균으로 이 값이 네트워크에 의해 예측될 수 있다.I는 항등 행렬 (identity matrix)로 각 디멘션(dimension)별로 직교(orthogonal)한 분포를 가정한다.At this time,
Figure pat00004
can represent the size of Gaussian noise. N represents parametric noise, which can generally mean a normal distribution. is the mean of a normal distribution, which can be predicted by the network.I is the identity matrix, which assumes an orthogonal distribution for each dimension.

확산 모델은 고품질 이미지를 생성할 수 있지만 반복적 노이즈 제거 과정으로 인해 확산 모델을 실제 시나리오에 사용하기 어렵다. 확산 모델에 대한 초기 작업에서는 단일 이미지를 생성하는 데 수백에서 수천 번의 반복적 추론이 필요하여 샘플링 속도가 매우 느리다는 문제가 있다.Although diffusion models can generate high-quality images, it is difficult to use diffusion models in real-world scenarios due to the iterative noise removal process. Early work on diffusion models has the problem that hundreds to thousands of iterative inferences are required to generate a single image, resulting in very slow sampling rates.

한편, 확산 모델의 액티베이션 값 분포는 반복적인 노이즈 제거 과정으로 인해 시간 단계에 따라 크게 변한다. 또한 확산 모델의 양자화에 대한 가장 큰 도전은 양자화 오류를 최소화 하기 위한 액티베이션 값에 대한 최적의 양자화 파라미터를 찾는 것이다. 이러한 종래의 양자화 관련 기술은, 확산 모델의 노이즈 제거 과정에 따라 액티베이션 값의 분포가 변화함에도 불구하고 이런 분포변화에 대응하는 방법이 없기 때문에 액티베이션 값의 비트 수를 낮춤에 따라 큰 품질 하락이 생기는 문제가 있다.Meanwhile, the distribution of the activation value of the diffusion model changes significantly depending on the time step due to the repeated noise removal process. In addition, the biggest challenge for the quantization of the diffusion model is to find the optimal quantization parameter for the activation value to minimize the quantization error. These conventional quantization-related techniques have a problem in that there is a significant quality degradation as the number of bits of the activation value decreases because there is no method to respond to this distribution change even though the distribution of the activation value changes according to the noise removal process of the diffusion model.

기존 동적 양자화(Dynamic Quantization) 방법은 양자화 파라미터를 정하기 위해 각 입력 데이터로부터 정보를 추출하는 과정이 필요하다. 기존 동적 양자화는 액티베이션의 다양한 입력 종속 분포에 따라 양자화 간격을 조정할 수 있게 하며, 양자화 오류를 줄일 수 있다. 그러나 기존의 동적 양자화 접근 방식은 액티베이션에서 통계적 정보를 추출하는 데 추가 비용이 발생하여 실제로 성능 개선을 달성하기 어렵다. 즉, 각 입력 데이터로부터 정보를 추출하는 과정은 큰 오버헤드를 초래해 수행시간을 느리게 만들 수 있다는 문제가 있다.The existing dynamic quantization method requires a process of extracting information from each input data to determine the quantization parameter. The existing dynamic quantization can adjust the quantization interval according to the various input-dependent distributions of the activation, and can reduce the quantization error. However, the existing dynamic quantization approach has an additional cost in extracting statistical information from the activation, making it difficult to achieve actual performance improvement. In other words, the process of extracting information from each input data causes a large overhead, which can slow down the execution time.

따라서 본 발명에서는 시간 단계 정보를 기반으로 적절한 양자화 간격을 생성하여 액티베이션 양자화 오류를 최소화하는 확산 모델에 대한 새로운 양자화 방법을 제공하고자 한다. 본 발명의 일 실시예에 따르면 추론 시 추가적인 추론 비용이 들지 않는다는 효과가 있다.Therefore, the present invention aims to provide a new quantization method for a diffusion model that minimizes activation quantization error by generating an appropriate quantization interval based on time step information. According to one embodiment of the present invention, there is an effect that no additional inference cost is incurred during inference.

도 2는 본 발명의 일 실시예에 따라 시간 단계에 따른 확산 모델의 액티베이션 값의 분포를 설명하기 위한 도면이다.FIG. 2 is a diagram for explaining the distribution of activation values of a diffusion model according to time steps according to one embodiment of the present invention.

그래프(11) 및 그래프(12)는 다양한 시간 단계(T)에 걸쳐 CIFAR-10 데이터 세트에서 학습된 DDIM 모델의 액티베이션(activation, 활성화)의 최대값과 최소값을 나타낸다.Graphs (11) and (12) show the maximum and minimum values of activation of the DDIM model trained on the CIFAR-10 data set over various time steps (T).

구체적으로는 그래프(11) 및 그래프(12)는 DDIM 모델의 서로 다른 레이어에서 획득한 액티베이션의 최대값과 최소값을 나타낸다.Specifically, graphs (11) and (12) represent the maximum and minimum values of activation obtained from different layers of the DDIM model.

그래프(11) 및 그래프(12)를 통해 확산 모델의 액티베이션 분포는 반복적 노이즈 제거 프로세스로 인해 고유한 특성을 가지며, 상기 분포는 레이어 인덱스와 관계없이 시간 단계(t)에 따라 크게 달라짐을 알 수 있다.Through graphs (11) and (12), it can be seen that the activation distribution of the diffusion model has unique characteristics due to the iterative noise removal process, and that the distribution varies significantly depending on the time step (t) regardless of the layer index.

도 3은 본 발명의 일 실시예에 따라 시간 변화에 따른 양자화 오류의 변화를 설명하기 위한 도면이다.FIG. 3 is a diagram for explaining changes in quantization error over time according to one embodiment of the present invention.

그래프들(21, 22, 31, 32)의 가로축은 시간 단계를 나타내고, 세로축은 액티베이션 값을 나타낸다.The horizontal axis of the graphs (21, 22, 31, 32) represents time steps, and the vertical axis represents activation values.

그래프(21) 및 그래프(31)는 시간 단계가 T=0일 때의 그래프이며, 그래프(22) 및 그래프(32)는 시간 단계가 T=100일 때의 그래프이다.Graph (21) and graph (31) are graphs when the time step is T=0, and graph (22) and graph (32) are graphs when the time step is T=100.

양자화 파라미터에 정적 값을 사용하면 도 3에서와 같이 다른 시간 단계에 대해 상당한 양자화 오류가 발생한다.Using static values for the quantization parameters results in significant quantization errors for different time steps, as shown in Fig. 3.

예컨대, 그래프(21) 및 그래프(22)를 함께 참조하면, 양자화 간격을 T=0일 때의 간격(D1)에 맞춰 확산 모델의 노이즈 제거 과정을 진행하는 경우, 시간 단계가 진행됨에 따라 시간 단계가 T=100일 때 상당한 양자화 오류 (즉, 절단 오류(Truncation error))가 발생함을 알 수 있다.For example, referring to graph (21) and graph (22) together, when the noise removal process of the diffusion model is performed with the quantization interval adjusted to the interval (D1) when T=0, it can be seen that a significant quantization error (i.e., truncation error) occurs when the time step is T=100 as the time step progresses.

반면, 그래프(31) 및 그래프(32)를 함께 참조하면, 양자화 간격을 T=100일 때의 간격(D2)에 맞춰 확산 모델의 노이즈 제거 과정을 진행하는 경우, 시간 단계가 진행됨에 따라 시간 단계가 T=0일 때 양자화 오류 (즉, 반올림 오류(Rounding error))가 발생함을 알 수 있다.On the other hand, referring to graph (31) and graph (32) together, when the noise removal process of the diffusion model is performed with the quantization interval adjusted to the interval (D2) when T=100, it can be seen that as the time step progresses, a quantization error (i.e., a rounding error) occurs when the time step is T=0.

종래에는 전체 시간 프레임에서 교정 데이터 세트를 샘플링하여 양자화 오류를 해결하려고 시도했다. 그러나 이러한 시도에도 불구하고 여전히 정적 파라미터에 의존하여 양자화 오류를 최소화하는 최적이 아닌 수렴을 초래했다.Traditionally, attempts have been made to address quantization errors by sampling a calibration dataset over the entire time frame. However, despite these attempts, they still rely on static parameters, resulting in suboptimal convergence for minimizing quantization errors.

상술한 문제를 근본적으로 해결하려면 입력 액티베이션 분포의 동역학을 고려하여 양자화 파라미터를 업데이트할 수 있도록 하는 것이 중요하다.To fundamentally solve the above-mentioned problem, it is important to be able to update the quantization parameters by considering the dynamics of the input activation distribution.

따라서, 본 발명의 일 목적은 양자화 오류를 최소화하는 액티베이션을 위한 최적의 양자화 파라미터(s 및 z)를 생성하여 제공하는 것이다.Accordingly, one object of the present invention is to generate and provide optimal quantization parameters (s and z) for activation that minimize quantization error.

본 발명에 따른 양자화 함수는 다음과 같이 정의될 수 있다. 본 발명에서는 2b개의 가능한 양자화 레벨들이 균일하게 간격을 두고 있는 b-비트 선형 양자화에 초점을 맞춘다. 선형 양자화에는 두 가지 핵심 하이퍼파라미터로서, 양자화 간격(s)와 제로 오프셋(z)이 포함될 수 있다. 전체 정밀도 데이터(x)가 주어지면, 양자화된 값(), 및 역양자화된 값 (dequantization된 값)()은 수학식 3 및 수학식 4를 통해 계산할 수 있다.The quantization function according to the present invention can be defined as follows. The present invention focuses on b-bit linear quantization where 2b possible quantization levels are evenly spaced. Linear quantization may include two key hyperparameters: quantization interval (s) and zero offset (z). Given full precision data (x), the quantized value ( ), and dequantized values ( ) can be calculated using mathematical expressions 3 and 4.

이때, n은 가장 작은 양자화 인덱스 p는 가장 큰 양자화 인덱스를 의미한다. clip(·)은 클리핑 함수이며,는 반올림 함수이다.Here, n means the smallest quantization index and p means the largest quantization index. clip(·) is a clipping function. is a rounding function.

이때, 본 발명의 일 실시예에서 양자화 간격(s)은 양자화 파라미터 또는 양자화 스텝 사이즈로 지칭될 수 있다.At this time, in one embodiment of the present invention, the quantization interval (s) may be referred to as a quantization parameter or a quantization step size.

실제적인 모델 계산의 가속 목적을 위해 가중치에 대해 대칭 양자화를 활용할 수 있다. 이때, z = 0이고 p = -n = 2(b-1) - 1일 수 있다. 반면, 액티베이션 양자화의 경우

Figure pat00011
, n = 0, p = 2b - 1인 비대칭 양자화를 가정할 수 있으며, 이러한 접근 방식은 일반적으로 채택되는 접근 방식일 수 있다.For the purpose of accelerating the computation of practical models, symmetric quantization can be utilized for the weights. In this case, z = 0 and p = -n = 2(b-1) - 1. On the other hand, in the case of activation quantization,
Figure pat00011
, we can assume an asymmetric quantization with n = 0, p = 2b - 1, which may be a commonly adopted approach.

도 4는 종래의 비교 실시예에 따른 동적 양자화 방법을 설명하기 위한 도면이다.Fig. 4 is a diagram for explaining a dynamic quantization method according to a conventional comparative example.

종래의 동적 양자화 방법은 확산 모델의 훈련과 추론 중에 양자화 간격(quantization interval)(s)을 계산하기 위해 액티베이션 통계를 필요로 하는 입력-종속 (input-dependent) 동적 양자화 방법이다. 즉, 훈련과 추론 시마다 매번 양자화 간격(s)을 계산해야 하며, 추론 시 양자화 간격(s)을 계산함으로써 추가적인 오버헤드가 발생한다는 단점이 있다.The conventional dynamic quantization method is an input-dependent dynamic quantization method that requires activation statistics to calculate the quantization interval (s) during training and inference of the diffusion model. That is, the quantization interval (s) must be calculated every time during training and inference, and there is a disadvantage in that additional overhead occurs by calculating the quantization interval (s) during inference.

동적 모듈(60)은 레이어 액티베이션(41)의 액티베이션 통계(

Figure pat00012
)를 이용하여 양자화 간격(s)을 생성할 수 있다.The dynamic module (60) provides activation statistics of layer activation (41).
Figure pat00012
) can be used to generate a quantization interval (s).

생성된 양자화 간격(s)은 양자화 연산자(Quantization)(50)에 제공되며, 양자화 연산자(50)는 양자화 간격(s)을 이용하여 레이어 액티베이션(41)을 양자화한, 양자화된 액티베이션(42)을 생성할 수 있다.The generated quantization interval (s) is provided to a quantization operator (50), and the quantization operator (50) can generate a quantized activation (42) by quantizing the layer activation (41) using the quantization interval (s).

후술하는 본 발명의 일 실시예에 따르면, TDQ 모듈을 이용하여 미리 계산된 양자화 간격들을 기반으로 추가 비용 없이 추론이 가능하다는 효과가 있다.According to one embodiment of the present invention described below, there is an effect that inference is possible without additional cost based on pre-calculated quantization intervals using a TDQ module.

도 5는 본 발명의 일 실시예에 따른 TDQ 모듈을 이용한 양자화 방법을 설명하기 위한 도면이다.FIG. 5 is a diagram for explaining a quantization method using a TDQ module according to one embodiment of the present invention.

입력 액티베이션 (input activation)의 빠른 변화를 해결하기 위해, 생각하기 쉬운 한 가지 방법은 입력 종속 동적 양자화일 수 있다. 도 4에서 설명한 바와 같이 종래의 기술에서는 최소값, 최대값 및 평균값과 같은 입력 특징을 기반으로 양자화 파라미터(s)를 생성하는 양자화 동적 모듈(60)을 통합하여 특정 어플리케이션(즉, 확산 모델)의 정확도가 향상될 수 있음을 설명하였다.To address the rapid changes in input activation, one easy-to-think-of approach could be input-dependent dynamic quantization. As described in Fig. 4, prior art has shown that the accuracy of a specific application (i.e., diffusion model) can be improved by incorporating a quantization dynamic module (60) that generates quantization parameters (s) based on input features such as minimum, maximum, and mean.

상기 입력 종속 동적 양자화를 통해 확산 모델의 생성 이미지의 품질을 향상시킬 수 있다. 그러나 주어진 액티베이션에 대한 통계를 수집하는 프로세스는 복잡한 구현과 눈에 띄는 오버헤드를 도입한다.The quality of the generated images of the diffusion model can be improved through the above input-dependent dynamic quantization. However, the process of collecting statistics for a given activation introduces complex implementation and noticeable overhead.

따라서 본 발명에서는 입력 액티베이션보다는 시간(temporal) 정보를 활용하는 새로운 동적 양자화를 제공하고자 한다.Therefore, the present invention aims to provide a new dynamic quantization that utilizes temporal information rather than input activation.

도 2를 참조하면, 액티베이션 분포는 입력 데이터 (즉, 입력 액티베이션)에 따라 변경될 수 있지만, 동일한 시간 프레임 내에서 전반적인 추세는 유사하다. 따라서 본 발명의 일 실시예에 따르면, 시간 단계의 차이에 따라 최적의 간격을 생성함으로써 보다 신뢰할 수 있고 견고한 양자화 결과를 얻을 수 있다.Referring to Fig. 2, the activation distribution may change depending on the input data (i.e., input activation), but the overall trend is similar within the same time frame. Therefore, according to one embodiment of the present invention, more reliable and robust quantization results can be obtained by generating an optimal interval depending on the difference in time steps.

TDQ 모듈(130)에서 동적 간격()는 수학식 5와 같이 제공된 시간 단계(t)를 기반으로 생성될 수 있다.Dynamic spacing (in the TDQ module (130) ) can be generated based on the time step (t) provided as in mathematical expression 5.

이때, enc(·)는 시간 단계의 인코딩 함수를 나타내고,I는 인코딩된 특징을 나타내고, f(·)는 TDQ 모듈 함수를 나타낸다.Here, enc(·) represents the encoding function of the time step,I represents the encoded feature, and f(·) represents the TDQ module function.

TDQ 모듈(130)은 각 양자화 연산자(140)에 연결되고, 독립적인 동적 양자화 간격(s)은 주어진 시간 단계에 따라 생성될 수 있다.The TDQ module (130) is connected to each quantization operator (140), and an independent dynamic quantization interval (s) can be generated according to a given time step.

TDQ 모듈(130)은 데이터 범위를 음이 아닌 값으로 제한하기 위해 소프트플러스 함수 (softplus function)로 여러 선형 레이어를 간단히 쌓아서 구현될 수 있다. TDQ 모듈(130)의 모든 구성 요소는 미분 가능할 수 있다. 결과적으로 PTQ 또는 QAT 프로세스 동안 경사 하강을 사용하여 양자화 오류를 최소화하는 방향으로 양자화 간격(s)을 업데이트할 수 있다. 예컨대, LSQ와 같은 잘 알려진 QAT 알고리즘을 사용하는 경우 정적 간격을 TDQ 모듈(130)의 출력으로 대체할 수 있다. 이때, 수학식 3 및 수학식 4의 양자화 함수는 수학식 6 및 수학식 7과 같이 수정될 수 있다.The TDQ module (130) can be implemented by simply stacking several linear layers with a softplus function to restrict the data range to non-negative values. All components of the TDQ module (130) can be differentiable. As a result, the quantization interval (s) can be updated in a direction that minimizes the quantization error by using gradient descent during the PTQ or QAT process. For example, when a well-known QAT algorithm such as LSQ is used, the static interval can be replaced with the output of the TDQ module (130). In this case, the quantization functions of Equations 3 and 4 can be modified as in Equations 6 and 7.

예컨대, 직접 추정기 (straight-through estimator)를 사용할 때 그래디언트(gradient)는 TDQ 모듈(130)의 학습 가능한 파라미터(s)를 통해 전파될 수 있다. 그런 다음 상기 파라미터(s)는 최종 작업 손실을 최소화하는 목표로 반복적 그래디언트 하강을 통해 업데이트될 수 있다.For example, when using a straight-through estimator, the gradient can be propagated through the learnable parameters (s) of the TDQ module (130). The parameters (s) can then be updated through iterative gradient descent with the goal of minimizing the final task loss.

QAT 프로세스에 적용되는 파이프라인과 동일한 파이프라인이 재구성 오류를 최소화하는 로컬 그래디언트를 활용하는 PTQ 알고리즘에 적용될 수 있다. 결과적으로 TDQ 모듈(130)은 QAT 및 PTQ 알고리즘에 모두 쉽게 적용할 수 있다.The same pipeline applied to the QAT process can be applied to the PTQ algorithm that utilizes local gradients to minimize reconstruction error. As a result, the TDQ module (130) can be easily applied to both the QAT and PTQ algorithms.

이때, 상술한 입력 종속 동적 양자화와 달리 TDQ 모듈(130)은 비용 없는 추론을 가능하게 할 수 있다.At this time, unlike the input dependent dynamic quantization described above, the TDQ module (130) can enable cost-free inference.

PTQ 또는 QAT 프로세스 후에 본 발명에 따른 시간 종속 간격(s)은 오프라인에서 미리 계산될 수 있으며 추론 중에 상기 미리 계산된 값을 활용할 수 있다. 또한 수정 없이 기존 프레임워크에 TDQ 모듈(130)을 원활하게 통합할 수 있어 강력한 이점을 제공할 수 있다.After the PTQ or QAT process, the time-dependent interval (s) according to the present invention can be pre-computed offline and the pre-computed value can be utilized during inference. In addition, the TDQ module (130) can be seamlessly integrated into the existing framework without modification, which can provide a powerful advantage.

이때, 본 발명의 일 실시예에서 TDQ 모듈(130)의 안정성과 효과를 향상시키기 위해 시간 단계 (time step)의 주파수 인코딩 및 TDQ 모듈(130)의 초기화를 진행할 수 있다.At this time, in order to improve the stability and effectiveness of the TDQ module (130) in one embodiment of the present invention, frequency encoding of time steps and initialization of the TDQ module (130) can be performed.

이하, 상기 시간 단계의 주파수 인코딩에 대해 설명한다.Below, frequency encoding of the above time steps is described.

시간 단계를 TDQ 모듈(130)에 직접 입력하면 수렴 품질이 떨어질 수 있다. 이러한 이유는 주로 신경망의 잘 알려진 저주파 유도 바이어스 때문이다. 상기 시간 단계를 TDQ 모듈(130)에 직접 입력하는 경우 변경되는 시간 단계에 관계없이 거의 변하지 않는 간격을 생성하는 경향이 있다. 상기 저주파 바이어스를 완화하기 위해 수학식 5와 같이 시간 단계에 대한 기하학적 푸리에 인코딩을 사용할 수 있다. 예컨대, 인코딩된 특징은 수학식 8과 같이 계산될 수 있다.If the time step is directly input to the TDQ module (130), the convergence quality may be degraded. This is mainly due to the well-known low-frequency induced bias of the neural network. If the time step is directly input to the TDQ module (130), it tends to generate an interval that is almost unchanged regardless of the changing time step. In order to alleviate the low-frequency bias, geometric Fourier encoding for the time step can be used as in Equation 5. For example, the encoded feature can be calculated as in Equation 8.

이때, t는 현재 시간 단계이고, d는 인코딩 벡터의 차원이며, I는 인코딩된 벡터를 의미한다.Here, t is the current time step, d is the dimension of the encoding vector, and I means the encoded vector.

수학식 8을 이용한 인코딩 접근 방식은 TDQ 모듈(130)이 시간 단계의 고주파 역학을 수용할 수 있게 한다. 이때, 본 발명의 일 실시예에서 tmax는 10000으로 설정될 수 있다.The encoding approach using Equation 8 enables the TDQ module (130) to accommodate high frequency dynamics of the time step. In this case, in one embodiment of the present invention, tmax can be set to 10000.

이하, TDQ 모듈(130)의 초기화에 대해 설명한다.Below, the initialization of the TDQ module (130) is described.

양자화 간격(s)의 적절한 초기화는 매우 중요하다. 잘못된 초기화는 QAT 또는 PTQ 프로세스에서 불안정성을 초래할 수 있기 때문이다. 기존 양자화 기술은 정적 단계 값만 초기화하면 되지만, 본 발명에서는 TDQ 모듈(130)의 출력을 원하는 값으로 초기화해야 한다.Proper initialization of the quantization interval (s) is very important, because incorrect initialization can lead to instability in the QAT or PTQ process. While conventional quantization techniques only require the initialization of static step values, the present invention requires the output of the TDQ module (130) to be initialized to a desired value.

본 발명의 일 실시예에서, 상기 출력을 원하는 값으로 초기화하기 위해, 가중치에 He 초기화를 활용하고 TDQ 모듈 (즉, MLP)의 마지막 선형 계층의 바이어스를 원하는 값으로 설정할 수 있다.In one embodiment of the present invention, in order to initialize the output to a desired value, He initialization may be utilized for the weights and the bias of the last linear layer of the TDQ module (i.e., MLP) may be set to a desired value.

MLP(multi layer perceptron)에 대한 입력 (즉, 시간 인덱스에 기하학적 푸리에 인코딩을 적용하여 획득한 값)을 평균이 0인 확률 변수로 처리할 수 있다는 점을 감안할 때, He로 초기화된 MLP의 출력도 평균이 0일 수 있다. 따라서 바이어스 조정을 통해 MLP 출력의 평균을 원하는 값으로 제어할 수 있다. 전체 시간 단계에 대해 1000개의 샘플을 추출한 후, 전체 오류를 최소화하기 위해 양자화 간격을 초기화한 다음 각 시간 단계에 적응할 수 있도록 업데이트 할 수 있다.Given that the input to a multilayer perceptron (MLP) (i.e., the values obtained by applying geometric Fourier encoding to the time indices) can be treated as random variables with zero mean, the output of an MLP initialized with He can also have zero mean. Therefore, the mean of the MLP output can be controlled to a desired value by adjusting the bias. After extracting 1000 samples for all time steps, the quantization interval can be initialized to minimize the overall error, and then updated to adapt to each time step.

도 6은 본 발명의 일 실시예에 따른 TDQ 모듈의 학습을 위한 컴퓨팅 시스템의 개략도이다.FIG. 6 is a schematic diagram of a computing system for learning a TDQ module according to one embodiment of the present invention.

컴퓨팅 시스템(100)은, 프로세서(110), 확산 모델(120), 양자화 간격을 생성하기 위한 신경망(즉, TDQ 모듈)(130), 양자화 연산자(140)를 포함할 수 있다.The computing system (100) may include a processor (110), a diffusion model (120), a neural network (i.e., a TDQ module) (130) for generating quantization intervals, and a quantization operator (140).

도 7은 본 발명의 일 실시예에 따른 확산 모델을 위한 양자화 학습 방법을 설명하기 위한 순서도이다.FIG. 7 is a flowchart illustrating a quantization learning method for a diffusion model according to one embodiment of the present invention.

이하, 도 5 내지 도 7을 함께 참조하여 설명한다.Below, the description is given with reference to FIGS. 5 to 7.

이하의 단계들은 프로세서(110)에 의해 수행될 수 있다.The following steps may be performed by the processor (110).

신경망(130)을 학습 시키기 이전에, 미리 학습된 확산 모델(120)을 준비할 수 있다.Before training the neural network (130), a pre-trained diffusion model (120) can be prepared.

그 후, 확산 모델(120)에 양자화 연산자(140)를 추가하고, 양자화 연산자(140)에 신경망(즉, TDQ 모듈)(130)을 추가할 수 있다.After that, a quantization operator (140) can be added to the diffusion model (120), and a neural network (i.e., TDQ module) (130) can be added to the quantization operator (140).

단계(S310)에서, 확산 모델(120)에 대한 현재 시간 단계(T) 정보를 신경망(130)에 입력하여 현재 시간 단계(T) 정보에 대한 양자화 간격(quantization interval, quantization step size)(s)을 획득할 수 있다.In step (S310), the current time step (T) information for the diffusion model (120) can be input into the neural network (130) to obtain a quantization interval (quantization step size) (s) for the current time step (T) information.

이때, 단계(S310)는 확산 모델(120)에 대한 현재 시간 단계(T) 정보를 주파수 인코딩하는 단계, 및 상기 인코딩된 현재 시간 단계 정보를 신경망(130)에 입력하는 단계를 포함할 수 있다.At this time, step (S310) may include a step of frequency encoding current time step (T) information for a diffusion model (120), and a step of inputting the encoded current time step information into a neural network (130).

이때, 단계(S310) 이전에 신경망(130)의 출력 데이터를 초기화하는 단계를 더 수행할 수 있다.At this time, a step of initializing the output data of the neural network (130) can be further performed before step (S310).

단계(S320)에서, 상기 획득한 양자화 간격을 확산 모델(120)의 양자화 연산자(quantization operator)(140)에 제공할 수 있다. 예컨대, 양자화 연산자(140)는 QAT 또는 PTQ 알고리즘과 병렬적으로 적용되여 기존 알고리즘을 그대로 활용하면서도 시간에 따라 가변적인 양자화 간격을 제공해주는 모듈로 활용될 수 있다.In step (S320), the acquired quantization interval can be provided to the quantization operator (140) of the diffusion model (120). For example, the quantization operator (140) can be applied in parallel with the QAT or PTQ algorithm, and can be utilized as a module that provides a variable quantization interval over time while utilizing the existing algorithm as it is.

단계(S330)에서, 확산 모델(120)의 양자화 연산자(140)로 하여금, 상기 생성된 양자화 간격(s)을 이용하여 확산 모델(120)의 텐서 데이터(201, 202)를 양자화시킬 수 있다. 이때, 상기 텐서 데이터는 액티베이션 데이터와 가중치 데이터 각각을 의미하거나 둘 다를 포함하는 개념일 수 있다.In step (S330), the quantization operator (140) of the diffusion model (120) can quantize the tensor data (201, 202) of the diffusion model (120) using the generated quantization interval (s). At this time, the tensor data may mean each of the activation data and the weight data, or may be a concept including both.

단계(S340)에서, 상기 양자화된 결과를 이용하여 양자화 오차를 생성할 수 있다.In step (S340), a quantization error can be generated using the quantized result.

단계(S350)에서, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격 또는 신경망 가중치를 학습시킬 수 있다.In step (S350), the quantization interval can be updated using the quantization error to learn the quantization interval or neural network weight of the neural network.

이때, 상기 신경망은 경사하강법을 이용하여 학습된 것일 수 있다.At this time, the neural network may be trained using gradient descent.

이때, 확산 모델(120)의 가중치는 알고리즘의 종류(QAT, PTQ)에 따라 학습될 수도 또는 고정될 수도 있다. 즉, PTQ를 적용할 때에 확산 모델(120)의 가중치는 고정된 상태에서 진행이 되더라도, TDQ 모듈(130)의 파라미터(신경망 가중치)는 시간에 대해 적합한 간격을 만들어 낼 수 있도록 업데이트될 수 있다.At this time, the weight of the diffusion model (120) may be learned or fixed depending on the type of algorithm (QAT, PTQ). That is, even if the weight of the diffusion model (120) is fixed when applying PTQ, the parameters (neural network weights) of the TDQ module (130) may be updated to create an appropriate interval for time.

종래의 정적 양자화의 알고리즘들(예컨대 QAT)이 분포에 맞게 양자화 간격(s)를 튜닝하는 정도의 능력을 갖고 있다. 다만, 종래의 알고리즘들은 모든 시간 단계에 대해서 똑같은 양자화 간격(s)를 쓰기 때문에 시간 단계마다 다른 양자화 간격을 학습시키지 못했다. 그러나 본 발명의 TDQ 모듈을 양자화 연산자에 추가하여 각 시간마다 어떤 양자화 간격이 제일 좋을지를 자동으로 학습을 하게 하면 각 시간 단계마다 가장 좋은 양자화 간격이 학습될 수 있다.Conventional static quantization algorithms (e.g., QAT) have the ability to tune the quantization interval (s) to fit the distribution. However, since the conventional algorithms use the same quantization interval (s) for all time steps, they cannot learn different quantization intervals for each time step. However, if the TDQ module of the present invention is added to the quantization operator to automatically learn which quantization interval is the best for each time step, the best quantization interval can be learned for each time step.

신경망(TDQ 모듈)(130)의 학습이 끝나면 신경망(130)은 매 시간 단계마다 적절한 값의 양자화 간격을 생성해낼 수 있다.After the training of the neural network (TDQ module) (130) is completed, the neural network (130) can generate an appropriate quantization interval value for each time step.

확산 모델(120)의 추론시에, 컴퓨팅 시스템(100) 또는 이미지 생성 장치는 학습이 완료된 신경망(130)을 포함하되, 처음 시간 단계에 따라 서로 다른 양자화 간격을 생성하는 용도로 한번 사용될 수 있다.When inferring a diffusion model (120), a computing system (100) or an image generation device may include a neural network (130) that has completed learning, but may be used once for the purpose of generating different quantization intervals according to the first time step.

구체적으로 프로세서(110)는, 확산 모델(120)에 현재 시간 단계(T) 정보 및 입력 이미지를 입력하여 노이즈가 제거된 출력 이미지를 생성할 수 있다. 프로세서(110)는 상기 출력 이미지를 생성하는 과정에서, 상기 현재 시간 단계(T) 정보에 대한 미리 저장된 양자화 간격(s)을 이용하여 확산 모델(120)의 하나 이상의 텐서 데이터를 양자화할 수 있다.Specifically, the processor (110) can input current time step (T) information and an input image to the diffusion model (120) to generate an output image from which noise has been removed. In the process of generating the output image, the processor (110) can quantize one or more tensor data of the diffusion model (120) using a pre-stored quantization interval (s) for the current time step (T) information.

이때, 상기 미리 저장된 양자화 간격은 확산 모델(120)의 시간 단계에 따라 양자화 간격이 서로 다르게 생성되어 저장된 것일 수 있다. 기존 양자화 방법과 달리 시간에 따라 적절한 양자화 간격이 다르게 생성된다. 이때 상기 간격이 입력 데이터와 관계 없이 미리 연산할 수 있는 값이므로 각 시간 단계마다 적합한 간격을 한번에 생성하여 컴퓨팅 시스템 즉, 이미지 생성 장치의 메모리에 저장해놓고 필요할 때마다 가져와 사용할 수 있다.At this time, the pre-stored quantization interval may be generated and stored differently according to the time step of the diffusion model (120). Unlike the existing quantization method, an appropriate quantization interval is generated differently according to time. At this time, since the interval is a value that can be calculated in advance regardless of the input data, an appropriate interval can be generated at once for each time step and stored in the memory of the computing system, i.e., the image generation device, and retrieved and used whenever necessary.

따라서, 확산 모델(120)의 추론시에는 시간 단계에 따라 다른 값을 갖도록 생성되는 양자화 간격을 계산하는 과정 없이 미리 저장된 값을 이용하기 때문에 계산 과정에 대한 추가 비용이 들지 않을 수 있다는 장점이 있다.Therefore, when inferring the diffusion model (120), there is an advantage in that no additional cost for the calculation process may be incurred because pre-stored values are used without a process of calculating quantization intervals that are generated to have different values depending on the time step.

본 발명의 다른 실시예에서, 처음 시간 단계마다 서로 다른 양자화 간격을 생성한 이후, 응용에 따라 TDQ 모듈(130)을 활용하여 적합한 시간 간격 (즉, 양자화 간격)을 다시 생성할 수도 있다.In another embodiment of the present invention, after generating different quantization intervals for each initial time step, a TDQ module (130) may be utilized to regenerate a suitable time interval (i.e., quantization interval) depending on the application.

본 발명의 TDQ 모듈은 다양한 종래의 양자화 알고리즘들에 추가하여 이용할 수 있다는 장점이 있다.The TDQ module of the present invention has the advantage of being able to be used in addition to various conventional quantization algorithms.

도 8은 본 발명의 일 실시예에 따라 TDQ 모듈을 이용했을 때와 이용하지 않았을 때의 양자화된 확산 모델의 출력 성능 비교를 설명하기 위한 도면이다.FIG. 8 is a diagram for explaining a comparison of the output performance of a quantized diffusion model when a TDQ module is used and when it is not used according to one embodiment of the present invention.

도 8의 CIFAR-10 데이터 세트를 이용하여 DDIM 모델의 W4A4 QAT 를 실행한 결과의 이미지들이다.These are images of the results of running W4A4 QAT of the DDIM model using the CIFAR-10 data set in Fig. 8.

첫번째 행의 이미지들은 본 발명의 TDQ 모듈을 이용하여 미리 생성하여 저장된 시간 단계에 따라 서로 다른 양자화 간격을 이용하여 양자화된 확산 모델이 생성한 이미지들이다.The images in the first row are images generated by a quantized diffusion model using different quantization intervals according to time steps that were previously generated and stored using the TDQ module of the present invention.

두번째 행의 이미지들은 종래의 LSQ 모듈을 이용하여 양자화된 확산 모델이 생성한 이미지들이다.The images in the second row are images generated by a quantized diffusion model using a conventional LSQ module.

첫번째 행과 두번째 행의 이미지들을 비교하면, 본 발명의 TDQ 모듈의 경우 동일한 비트 폭 구성 내에서 높은 충실도의 이미지를 생성하는 데 있어 다른 양자화 기술보다 지속적으로 우수한 성과를 보임을 알 수 있다.Comparing the images in the first and second rows, it can be seen that the TDQ module of the present invention consistently outperforms other quantization techniques in generating high fidelity images within the same bit width configuration.

두번째 행의 QAT가 흐릿하고 알아볼 수 없는 이미지를 생성하는 반면, 첫번째 행의 본 발명의 방법은 두번째 행의 이미지들보다 더욱 사실적인 이미지를 생성함을 알 수 있다.It can be seen that the QAT in the second row produces blurry and unrecognizable images, while the present invention's method in the first row produces more realistic images than the images in the second row.

본 발명의 일 실시예에 따르면, 액티베이션 양자화에서 시간 정보를 통합하는 것은 이미지 출력의 지각적 품질을 유지하는 데 매우 효과적임을 알 수 있다.According to one embodiment of the present invention, it can be seen that incorporating temporal information in activation quantization is very effective in maintaining the perceptual quality of image output.

도 9는 본 발명의 일 실시예에 따라 TDQ 모듈을 이용했을 때와 이용하지 않았을 때의 양자화된 확산 모델의 출력 성능 비교를 설명하기 위한 도면이다.FIG. 9 is a diagram for explaining a comparison of the output performance of a quantized diffusion model when a TDQ module is used and when it is not used according to one embodiment of the present invention.

도 9의 LSUN-churches 데이터 세트를 이용하여 LDM(Latent Diffusion Models)의 W8A5 PTQ를 실행한 결과의 이미지들로서, 노이즈 제거 과정 수 변화에 따른 일반화 성능을 보여주기 위한 이미지들이다.These are images of the results of running W8A5 PTQ of LDM (Latent Diffusion Models) using the LSUN-churches data set in Fig. 9. These images are intended to show the generalization performance according to the number of noise removal processes.

첫번째 행의 이미지들은 본 발명의 TDQ 모듈을 이용하여 미리 생성하여 저장된 시간 단계에 따라 서로 다른 양자화 간격을 이용하여 양자화된 확산 모델이 생성한 이미지들이다.The images in the first row are images generated by a quantized diffusion model using different quantization intervals according to time steps that were previously generated and stored using the TDQ module of the present invention.

두번째 행의 이미지들은 종래의 PTQ4DM 모듈을 이용하여 양자화된 확산 모델이 생성한 이미지들이다.The images in the second row are images generated by a quantized diffusion model using the conventional PTQ4DM module.

첫번째 행과 두번째 행의 생성 이미지들을 비교하면, 첫번째 행의 생성 이미지들의 품질이 뛰어남을 알 수 있다.Comparing the generated images in the first and second rows, we can see that the quality of the generated images in the first row is superior.

본 발명에 따르면, 확산 모델의 양자화 시 성능 하락을 최소화 하는 방법을 제공할 수 있다. 또한, 본 발명에 따르면, 확산 모델의 시간 단계에 따라 변화하는 액티베이션 값 분포 변화에 대응하기 위해 시간 단계에 따라 다른 양자화 간격을 사용하는 방법, 시간 단계 정보를 입력, 양자화 간격을 출력으로 하는 신경망을 학습하는 방법을 제공할 수 있다.According to the present invention, a method for minimizing performance degradation during quantization of a diffusion model can be provided. In addition, according to the present invention, a method for using different quantization intervals according to time steps in order to respond to changes in the distribution of activation values that change according to time steps of a diffusion model, and a method for learning a neural network that inputs time step information and outputs quantization intervals can be provided.

본 발명은 확산 모델 가속을 위한 양자화 방법에 관한 것으로 생성 모델, AI 시스템, 임베디드 시스템, 및 모바일 시스템과 관련된다.The present invention relates to a quantization method for accelerating a diffusion model, and relates to generative models, AI systems, embedded systems, and mobile systems.

한편, 확산 모델의 크기와 반복적인 생성으로 인한 높은 저장 및 계산 요구 사항은 모바일 장치에서의 사용을 방해한다. 본 발명에 따르면, 상술한 제한된 리소스를 가진 장치에서 확산 모델을 효과적으로 실행하는 데 도움이 될 수 있다.Meanwhile, the size of the diffusion model and the high storage and computational requirements due to repeated generation hinder its use on mobile devices. According to the present invention, it can be helpful to effectively execute the diffusion model on devices with limited resources as described above.

확산 모델은 이미지, 음성 및 텍스트 합성과 같은 시각적 응용 프로그램에서 뛰어난 생성 성능과 다양성으로 인해 인기를 얻는 있다. 본 발명은 상술한 응용 프로그램의 성능을 향상시키는 데 기여할 수 있다.Diffusion models have gained popularity due to their excellent generative performance and versatility in visual applications such as image, speech and text synthesis. The present invention can contribute to improving the performance of the above-described applications.

양자화는 모델 압축을 위한 널리 사용되는 기술로, 본 발명의 시간 양자화 방법은 기존의 양자화 기술에 비해 확산 모델의 출력 품질을 크게 향상시킬 수 있다.Quantization is a widely used technique for model compression, and the time quantization method of the present invention can significantly improve the output quality of the diffusion model compared to existing quantization techniques.

본 발명의 일 실시예에 따르면, 소스가 제한된 모바일 장치에서의 확산 모델의 효율적인 실행을 위해 본 발명의 양자화 방법이 적용될 수 있다. 이를 통해 고급 이미지 및 음성 처리 기능을 갖춘 모바일 애플리케이션의 성능을 향상시킬 수 있다.According to one embodiment of the present invention, the quantization method of the present invention can be applied for efficient execution of a diffusion model in a mobile device with limited source. This can improve the performance of mobile applications with advanced image and voice processing functions.

IoT 장치는 제한된 계산 능력을 가지고 있기 때문에, 본 발명의 최적화된 확산 모델 방법이 IoT 기반의 스마트 홈, 스마트 시티 등의 응용 프로그램에서의 이미지 및 음성 처리에 활용될 수 있다.Since IoT devices have limited computational capabilities, the optimized diffusion model method of the present invention can be utilized for image and voice processing in applications such as IoT-based smart homes and smart cities.

AR 및 VR 응용 프로그램에서는 실시간 이미지 및 음성 처리가 중요하다. 따라서 본 발명의 확산 모델 최적화 방법은 이러한 응용 프로그램의 성능을 향상시키는 데 도움이 될 수 있다.Real-time image and audio processing are important in AR and VR applications. Therefore, the diffusion model optimization method of the present invention can help improve the performance of such applications.

자동차 및 드론에서의 실시간 이미지 및 음성 처리는 안전과 성능에 있어서 중요한 부분이다. 본 발명의 양자화 방법은 자동차 및 드론의 센서 데이터 처리와 관련된 응용 프로그램에 적용될 수 있다.Real-time image and voice processing in automobiles and drones is an important part of safety and performance. The quantization method of the present invention can be applied to applications related to sensor data processing in automobiles and drones.

도 10은 도 1 내지 도 7의 과정의 적어도 일부를 수행할 수 있는 일반화된 이미지 생성 장치 또는 컴퓨팅 시스템의 예시를 도시하는 개념도이다.FIG. 10 is a conceptual diagram illustrating an example of a generalized image generating device or computing system capable of performing at least part of the processes of FIGS. 1 through 7.

본 발명의 일 실시예에 따른 확산 모델을 위한 양자화 학습 방법의 적어도 일부의 과정은 도 10의 컴퓨팅 시스템(1000)에 의하여 실행될 수 있다.At least a part of the process of the quantization learning method for a diffusion model according to one embodiment of the present invention can be executed by the computing system (1000) of FIG. 10.

도 10을 참조하면, 본 발명의 일 실시예에 따른 컴퓨팅 시스템(1000)은, 프로세서(1100), 메모리(1200), 통신 인터페이스(1300), 저장 장치(1400), 입력 인터페이스(1500), 출력 인터페이스(1600) 및 버스(bus)(1700)를 포함하여 구성될 수 있다.Referring to FIG. 10, a computing system (1000) according to one embodiment of the present invention may be configured to include a processor (1100), a memory (1200), a communication interface (1300), a storage device (1400), an input interface (1500), an output interface (1600), and a bus (1700).

본 발명의 일 실시예에 따른 컴퓨팅 시스템(1000)은, 적어도 하나의 프로세서(processor)(1100) 및 상기 적어도 하나의 프로세서(1100)가 적어도 하나의 단계를 수행하도록 지시하는 명령어들(instructions)을 저장하는 메모리(memory)(1200)를 포함할 수 있다. 본 발명의 일 실시예에 따른 방법의 적어도 일부의 단계는 상기 적어도 하나의 프로세서(1100)가 상기 메모리(1200)로부터 명령어들을 로드하여 실행함으로써 수행될 수 있다.A computing system (1000) according to one embodiment of the present invention may include at least one processor (1100) and a memory (1200) storing instructions that instruct the at least one processor (1100) to perform at least one step. At least some steps of a method according to one embodiment of the present invention may be performed by the at least one processor (1100) loading and executing instructions from the memory (1200).

프로세서(1100)는 중앙 처리 장치(central processing unit, CPU), 그래픽 처리 장치(graphics processing unit, GPU), 또는 본 발명의 실시예들에 따른 방법들이 수행되는 전용의 프로세서를 의미할 수 있다.The processor (1100) may mean a central processing unit (CPU), a graphics processing unit (GPU), or a dedicated processor on which methods according to embodiments of the present invention are performed.

메모리(1200) 및 저장 장치(1400) 각각은 휘발성 저장 매체 및 비휘발성 저장 매체 중에서 적어도 하나로 구성될 수 있다. 예를 들어, 메모리(1200)는 읽기 전용 메모리(read only memory, ROM) 및 랜덤 액세스 메모리(random access memory, RAM) 중에서 적어도 하나로 구성될 수 있다.Each of the memory (1200) and the storage device (1400) may be configured with at least one of a volatile storage medium and a nonvolatile storage medium. For example, the memory (1200) may be configured with at least one of a read only memory (ROM) and a random access memory (RAM).

또한, 컴퓨팅 시스템(1000)은, 무선 네트워크를 통해 통신을 수행하는 통신 인터페이스(1300)를 포함할 수 있다.Additionally, the computing system (1000) may include a communication interface (1300) that performs communication via a wireless network.

또한, 컴퓨팅 시스템(1000)은, 저장 장치(1400), 입력 인터페이스(1500), 출력 인터페이스(1600) 등을 더 포함할 수 있다.Additionally, the computing system (1000) may further include a storage device (1400), an input interface (1500), an output interface (1600), etc.

또한, 컴퓨팅 시스템(1000)에 포함된 각각의 구성 요소들은 버스(bus)(1700)에 의해 연결되어 서로 통신을 수행할 수 있다.Additionally, each component included in the computing system (1000) may be connected to each other by a bus (1700) and communicate with each other.

본 발명의 컴퓨팅 시스템(1000)의 예를 들면, 통신 가능한 데스크탑 컴퓨터(desktop computer), 랩탑 컴퓨터(laptop computer), 노트북(notebook), 스마트폰(smart phone), 태블릿 PC(tablet PC), 모바일폰(mobile phone), 스마트 워치(smart watch), 스마트 글래스(smart glass), e-book 리더기, PMP(portable multimedia player), 휴대용 게임기, 네비게이션(navigation) 장치, 디지털 카메라(digital camera), DMB(digital multimedia broadcasting) 재생기, 디지털 음성 녹음기(digital audio recorder), 디지털 음성 재생기(digital audio player), 디지털 동영상 녹화기(digital video recorder), 디지털 동영상 재생기(digital video player), PDA(Personal Digital Assistant) 등일 수 있다.Examples of the computing system (1000) of the present invention may include a desktop computer, a laptop computer, a notebook, a smart phone, a tablet PC, a mobile phone, a smart watch, a smart glass, an e-book reader, a portable multimedia player (PMP), a portable game console, a navigation device, a digital camera, a digital multimedia broadcasting (DMB) player, a digital audio recorder, a digital audio player, a digital video recorder, a digital video player, a PDA (Personal Digital Assistant), etc.

본 발명의 실시예에 따른 방법의 동작은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 프로그램 또는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의해 읽힐 수 있는 정보가 저장되는 모든 종류의 기록장치를 포함한다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산 방식으로 컴퓨터로 읽을 수 있는 프로그램 또는 코드가 저장되고 실행될 수 있다.The operation of the method according to an embodiment of the present invention can be implemented as a computer-readable program or code on a computer-readable recording medium. The computer-readable recording medium includes all types of recording devices that store information that can be read by a computer system. In addition, the computer-readable recording medium can be distributed over network-connected computer systems so that the computer-readable program or code can be stored and executed in a distributed manner.

또한, 컴퓨터가 읽을 수 있는 기록매체는 롬(rom), 램(ram), 플래시 메모리(flash memory) 등과 같이 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치를 포함할 수 있다. 프로그램 명령은 컴파일러(compiler)에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터(interpreter) 등을 사용해서 컴퓨터에 의해 실행될 수 있는 고급 언어 코드를 포함할 수 있다.Additionally, the computer-readable recording medium may include hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, etc. The program instructions may include not only machine language codes produced by a compiler, but also high-level language codes that can be executed by the computer using an interpreter, etc.

본 발명의 일부 측면들은 장치의 문맥에서 설명되었으나, 그것은 상응하는 방법에 따른 설명 또한 나타낼 수 있고, 여기서 블록 또는 장치는 방법 단계 또는 방법 단계의 특징에 상응한다. 유사하게, 방법의 문맥에서 설명된 측면들은 또한 상응하는 블록 또는 아이템 또는 상응하는 장치의 특징으로 나타낼 수 있다. 방법 단계들의 몇몇 또는 전부는 예를 들어, 마이크로프로세서, 프로그램 가능한 컴퓨터 또는 전자 회로와 같은 하드웨어 장치에 의해(또는 이용하여) 수행될 수 있다. 몇몇의 실시 예에서, 가장 중요한 방법 단계들의 적어도 하나 이상은 이와 같은 장치에 의해 수행될 수 있다.While some aspects of the invention have been described in the context of an apparatus, they may also represent a description of a corresponding method, wherein a block or device corresponds to a method step or a feature of a method step. Similarly, aspects described in the context of a method may also be represented as a feature of a corresponding block or item or a corresponding device. Some or all of the method steps may be performed by (or using) a hardware device, such as, for example, a microprocessor, a programmable computer or an electronic circuit. In some embodiments, at least one or more of the most important method steps may be performed by such a device.

실시예들에서, 프로그램 가능한 로직 장치(예를 들어, 필드 프로그래머블 게이트 어레이)가 여기서 설명된 방법들의 기능의 일부 또는 전부를 수행하기 위해 사용될 수 있다. 실시예들에서, 필드 프로그래머블 게이트 어레이(field-programmable gate array)는 여기서 설명된 방법들 중 하나를 수행하기 위한 마이크로프로세서(microprocessor)와 함께 작동할 수 있다. 일반적으로, 방법들은 어떤 하드웨어 장치에 의해 수행되는 것이 바람직하다.In embodiments, a programmable logic device (e.g., a field-programmable gate array) may be used to perform some or all of the functions of the methods described herein. In embodiments, a field-programmable gate array may operate in conjunction with a microprocessor to perform one of the methods described herein. In general, the methods are preferably performed by some hardware device.

이상 본 발명의 바람직한 실시 예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although the present invention has been described above with reference to preferred embodiments thereof, it will be understood by those skilled in the art that various modifications and changes may be made to the present invention without departing from the spirit and scope of the present invention as set forth in the claims below.

Claims (13)

Translated fromKorean
적어도 하나 이상의 명령을 저장하는 메모리;
상기 적어도 하나 이상의 명령을 실행하는 프로세서;
양자화 간격을 생성하기 위한 신경망; 및
확산 모델;
을 포함하며,
상기 프로세서는,
상기 확산 모델에 대한 현재 시간 단계 정보를 상기 신경망에 입력하여 상기 현재 시간 단계 정보에 대한 양자화 간격(quantization interval)을 획득하고,
상기 획득한 양자화 간격을 상기 확산 모델의 양자화 연산자(quantization operator)에 제공하고,
상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키며,
상기 양자화된 결과를 이용하여 양자화 오차를 생성하고, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격을 학습시키는,
컴퓨팅 시스템.
Memory that stores at least one instruction;
A processor for executing at least one of the above instructions;
A neural network for generating quantization intervals; and
diffusion model;
Including,
The above processor,
By inputting the current time step information for the above diffusion model into the neural network, a quantization interval for the current time step information is obtained,
The above-obtained quantization interval is provided to the quantization operator of the diffusion model,
The quantization operator of the above diffusion model quantizes the tensor data of the above diffusion model using the generated quantization interval,
Using the above quantized result, a quantization error is generated, and the quantization interval is updated using the quantization error to learn the quantization interval of the neural network.
Computing systems.
제1항에 있어서, 상기 신경망은 경사하강법(gradient descent)을 이용하여 학습되는, 컴퓨팅 시스템.A computing system in the first aspect, wherein the neural network is trained using gradient descent.제1항에 있어서, 상기 프로세서는,
상기 확산 모델에 대한 현재 시간 단계 정보를 주파수 인코딩하고,
상기 인코딩된 현재 시간 단계 정보를 상기 신경망에 입력하는,
컴퓨팅 시스템.
In the first paragraph, the processor,
Frequency encode the current time step information for the above diffusion model,
Inputting the encoded current time step information into the neural network,
Computing systems.
제1항에 있어서, 상기 프로세서는, 상기 확산 모델의 각 시간 단계의 양자화 학습을 시작할 때, 상기 신경망의 출력 데이터를 초기화하는, 컴퓨팅 시스템.A computing system in accordance with claim 1, wherein the processor initializes output data of the neural network when starting quantization learning of each time step of the diffusion model.확산 모델에 대한 현재 시간 단계 정보를 신경망에 입력하여 상기 현재 시간 단계 정보에 대한 양자화 간격을 획득하는 단계;
상기 획득한 양자화 간격을 상기 확산 모델의 양자화 연산자에 제공하는 단계;
상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키는 단계;
상기 양자화된 결과를 이용하여 양자화 오차를 생성하는 단계; 및
상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격을 학습시키는 단계;
를 포함하는,
확산 모델을 위한 양자화 학습 방법.
A step of inputting current time step information for a diffusion model into a neural network to obtain a quantization interval for the current time step information;
A step of providing the obtained quantization interval to the quantization operator of the diffusion model;
A step of causing a quantization operator of the diffusion model to quantize the tensor data of the diffusion model using the generated quantization interval;
A step of generating a quantization error using the above quantized result; and
A step of learning the quantization interval of the neural network by updating the quantization interval using the quantization error;
Including,
Quantization learning methods for diffusion models.
제5항에 있어서, 상기 신경망의 양자화 간격을 학습시키는 단계는 경사하강법을 이용하여 학습시키는 단계인, 확산 모델을 위한 양자화 학습 방법.A quantization learning method for a diffusion model, wherein the step of learning the quantization interval of the neural network in the fifth paragraph is a step of learning using the gradient descent method.제5항에 있어서, 상기 양자화 간격을 획득하는 단계는,
상기 확산 모델에 대한 현재 시간 단계 정보를 주파수 인코딩하는 단계; 및
상기 인코딩된 현재 시간 단계 정보를 상기 신경망에 입력하는 단계;
를 포함하는,
확산 모델을 위한 양자화 학습 방법.
In the fifth paragraph, the step of obtaining the quantization interval comprises:
A step of frequency encoding the current time step information for the above diffusion model; and
A step of inputting the encoded current time step information into the neural network;
Including,
Quantization learning methods for diffusion models.
제5항에 있어서, 상기 양자화 간격을 획득하는 단계 이전에, 상기 신경망의 출력 데이터를 초기화하는 단계를 더 포함하는, 확산 모델을 위한 양자화 학습 방법.A quantization learning method for a diffusion model, wherein, prior to the step of obtaining the quantization interval, the method further comprises a step of initializing output data of the neural network.적어도 하나 이상의 명령을 저장하는 메모리;
상기 적어도 하나 이상의 명령을 실행하는 프로세서; 및
확산 모델;
을 포함하며,
상기 프로세서는,
상기 확산 모델에 현재 시간 단계 정보 및 입력 이미지를 입력하여 노이즈가 제거된 출력 이미지를 생성하며,
상기 출력 이미지를 생성하는 과정에서, 상기 현재 시간 단계 정보에 대한 미리 저장된 양자화 간격을 이용하여 상기 확산 모델의 하나 이상의 텐서 데이터를 양자화하며,
상기 미리 저장된 양자화 간격은 상기 확산 모델의 각 시간 단계에 따라 양자화 간격이 서로 다르게 생성되어 저장된 것인,
이미지 생성 장치.
Memory that stores at least one instruction;
a processor for executing at least one of the above instructions; and
diffusion model;
Including,
The above processor,
Input the current time step information and input image into the above diffusion model to generate an output image with noise removed.
In the process of generating the above output image, one or more tensor data of the diffusion model are quantized using a pre-stored quantization interval for the current time step information,
The above pre-stored quantization interval is generated and stored differently according to each time step of the diffusion model.
Image generating device.
제9항에 있어서, 상기 신경망은 경사하강법을 이용하여 학습된 것인, 이미지 생성 장치.An image generating device in claim 9, wherein the neural network is learned using gradient descent.제9항에 있어서, 상기 신경망은, 상기 프로세서가,
상기 확산 모델에 대한 학습용 시간 단계 정보를 학습용 신경망에 입력하여 상기 학습용 시간 단계 정보에 대한 학습용 양자화 간격을 획득하고,
상기 획득한 학습용 양자화 간격을 상기 확산 모델의 양자화 연산자에 제공하고,
상기 확산 모델의 양자화 연산자로 하여금, 상기 생성된 학습용 양자화 간격을 이용하여 상기 확산 모델의 텐서 데이터를 양자화시키며,
상기 양자화된 결과를 이용하여 양자화 오차를 생성하고, 상기 양자화 오차를 이용하여 상기 양자화 간격을 업데이트하여 상기 신경망의 양자화 간격이 학습되도록 학습된 것이며,
상기 미리 저장된 양자화 간격은, 상기 프로세서가 학습이 완료된 상기 신경망으로부터 상기 확산 모델의 각 시간 단계 정보에 대응하는 양자화 간격을 획득하여 상기 메모리에 저장한 것인,
이미지 생성 장치.
In the 9th paragraph, the neural network, the processor,
Input the learning time step information for the above diffusion model into the learning neural network to obtain the learning quantization interval for the learning time step information,
The above-obtained learning quantization interval is provided to the quantization operator of the diffusion model,
The quantization operator of the above diffusion model quantizes the tensor data of the above diffusion model using the generated learning quantization interval,
The quantization error is generated using the above quantized result, and the quantization interval is updated using the quantization error, so that the quantization interval of the neural network is learned.
The above-mentioned pre-stored quantization interval is obtained by the processor from the neural network for which learning has been completed, and the quantization interval corresponding to each time step information of the diffusion model is stored in the memory.
Image generating device.
제9항에 있어서, 상기 신경망은 상기 프로세서가,
상기 확산 모델에 대한 상기 학습용 시간 단계 정보를 주파수 인코딩하고,
상기 인코딩된 학습용 시간 단계 정보를 상기 신경망의 입력으로 제공하도록 학습된 것인,
이미지 생성 장치.
In the 9th paragraph, the neural network is the processor,
Frequency-encode the learning time step information for the above diffusion model,
which is trained to provide the encoded learning time step information as input to the neural network.
Image generating device.
제9항에 있어서, 상기 신경망은 상기 프로세서가,
상기 확산 모델의 각 시간 단계의 양자화 학습을 시작할 때, 상기 신경망의 출력 데이터를 초기화하도록 학습된 것인, 이미지 생성 장치.
In the 9th paragraph, the neural network is the processor,
An image generating device, which is trained to initialize the output data of the neural network when starting quantization learning of each time step of the above diffusion model.
KR1020240133047A2023-11-272024-09-30Quantization learning method for diffusion model, computing device for the same, and image generating devicePendingKR20250079863A (en)

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
KR202301672502023-11-27
KR10202301672502023-11-27

Publications (1)

Publication NumberPublication Date
KR20250079863Atrue KR20250079863A (en)2025-06-04

Family

ID=96016903

Family Applications (1)

Application NumberTitlePriority DateFiling Date
KR1020240133047APendingKR20250079863A (en)2023-11-272024-09-30Quantization learning method for diffusion model, computing device for the same, and image generating device

Country Status (1)

CountryLink
KR (1)KR20250079863A (en)

Similar Documents

PublicationPublication DateTitle
KR102656006B1 (en) Distributed and collaborative analysis of encrypted data using deep polynomial networks.
KR102788531B1 (en)Method and apparatus for generating fixed point neural network
US11275986B2 (en)Method and apparatus for quantizing artificial neural network
KR102177232B1 (en) Compressed Recurrent Neural Network Models
CN107622303B (en) Methods for neural networks and apparatus for performing the methods
US20220044109A1 (en)Quantization-aware training of quantized neural networks
CN112955907A (en)Long-short term memory neural network for quantitative training
KR102789549B1 (en)Method and algorithm of deep learning network quantization for variable precision
JP2020506488A (en) Batch renormalization layer
US20200410365A1 (en)Unsupervised neural network training using learned optimizers
CN111105017A (en)Neural network quantization method and device and electronic equipment
JP2016218513A (en) Neural network and computer program therefor
KR102792880B1 (en) Conditional Output Generation via Data Density Gradient Estimation
CN116664731B (en)Face animation generation method and device, computer readable storage medium and terminal
CN118194954B (en)Training method and device for neural network model, electronic equipment and storage medium
WO2022189493A2 (en)Generating output signals using variable-rate discrete representations
CN111587441B (en) Example output generated using a recurrent neural network conditioned on bit values
CN119649801A (en) Method, apparatus, device and storage medium for training an audio processing model
CN119625491A (en) An AI algorithm optimization method and system based on deep learning technology
CN119047523A (en)Model training method, apparatus, computer device, storage medium, and program product
JP7665791B2 (en) Online training-based encoder tuning in neural image compression
KR20250079863A (en)Quantization learning method for diffusion model, computing device for the same, and image generating device
US20220405561A1 (en)Electronic device and controlling method of electronic device
WO2024060727A1 (en)Method and apparatus for training neural network model, and device and system
JP7297286B2 (en) Optimization method, optimization program, reasoning method, and reasoning program

Legal Events

DateCodeTitleDescription
PA0109Patent application

Patent event code:PA01091R01D

Comment text:Patent Application

Patent event date:20240930

PA0201Request for examination

Patent event code:PA02011R01I

Patent event date:20240930

Comment text:Patent Application

PG1501Laying open of application

[8]ページ先頭

©2009-2025 Movatter.jp