컴퓨터과학에서 말하는 quantization 개념

continuous value는 구간에 존재하는 모든 실수를 나타내고

 

discrete value는 양자화된 숫자(quantized number)들, 구간 내에 숫자 하나하나를 나타냄

 

quantization이란 real number로 표현되는 continuous value를 integer multiple(a quantum of the smallest unit)로 표현하는 과정이다

 

컴퓨터에서는 floating point로 표현되는 continuous value를 가능한 적은 bit의 integer value로 표현하고자 하는 것이 하나의 quantization이다.

 

 

 

 

이것의 의미는 floating point 대신에 integer value를 이용해서 calculation을 수행한다는 의미다.

 

neural network가 보통 16bit나 32bit floating point로 training을 하는데

 

이러한 quantization은 더욱 적은 bit로 표현되는 integer value로 neural network를 training하게 해준다.

 

보통 floating point 연산은 integer value 연산에 비해 logical circuit scale이 훨씬 크다.

 

이게 여러군데 찾아보니까 circuit scale 의미가 floating point가 integer value에 비해 연산 과정이 크고 복잡하다는 의미같음

 

추가 설명도 해주는구나.. 바꿔말하면 integer value operation은 동일한 수의 floating point operation에 비해 circuit이 작다

 

그래서 circuit size가 동일하다면 integer value는 더 많은 operation을 할 수 있다

 

사실 integer와 floating point연산이 모두 가능한 processor들이 하나만 가능한 processor에 비해 단위시간당 더 많은 multiplication이나 addition을 할 수 있다

 

만약 예를 들어 32bit floating point로 표현되는 parameter weight W를 8 bit integer로 바꿀 수 있다면

 

weight를 저장하는데 필요한 메모리양의 75%를 절감할 수 있다고 한다

 

거의 보통 floating point 연산이 integer value연산에 비해 더욱 많은 메모리양이 필요하다는 뜻이다.

 

이렇게 quantization은 neural network에서 더욱 효율적으로 계산을 할 수 있게 만들고 메모리양도 줄일 수 있는 기법

 

CPU core안에 들어간 연산장치들 모습

 

 

ALU는 arithmetic logic unit으로 integer를 처리하는 장치라고 생각하고

 

FPU는 floating point를 처리하기 위한 장치

 

설명한대로 FPU가 차지하는 비율이 (공간이 아까울정도로) 상당히 크다는 것이 아쉽다는 거 

TAGS.

Comments