KR20220149281A - Apparatus and method for compressing feature map - Google Patents

Apparatus and method for compressing feature map Download PDF

Info

Publication number
KR20220149281A
KR20220149281A KR1020210056723A KR20210056723A KR20220149281A KR 20220149281 A KR20220149281 A KR 20220149281A KR 1020210056723 A KR1020210056723 A KR 1020210056723A KR 20210056723 A KR20210056723 A KR 20210056723A KR 20220149281 A KR20220149281 A KR 20220149281A
Authority
KR
South Korea
Prior art keywords
zero
data
value
pixel
feature map
Prior art date
Application number
KR1020210056723A
Other languages
Korean (ko)
Other versions
KR102502162B1 (en
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 포항공과대학교 산학협력단 filed Critical 포항공과대학교 산학협력단
Priority to KR1020210056723A priority Critical patent/KR102502162B1/en
Publication of KR20220149281A publication Critical patent/KR20220149281A/en
Application granted granted Critical
Publication of KR102502162B1 publication Critical patent/KR102502162B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

A method for compressing a feature map performed by a compressor according to one embodiment includes: acquiring a feature map from an input image based on one or more layers included in a convolution neural network (CNN) model; dividing the acquired feature map into unit tiles having a predetermined size and sequentially inputting the divided unit tiles into a register; generating first data indicating the number of zero tiles input to the register before a non-zero tile is input to the register, second data indicating a pixel having a zero value and a pixel having a non-zero value within the non-zero tile, and third data based on an activation value of a pixel having the non-zero value within the non-zero tile; and storing the first data, the second data, and the third data in a buffer.

Description

특징 맵을 컴프레싱하는 장치 및 방법{APPARATUS AND METHOD FOR COMPRESSING FEATURE MAP}Apparatus and method for compressing feature maps

이하, 컨볼루션 뉴럴 네트워크 모델의 레이어에 기초하여 획득된 특징 맵을 컴프레싱하는 장치 및 방법에 관한 기술이 제공된다.Hereinafter, techniques for an apparatus and method for compressing a feature map obtained based on a layer of a convolutional neural network model are provided.

컨볼루션 뉴럴 네트워크 구조는 많은 양의 오프 칩 메모리(off-chip memory)(예를 들어, 동적 랜덤 액세스 메모리(dynamic random access memory, DRAM))에 대한 액세스(access)를 필요로 하며, 오프 칩 메모리에 대한 액세스를 통해 매개변수를 내부 버퍼에 저장한다. 이러한 외부 DRAM에 대한 액세스는 네트워크 에너지 소비의 대부분을 차지한다. 일반적으로 컨볼루션 뉴럴 네트워크 가속기 장치는 CNN 모델에 포함된 레이어의 출력 특징 맵(feature map)을 컴프레싱하여 전력 소모를 줄이는 방법을 사용한다. 그러나, 종래의 특징 맵 컴프레싱 방법은 특징 맵 내에서 제로('0') 값이 많지 않게 되면 압축률(compression ratio)이 떨어진다는 단점이 존재한다. 이하에서는, 특징 맵에 대한 압축률을 효율적으로 증가시키기 위하여, 특징 맵 내에서 논-제로 활성값(activation value)의 분포 및 공간적 상관 관계성(spatial correlation)을 이용하여 해당 특징 맵을 컴프레싱 하는 방법에 관하여 설명한다.The convolutional neural network architecture requires access to a large amount of off-chip memory (eg, dynamic random access memory (DRAM)), and the off-chip memory stores the parameters in an internal buffer through access to Access to these external DRAM accounts for the majority of network energy consumption. In general, a convolutional neural network accelerator device uses a method of reducing power consumption by compressing an output feature map of a layer included in a CNN model. However, the conventional feature map compression method has a disadvantage that the compression ratio decreases when there are not many zero ('0') values in the feature map. Hereinafter, in order to efficiently increase the compression ratio of the feature map, a method of compressing the feature map using the distribution of non-zero activation values and spatial correlation in the feature map explain about

일 실시예에 따른 컴프레서에 의해 수행되는 특징 맵을 컴프레싱하는 방법은, 입력 이미지로부터 컨볼루션 뉴럴 네트워크(convolution neural network, CNN) 모델에 포함된 하나 이상의 레이어에 기초하여 특징 맵(feature map)을 획득하는 단계, 상기 획득된 특징 맵을 미리 결정된 크기의 단위 타일(unit tile)로 분할(divide)하고, 상기 분할된 단위 타일들을 순차적으로 레지스터에 입력시키는 단계, 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값(activation value)에 기초하여 제3 데이터를 생성하는 단계, 및 상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 상기 버퍼에 저장하는 단계를 포함할 수 있다.A method of compressing a feature map performed by a compressor according to an embodiment includes a feature map based on one or more layers included in a convolutional neural network (CNN) model from an input image. obtaining, dividing the obtained feature map into unit tiles of a predetermined size, and sequentially inputting the divided unit tiles into a register; a non-zero tile is input to the register first data indicating the number of zero tiles input to the register before the number of zero tiles, second data indicating a pixel having a zero value and a pixel having a non-zero value within the non-zero tile, and the non-zero tile generating third data based on an activation value of a pixel having a non-zero value in a tile, and storing the first data, the second data, and the third data in the buffer may include steps.

상기 데이터를 생성하는 단계는, 상기 레지스터에 입력된 단위 타일 내에서 모든 픽셀이 제로값을 갖는 경우, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트를 증가시키는 단계를 포함할 수 있다.The generating of the data may include indicating the number of zero tiles input to the register before the non-zero tiles are input to the register when all pixels within the unit tile input to the register have zero values. It may include increasing the count of the first data.

일 실시예에 따른 컴프레서에 의해 수행되는 특징 맵을 컴프레싱하는 방법은, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트가 임계값에 도달하는 경우, 임계값을 상기 제1 데이터로 생성하고, 제로값을 상기 제2 데이터로 생성하는 단계를 더 포함할 수 있다.In the method of compressing a feature map performed by a compressor according to an embodiment, the count of first data indicating the number of zero tiles input to the register before the non-zero tiles are input to the register is critical The method may further include generating a threshold value as the first data and generating a zero value as the second data when the value is reached.

상기 데이터를 생성하는 단계는, 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값을 제1 비트 폭(bit width)의 데이터로 나타내어 상기 제3 데이터를 생성하는 단계를 포함할 수 있다.The generating of the data may include generating the third data by representing an active value of a pixel having a non-zero value in the non-zero tile as data having a first bit width. have.

상기 데이터를 생성하는 단계는, 상기 논-제로 타일 내에서 픽셀들이 갖는 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하는 단계, 및 아웃라이어로 분류된 활성값을 제1 비트 폭의 데이터로 나타내고, 논-아웃라이어로 분류된 활성값을 상기 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 상기 제3 데이터를 생성하는 단계를 포함할 수 있다.The generating of the data may include classifying active values of pixels in the non-zero tile into one of an outlier, a non-outlier, and a zero value, and assigning the active value classified as an outlier to a first bit and generating the third data by representing an active value that is represented by data of a width and classified as a non-outlier as data of a second bit width smaller than the first bit width.

상기 분할된 단위 타일들을 레지스터에 입력시키는 단계는, 단위 타일이 포함하는 픽셀 각각의 활성값을 상위 비트 데이터 및 하위 비트 데이터로 나누어 상기 레지스터에 입력시키는 단계를 포함하고, 상기 데이터를 생성하는 단계는, 픽셀의 활성값에 대응하는 상위 비트 데이터 및 하위 비트 데이터가 제로값인지 여부를 판단하여, 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하는 단계를 포함할 수 있다.The step of inputting the divided unit tiles into the register includes dividing an active value of each pixel included in the unit tile into high-order bit data and low-order bit data and inputting them into the register, and generating the data includes: , determining whether higher bit data and lower bit data corresponding to the active value of the pixel are zero values, and classifying the active values into one of an outlier, a non-outlier, and a zero value.

상기 활성값을 분류하는 단계는, 상위 비트 데이터 및 하위 비트 데이터가 모두 논-제로 값인 경우, 활성값을 아웃라이어로 분류하는 단계, 상위 비트 데이터가 제로값이고, 하위 비트 데이터가 논-제로 값인 경우 활성값을 논-아웃라이어로 분류하는 단계, 및 상위 비트 데이터 및 하위 비트 데이터가 모두 제로값인 경우, 활성값을 제로값으로 분류하는 단계를 포함할 수 있다.The step of classifying the active value includes, when both the upper bit data and the lower bit data are non-zero values, classifying the active value as an outlier, the upper bit data is a zero value, and the lower bit data is a non-zero value classifying the active value as a non-outlier in the case of the case, and classifying the active value as a zero value when both high-order bit data and low-order bit data are zero values.

상기 데이터를 생성하는 단계는, 상기 논-제로 타일 내에서 제로값을 갖는 픽셀에 제1 값을 매핑하고, 논-아웃라이어를 갖는 픽셀에 제2 값을 매핑하며, 아웃라이어를 갖는 픽셀에 제3 값을 매핑하여 상기 제2 데이터를 생성하는 단계를 포함하고, 상기 제1 값, 상기 제2 값, 및 상기 제3 값은 서로 상이한 데이터일 수 있다.The generating of the data may include mapping a first value to a pixel having a zero value in the non-zero tile, mapping a second value to a pixel having a non-outlier, and mapping a second value to a pixel having an outlier. and generating the second data by mapping three values, wherein the first value, the second value, and the third value may be different data.

일 실시예에 따른 특징 맵을 컴프레싱하는 컴프레서는, 입력 이미지로부터 컨볼루션 뉴럴 네트워크 모델에 포함된 하나 이상의 레이어에 기초하여 획득된 특징 맵(feature map)에 대하여, 상기 특징 맵이 미리 결정된 크기의 단위 타일들로 분할되고, 상기 분할된 단위 타일들이 순차적으로 입력되는 레지스터, 레지스터에 저장된 데이터들을 비교하는 비교기, 상기 비교의 결과에 기초하여 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값에 기초하여 제3 데이터를 생성하는 제어기, 및 상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 저장하고, 저장된 데이터를 동적 랜덤 액세스 메모리(DRAM)으로 출력하는 버퍼를 포함할 수 있다.In the compressor for compressing the feature map according to an embodiment, the feature map has a predetermined size with respect to a feature map obtained based on one or more layers included in the convolutional neural network model from the input image. A register divided into unit tiles, to which the divided unit tiles are sequentially input, a comparator for comparing data stored in the register, and a non-zero tile inputted to the register until a non-zero tile is inputted to the register based on the result of the comparison First data indicating the number of zero tiles, second data indicating pixels having a zero value and pixels having a non-zero value in the non-zero tile, and non-zero in the non-zero tile a controller that generates third data based on an active value of a pixel having a value, and stores the first data, the second data, and the third data, and outputs the stored data to a dynamic random access memory (DRAM) It may contain a buffer to

상기 제어기는, 상기 레지스터에 입력된 단위 타일의 모든 픽셀이 제로값을 갖는 경우, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트를 증가시킬 수 있다.When all pixels of the unit tile input to the register have a zero value, the controller is configured to count first data indicating the number of zero tiles input to the register before the non-zero tile is input to the register. can increase

상기 제어기는, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트가 임계값에 도달하는 경우, 임계값을 상기 제1 데이터로 생성하고, 제로값을 상기 제2 데이터로 생성할 수 있다.The controller generates a threshold value as the first data when the count of first data indicating the number of zero tiles input to the register reaches a threshold value before the non-zero tiles are input to the register. and a zero value may be generated as the second data.

상기 제어기는, 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값을 제1 비트 폭(bit width)의 데이터로 나타내어 상기 제3 데이터를 생성할 수 있다.The controller may generate the third data by representing an active value of a pixel having a non-zero value in the non-zero tile as data having a first bit width.

상기 제어기는, 상기 논-제로 타일 내에서 픽셀들이 갖는 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하고, 아웃라이어로 분류된 활성값을 제1 비트 폭의 데이터로 나타내며, 논-아웃라이어로 분류된 활성값을 상기 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 상기 제3 데이터를 생성할 수 있다.The controller classifies an active value of pixels in the non-zero tile into one of an outlier, a non-outlier, and a zero value, and represents the active value classified as an outlier as data of a first bit width; The third data may be generated by representing an active value classified as a non-outlier as data having a second bit width smaller than the first bit width.

상기 레지스터는, 단위 타일이 포함하는 픽셀 각각의 활성값이 상위 비트 데이터 및 하위 비트 데이터로 나누어진 입력을 수신하고, 상기 비교기는, 픽셀의 활성값에 대응하는 상위 비트 데이터 및 하위 비트 데이터가 제로값인지 여부를 판단하고, 상기 제어기는, 상기 판단 결과에 기초하여 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류할 수 있다.The register receives an input in which an active value of each pixel included in a unit tile is divided into high-order bit data and low-order bit data, and the comparator determines that the high-order bit data and low-order bit data corresponding to the active value of the pixel are zero. It is determined whether the value is a value, and the controller may classify the active value into one of an outlier, a non-outlier, and a zero value based on a result of the determination.

상기 제어기는, 상기 비교 결과에 기초하여, 상위 비트 데이터 및 하위 비트 데이터가 모두 논-제로 값인 경우, 활성값을 아웃라이어로 분류하고, 상위 비트 데이터가 제로값이고, 하위 비트 데이터가 논-제로 값인 경우 활성값을 논-아웃라이어로 분류하며, 상위 비트 데이터 및 하위 비트 데이터가 모두 제로값인 경우, 활성값을 제로값으로 분류할 수 있다.The controller, based on the comparison result, classifies the active value as an outlier when both the high-order bit data and the low-order bit data are non-zero values, the high-order bit data is a zero value, and the low-order bit data is a non-zero value In the case of a value, the active value is classified as a non-outlier, and when both the upper bit data and the lower bit data are zero values, the active value may be classified as a zero value.

상기 제어기는, 상기 논-제로 타일 내에서 제로값을 갖는 픽셀에 제1 값을 매핑하고, 논-아웃라이어를 갖는 픽셀에 제2 값을 매핑하며, 아웃라이어를 갖는 픽셀에 제3 값을 매핑하여 상기 제2 데이터를 생성하고, 상기 제1 값, 상기 제2 값, 및 상기 제3 값을 서로 상이한 데이터일 수 있다.The controller maps a first value to a pixel having a zero value within the non-zero tile, a second value maps a pixel having a non-outlier, and a third value to a pixel having an outlier to generate the second data, and the first value, the second value, and the third value may be different data.

일 실시예에 따른 뉴럴 네트워크 가속기 장치는, 컨볼루션 뉴럴 네트워크 연산을 수행하는 프로세싱 엘리먼트 어레이(PE array)를 이용하여 컨볼루션 뉴런 네트워크 모델에 포함된 하나 이상의 레이어에 기초하여 입력 이미지로부터 추출된 특징 맵을 획득하는 버퍼, 상기 획득된 특징 맵을 미리 결정된 크기의 단위 타일들로 분할하고, 상기 분할된 단위 타일들을 순차적으로 컴프레서에 입력시키는 제어기(controller), 및 논-제로 타일이 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값에 기초하여 제3 데이터를 생성하고, 상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 저장하며, 저장된 데이터를 동적 랜덤 액세스 메모리(DRAM)으로 출력하는 컴프레서(compressor)를 포함할 수 있다.A neural network accelerator device according to an embodiment uses a processing element array (PE array) that performs a convolutional neural network operation, and a feature map extracted from an input image based on one or more layers included in a convolutional neuron network model a buffer for obtaining , a controller that divides the acquired feature map into unit tiles of a predetermined size, and sequentially inputs the divided unit tiles to a compressor, and a non-zero tile until the non-zero tile is input to the register First data indicating the number of zero tiles input to the register, second data indicating pixels having a zero value and pixels having a non-zero value in the non-zero tile, and in the non-zero tile generate third data based on an active value of a pixel having a non-zero value in , store the first data, the second data, and the third data, and store the stored data in a dynamic random access memory (DRAM) It may include a compressor that outputs as

일 실시예에 따른 디컴프레서에 의해 수행되는 특징 맵을 디컴프레싱하는 방법은, 컨볼루션 네트워크 모델의 레이어에 기초하여 획득된 특징 맵이 컴프레싱된 데이터를 레지스터에 입력시키는 단계, 및 제1 데이터에 대응하는 개수의 제로 타일을 생성하여 버퍼로 전송하고, 제2 데이터 및 제3 데이터에 기초하여 논-제로 타일을 생성하여 버퍼로 전송하는 단계를 포함하고, 상기 논-제로 타일을 생성하여 버퍼로 전송하는 단계는, 상기 제2 데이터를 이용하여 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 구분하고, 상기 제로값을 갖는 픽셀의 활성값은 제로값과 대응시키고, 논-제로 값을 갖는 픽셀의 활성값은 상기 제3 데이터와 순차적으로 대응시켜 상기 논-제로 타일을 생성하는 단계를 포함할 수 있다.A method of decompressing a feature map performed by a decompressor according to an embodiment includes: inputting data in which a feature map obtained based on a layer of a convolutional network model is compressed into a register; generating and transmitting a corresponding number of zero tiles to a buffer, generating and transmitting non-zero tiles based on second data and third data to a buffer, wherein generating the non-zero tiles to a buffer In the transmitting step, a pixel having a zero value and a pixel having a non-zero value are distinguished from a pixel having a non-zero value in the non-zero tile by using the second data, and an active value of the pixel having a zero value corresponds to the zero value. and generating the non-zero tile by sequentially matching an active value of a pixel having a non-zero value with the third data.

일 실시예에 따른 특징 맵을 디컴프레싱하는 디컴프레서는, 컨볼루션 네트워크 모델의 레이어에 기초하여 획득된 특징 맵이 컴프레싱된 데이터가 입력되는 레지스터, 및 제1 데이터에 대응하는 개수의 제로 타일을 생성하여 버퍼로 전송하고, 제2 데이터 및 제3 데이터에 기초하여 논-제로 타일을 생성하여 버퍼로 전송하는 제어기를 포함하고, 상기 제어기는, 상기 제2 데이터를 이용하여 상기 논-제로 타일 내에서 제로값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 구분하고, 상기 제로값을 갖는 픽셀의 활성값은 제로값과 대응시키고, 논-제로 값을 갖는 픽셀의 활성값은 상기 제3 데이터와 순차적으로 대응시켜 상기 논-제로 타일을 생성할 수 있다.A decompressor for decompressing a feature map according to an embodiment includes a register to which compressed data of a feature map obtained based on a layer of a convolutional network model is input, and a number of zero tiles corresponding to the first data. and a controller to generate and transmit to a buffer, and to generate and transmit a non-zero tile based on the second data and the third data to the buffer, wherein the controller is configured to generate a non-zero tile based on the second data and the third data, wherein the controller uses the second data to distinguishes a pixel having a zero value from a pixel having a non-zero value, an active value of the pixel having a zero value corresponds to a zero value, and an active value of the pixel having a non-zero value is the third data and The non-zero tiles may be generated by sequentially matching them.

도 1은 CNN 모델에서의 특징 맵 및 특징 맵 내에서 픽셀이 갖는 활성값의 분포에 관하여 설명한다.
도 2는 특징 맵 내에서 특정 거리 내의 활성값들 사이의 공간적 상호 관계성에 관한 그래프이다.
도 3은 일 실시예에 따른 뉴럴 네트워크 가속기 장치의 동작을 설명하는 흐름도이다.
도 4는 일 실시예에 따른 가속기 장치가 특징 맵을 컴프레싱하는 방법에 관하여 설명한다.
도 5는 일 실시예에 따른 가속기 장치의 구성에 관하여 설명한다.
도 6은 일 실시예에 따른 컴프레서의 구조에 관하여 설명한다.
도 7은 일 실시예에 따른 특징 맵을 디컴프레싱하는 디컴프레서의 구조에 관하여 설명한다.
도 8은 단위 타일의 크기에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 도시한다.
도 9는 다양한 컴프레싱 방법에 따른 특징 맵의 압축률 및 희소성(sparsity)에 관한 그래프를 나타낸다.
도 10은 양자화된 활성값에 대하여 컴프레싱된 특징 맵의 정규화된 DRAM 액세스의 값을 나타낸다.
도 11은 특징 맵을 저장 및 로드(load)하는데 소비되는 에너지에 관한 그래프를 나타낸다.
1 illustrates a feature map in a CNN model and a distribution of active values of pixels in the feature map.
2 is a graph of spatial correlation between activation values within a specific distance within a feature map.
3 is a flowchart illustrating an operation of a neural network accelerator device according to an embodiment.
4 illustrates a method of compressing a feature map by an accelerator device according to an embodiment.
5 illustrates a configuration of an accelerator device according to an exemplary embodiment.
6 illustrates a structure of a compressor according to an embodiment.
7 illustrates a structure of a decompressor for decompressing a feature map according to an embodiment.
8 shows a graph of the reciprocal of normalized DRAM access according to the size of a unit tile.
9 is a graph showing a compression ratio and sparsity of a feature map according to various compression methods.
Figure 10 shows the values of normalized DRAM accesses of the compressed feature map with respect to quantized activation values.
11 shows a graph of energy consumed to store and load a feature map.

실시예들에 대한 특정한 구조적 또는 기능적 설명들은 단지 예시를 위한 목적으로 개시된 것으로서, 다양한 형태로 변경되어 구현될 수 있다. 따라서, 실제 구현되는 형태는 개시된 특정 실시예로만 한정되는 것이 아니며, 본 명세서의 범위는 실시예들로 설명한 기술적 사상에 포함되는 변경, 균등물, 또는 대체물을 포함한다.Specific structural or functional descriptions of the embodiments are disclosed for purposes of illustration only, and may be changed and implemented in various forms. Accordingly, the actual implementation form is not limited to the specific embodiments disclosed, and the scope of the present specification includes changes, equivalents, or substitutes included in the technical spirit described in the embodiments.

제1 또는 제2 등의 용어를 다양한 구성요소들을 설명하는데 사용될 수 있지만, 이런 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 해석되어야 한다. 예를 들어, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소는 제1 구성요소로도 명명될 수 있다.Although terms such as first or second may be used to describe various elements, these terms should be interpreted only for the purpose of distinguishing one element from another. For example, a first component may be termed a second component, and similarly, a second component may also be termed a first component.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다.When a component is referred to as being “connected” to another component, it may be directly connected or connected to the other component, but it should be understood that another component may exist in between.

단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 설명된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함으로 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The singular expression includes the plural expression unless the context clearly dictates otherwise. In this specification, terms such as "comprise" or "have" are intended to designate that the described feature, number, step, operation, component, part, or combination thereof exists, and includes one or more other features or numbers, It should be understood that the possibility of the presence or addition of steps, operations, components, parts or combinations thereof is not precluded in advance.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 해당 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 갖는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in a commonly used dictionary should be interpreted as having a meaning consistent with the meaning in the context of the related art, and should not be interpreted in an ideal or excessively formal meaning unless explicitly defined in the present specification. does not

이하, 실시예들을 첨부된 도면들을 참조하여 상세하게 설명한다. 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조 부호를 부여하고, 이에 대한 중복되는 설명은 생략하기로 한다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. In the description with reference to the accompanying drawings, the same components are assigned the same reference numerals regardless of the reference numerals, and the overlapping description thereof will be omitted.

도 1은 CNN 모델에서의 특징 맵 및 특징 맵 내에서 픽셀이 갖는 활성값의 분포에 관하여 설명한다.1 illustrates a feature map in a CNN model and a distribution of active values of pixels in the feature map.

최근 컨볼루션 뉴럴 네트워크(convolution neural network, CNN)(이하, 'CNN')의 크기가 커짐에 따라, CNN의 정확도가 향상되었다. 최신 CNN 모델에서는 수백만번의 연산(computation)과 수백 메가바이트(megabyte)의 매개변수(parameter)가 요구된다. CNN 가속기 장치는 DRAM에 대한 액세스를 통하여 매개변수를 내부 버퍼에 저장한다. DRAM에 대한 액세스는 CNN 가속기 장치의 에너지 소비의 대부분을 차지한다. CNN 가속기 장치는 에너지 소비를 줄이기 위하여, 특징 맵(feature map)을 컴프레싱 함으로써 DRAM 액세스 수를 최소화할 수 있다. 특징 맵을 컴프레싱하는 데에 추가적인 전력이 소모되지만, 간단한 산술 연산 또는 내부 버퍼 액세스를 위한 에너지 소비는 DRAM 액세스의 에너지 소비 보다 훨씬 적게 나타난다.Recently, as the size of a convolutional neural network (CNN) (hereinafter, 'CNN') has increased, the accuracy of the CNN has been improved. Modern CNN models require millions of computations and hundreds of megabytes of parameters. The CNN accelerator device stores parameters in an internal buffer through access to DRAM. Access to DRAM accounts for most of the energy consumption of CNN accelerator devices. The CNN accelerator device can minimize the number of DRAM accesses by compressing a feature map in order to reduce energy consumption. Additional power is consumed to compress the feature map, but the energy consumption for simple arithmetic operations or internal buffer access is much less than that of DRAM access.

종래에는 특징 맵에 대한 효과적인 컴프레싱을 위하여 렐루(rectified linear unit, ReLU) 및 양자화(quantization)로 인한 희소성(sparsity)에 초점을 두었다. 계산 복잡성의 감소와 베니싱-그라디언트(vanishing gradient) 문제를 해결하기 위해 렐루(ReLU)를 활성화 함수가 사용되었고, 특징 맵의 양자화를 통한 정수형(fixed-point) 데이터가 사용되었다. 렐루의 활성화 함수는 음수값 또는 제로값이 입력되면 제로값(0)을 반환하고, 양수값이 입력되면 해당 양수값을 그대로 반환하는 부분 선형 함수이다. 따라서, 특징 맵 내에서 모든 음수값들이 제로값이 되기 때문에 제로값이 많은 특징맵, 즉 희소성(sparsity)이 높은 특징 맵이 도출된다. 양자화(quantization)는 32 비트 실수형(floating point)로 표시되어 있는 값을 32 비트 또는 32 비트 보다 적은 비트를 사용하여 정수형 값으로 변환하는 것을 나타낸다. 양자화를 통하여 제로값에 가까운 값들을 제로값으로 양자화 시킬 수 있고, 희소성이 높은 특징 맵이 도출될 수 있다. 종래에는 렐루 또는 양자화를 통한 희소성이 높은 특징맵의 특성에만 의존하여 특징 맵을 컴프레싱하였다.Conventionally, for effective compression of a feature map, a focus has been placed on sparsity due to a rectified linear unit (ReLU) and quantization. To reduce computational complexity and solve the vanishing gradient problem, a ReLU activation function was used, and fixed-point data through quantization of the feature map was used. The activation function of Relu is a partial linear function that returns a zero value (0) when a negative value or zero value is input, and returns the corresponding positive value as it is when a positive value is input. Accordingly, since all negative values in the feature map become zero values, a feature map with many zero values, that is, a feature map with high sparsity, is derived. Quantization refers to converting a value expressed as a 32-bit floating point to an integer value using 32 bits or fewer than 32 bits. Through quantization, values close to zero can be quantized to zero, and a feature map with high sparseness can be derived. Conventionally, the feature map is compressed depending on only the feature of the feature map having high sparseness through relu or quantization.

도 1을 참조하면, CNN 모델 중 하나의 예시적 모델인 VGG-16 네트워크(110)에 관하여 설명한다. 특징 맵(111, 112)은 VGG-16 네트워크(110)에 포함된 12번째 레이어에 기초하여 획득된 특징 맵을 나타낸다. 특징 맵(111, 112)에서는 제로값의 활성값을 갖는 픽셀들은 흰색으로 표시되고, 논-제로 값의 활성값을 갖는 픽셀들은 회색 또는 검은색으로 표시된다. 특징 맵(111, 112)에서 논-제로 값의 활성값을 갖는 픽셀들은 서로 군집되어 있다. 이는 CNN의 활성값들이 공간적 상호 관계성(spatial correlation)을 갖는다는 것을 나타낸다. 따라서 특정 픽셀의 활성값이 제로값이 아닌 경우, 근처 픽셀의 활성값들 역시 제로값이 아닐 확률이 높다. 일반적으로, 특징맵(111, 112) 내에서 논-제로 값의 활성값을 갖는 픽셀들(예를 들어, 검은색으로 표시된 픽셀들)은 적은 양으로 나타나고, 특징 맵(111, 112) 내에서 제로값의 활성값을 갖는 픽셀들(예를 들어, 흰색으로 표시된 픽셀들)은 많은 양으로 나타난다.Referring to FIG. 1 , a VGG-16 network 110 that is an exemplary model of one of the CNN models will be described. The feature maps 111 and 112 represent feature maps obtained based on the twelfth layer included in the VGG-16 network 110 . In the feature maps 111 and 112 , pixels having an active value of a zero value are displayed in white, and pixels having an active value of a non-zero value are displayed in gray or black. In the feature maps 111 and 112 , pixels having non-zero active values are clustered with each other. This indicates that the CNN activity values have spatial correlation. Accordingly, when the active value of a specific pixel is not a zero value, there is a high probability that the active values of a nearby pixel are also not zero. In general, pixels with active values of non-zero values in the feature maps 111 and 112 (eg, pixels marked in black) appear in small amounts, and in the feature maps 111 and 112 Pixels with an active value of zero (eg, pixels marked white) appear in large quantities.

활성값 분포(120)는 VGG-16 네트워크(110)의 특징 맵에서 최대 비트 폭(maximum bit-width)에 따른 활성값의 분포를 나타낸다. 최대 비트 폭이란 활성값을 표현하기 위해 최소로 필요로 하는 비트의 수를 나타낼 수 있다. 예를 들어, 7의 활성값은 이진수로 00000111(2) 로 표현될 수 있으며, 최대 비트 폭은 3이다.The activation value distribution 120 represents the distribution of the activation values according to the maximum bit-width in the feature map of the VGG-16 network 110 . The maximum bit width may indicate the minimum number of bits required to express an active value. For example, an active value of 7 can be expressed as 00000111 (2) in binary, with a maximum bit width of 3.

특징맵 내에서 픽셀이 갖는 정수형 데이터의 활성값은 각각 최대 비트 폭에 따라 제로값(121), 논-아웃라이어(122), 또는 아웃라이어(123) 중 하나로 분류될 수 있다. 특징 맵 내에서 논-제로 값의 활성값은 대부분 N 비트 고정 소수점 시스템(fixed-point system)에서 N/2 비트를 사용하여 표현될 수 있다. 논-아웃라이어(122)은 N 비트 고정 소수점 시스템에서 N/2 비트를 사용하여 표현 가능한 활성값을 나타낼 수 있다. 아웃라이어(123)는 N 비트 고정 소수점 시스템에서 N/2 비트를 사용하여 표현할 수 없는 활성값을 나타낼 수 있다. 여기서 N은 1 이상의 자연수를 나타낼 수 있다. 제로값(121)은 최대 비트 폭이 '0'이다. 논-아웃라이어(122)는 N/2 이하의 최대 비트 폭을 가진다. 아웃라이어(123)는 N/2를 초과하는 최대 비트 폭을 가진다. 논-아웃라이어 및 아웃라이어는 논-제로 값이라고 나타낼 수 있다.An active value of integer data of a pixel in the feature map may be classified into one of a zero value 121 , a non-outlier 122 , or an outlier 123 according to a maximum bit width, respectively. Most active values of non-zero values in the feature map may be expressed using N/2 bits in an N-bit fixed-point system. The non-outlier 122 may represent an active value expressible using N/2 bits in an N-bit fixed-point system. The outlier 123 may represent an activation value that cannot be expressed using N/2 bits in an N-bit fixed-point system. Here, N may represent a natural number of 1 or more. The zero value 121 has a maximum bit width of '0'. The non-outlier 122 has a maximum bit width of N/2 or less. The outlier 123 has a maximum bit width exceeding N/2. Non-outliers and outliers may be referred to as non-zero values.

특징 맵 내에서 아웃라이어로 분류되는 활성값은 매우 적은 부분을 차지하지만, CNN의 정확도에 상당한 영향을 미친다. 아웃라이어는 상대적으로 논-아웃라이어에 비하여 많은 비트 수를 사용하여 표현되어야 하므로, 양자화에 한계점이 존재하고 이로 인하여 데이터의 크기가 클 수밖에 없는 단점이 있다. 반대로, 논-아웃라이어는 N 비트 고정 소수점 시스템에서 N/2 비트만을 사용하여 표현이 가능하다. CNN 특징 맵 내에서 픽셀의 활성값은 대부분 논-아웃라이어 또는 제로값 이므로, 고정된 N 비트를 사용하여 데이터를 표현하는 것은 메모리 사용 측면에서 많은 낭비이다. 그러나, 상대적으로 긴 비트 폭을 유지해야 하는 아웃라이어로 인하여, 데이터 표현의 비트 폭을 줄일 수 없는 문제점이 존재한다. 반면, 일 실시예에 따른 특징 맵을 컴프레싱하는 컴프레서는 특징 맵의 활성값들의 공간적 상호 관계성을 이용하고, 활성값들의 데이터 표현 비트 폭을 줄임으로써 특징 맵의 압축률을 향상시킬 수 있다.Active values classified as outliers in the feature map occupy a very small part, but have a significant impact on the accuracy of CNNs. Since the outlier has to be expressed using a relatively large number of bits compared to the non-outlier, there is a limitation in quantization, which inevitably leads to a large data size. Conversely, a non-outlier can be expressed using only N/2 bits in an N-bit fixed-point system. Since most active values of pixels in the CNN feature map are non-outliers or zero values, representing data using fixed N bits is a waste of memory in terms of usage. However, there is a problem in that the bit width of the data representation cannot be reduced due to the outlier having to maintain a relatively long bit width. On the other hand, the compressor for compressing the feature map according to an embodiment may improve the compression ratio of the feature map by using spatial correlation between active values of the feature map and reducing the data representation bit width of the active values.

도 2는 특징 맵 내에서 특정 거리 내의 활성값들 사이의 공간적 상호 관계성에 관한 그래프이다.2 is a graph of spatial correlation between activation values within a specific distance within a feature map.

Moran의 I를 사용하여 특징 맵 내에서 활성값 사이의 공간적 상호 관계성을 정량적으로 평가될 수 있다. ImageNet 2012 학습 데이터 기반으로 트레이닝이 수행된 8 비트 양자화된 VGG-16 네트워크에 관하여 일 예시로 설명한다. VGG-16 네트워크에서 인퍼런스(inference)를 수행하여 VGG-16 네트워크의 각 레이어 마다 특징 맵이 획득될 수 있다. 압축률은 활성값이 제로값인 지 여부에 따라 일정하게 평가될 수 있으나, 공간적 상호 관계성은 활성값의 크기에 따라 달리 평가될 수 있다. 활성값의 크기에 따라 공간적 상호 관계성이 다르게 평가되는 차이를 없애기 위하여, 특징 맵의 활성값 중 논-제로 값은 모두 '1'의 데이터로 변경되어 공간적 상호 관계성이 평가될 수 있다. 활성값들 사이의 거리는 특징 맵 내에서 해당 활성값들 각각에 대응하는 픽셀들 사이의 거리를 나타낸다. 예시적으로, 특징 맵 내에서 (x1, y1)의 위치를 갖는 픽셀과 (x2, y2)의 위치를 갖는 픽셀 사이의 거리는 |x2-x1|+|y2-y1|으로 표현될 수 있다. 특정 거리(d) 내 활성값들 사이의 공간적 상호 관계성을 조사하기 위하여, 공간 계수(wij)는 아래 수학식 1과 같이 정의될 수 있다. 여기서, i 및 j는 특징 맵 내에서 활성값의 인덱스를 나타낸다.Using Moran's I, the spatial correlation between activity values within a feature map can be quantitatively evaluated. An example of an 8-bit quantized VGG-16 network trained based on ImageNet 2012 training data will be described. By performing inference in the VGG-16 network, a feature map may be obtained for each layer of the VGG-16 network. The compression ratio may be constantly evaluated depending on whether the active value is a zero value, but the spatial correlation may be evaluated differently depending on the size of the active value. In order to eliminate a difference in which spatial correlation is evaluated differently depending on the size of the active value, all non-zero values among the active values of the feature map may be changed to data of '1' and spatial correlation may be evaluated. The distance between the active values represents a distance between pixels corresponding to each of the corresponding active values in the feature map. Exemplarily, the distance between a pixel having a position of (x 1 , y 1 ) and a pixel having a position of (x 2 , y 2 ) in the feature map is |x 2 -x 1 |+|y 2 -y 1 It can be expressed as |. In order to investigate the spatial correlation between activation values within a specific distance d, the spatial coefficient w ij may be defined as in Equation 1 below. Here, i and j represent indexes of active values in the feature map.

Figure pat00001
Figure pat00001

논-제로 값을 '1'의 값으로 변환한 특징 맵의 공간적 자동 상호 관계성(spatial auto correlation)을 평가하기 위하여 Moran의 I가 계산될 수 있다. Moran의 I는 아래 수학식 2와 같이 정의 될 수 있다.Moran's I may be calculated to evaluate the spatial auto correlation of the feature map obtained by converting the non-zero value into a value of '1'. Moran's I can be defined as in Equation 2 below.

Figure pat00002
Figure pat00002

수학식 2에서 L은 특징 맵 내에서 활성값의 총 개수를 나타낸다.

Figure pat00003
Figure pat00004
는 각각 활성값 및 활성값의 평균을 나타낸다. Moran의 I는 -1 내지 1 사이의 값을 가진다. Moran의 I 값이 '-1'인 경우, 논-제로 값의 활성값들이 완벽하게 분산되어 있음을 나타내고, Moran의 I 값이 '1'인 경우, 논-제로 값의 활성값들이 완벽하게 군집되어 있음을 나타낸다. 일반적으로 특정 데이터에 대한 Moran의 I가
Figure pat00005
보다 크다면, 특정 데이터가 양의 공간적 상호 관계성을 가지는 것으로 판단된다.In Equation 2, L represents the total number of active values in the feature map.
Figure pat00003
and
Figure pat00004
represents the active value and the average of the active values, respectively. Moran's I has a value between -1 and 1. When Moran's I value is '-1', it indicates that the active values of non-zero values are perfectly distributed, and when Moran's I value is '1', the active values of non-zero values perfectly cluster. indicates that it has been In general, Moran's I for a particular data is
Figure pat00005
If larger, it is determined that the specific data has a positive spatial correlation.

도 2는 서로 다른 컨볼루션 레이어 마다 계산된 특정 거리 내 활성값들 사이의 공간적 상호 관계성(Moran의 I)을 나타낸다. 그래프(211)는 거리가 '1'인 활성값들 사이의 공간적 상호 관계성에 관한 그래프이고, 그래프(212)는 거리가 '2'인 활성값들 사이의 공간적 상호 관계성에 관한 그래프이며, 그래프(213)은 거리가 '3'인 활성값들 사이의 공간적 상호 관계성에 관한 그래프이고, 그래프(214)는 거리가 '4'인 활성값들 사이의 공간적 상호 관계성에 관한 그래프이다. 도 2를 참조하면, 가까운 거리 내 활성값들 사이의 공간적 상호 관계성이 더 높은 것으로 나타난다. 거리가 '1'인 활성값들 사이의 평균 Moran의 I는 0.54로 나타나고, 거리가 증가함에 따라 활성값들 사이의 평균 Moran의 I는 0.35, 0.29, 및 0.26으로 감소하는 것으로 나타난다. 공간적 상호 관계성은 모든 거리에서 항상

Figure pat00006
보다 큰 것으로 나타나기 때문에, 특징 맵의 활성값들은 양의 공간적 상호 관계성을 갖는 것으로 판단된다. 이하에서는, 특징 맵의 높은 공간적 상호 관계성을 이용하기 위하여, 타일(tile)을 기반으로 특징 맵을 컴프레싱하는 방법에 관하여 설명한다.2 shows the spatial correlation (Moran's I) between activation values within a specific distance calculated for different convolutional layers. The graph 211 is a graph regarding the spatial correlation between active values with a distance of '1', the graph 212 is a graph about the spatial correlation between active values with a distance of '2', and the graph ( 213 is a graph relating to spatial correlation between active values having a distance of '3', and graph 214 is a graph relating to spatial correlation between active values having a distance of '4'. Referring to FIG. 2 , it appears that the spatial correlation between activation values within a close distance is higher. The average Moran's I between active values with a distance of '1' appears to be 0.54, and the average Moran's I between active values appears to decrease to 0.35, 0.29, and 0.26 as the distance increases. Spatial interrelationship is always at all distances
Figure pat00006
Since it appears larger, it is judged that the activation values of the feature map have positive spatial correlation. Hereinafter, a method of compressing a feature map based on a tile in order to utilize the high spatial correlation of the feature map will be described.

도 3은 일 실시예에 따른 뉴럴 네트워크 가속기 장치의 동작을 설명하는 흐름도이다.3 is a flowchart illustrating an operation of a neural network accelerator device according to an embodiment.

동작(310)에서 일 실시예에 따른 뉴럴 네트워크 가속기 장치(이하, '가속기 장치')는 CNN 모델에 포함된 하나 이상의 레이어에 기초하여 특징 맵(feature map)을 획득할 수 있다.In operation 310, the neural network accelerator device (hereinafter, 'accelerator device') according to an embodiment may acquire a feature map based on one or more layers included in the CNN model.

동작(320)에서 일 실시예에 따른 가속기 장치는 획득된 특징 맵을 미리 결정된 크기의 단위 타일(unit tile)로 분할(divide)하고, 분할된 단위 타일들을 순차적으로 컴프레서의 레지스터에 입력할 수 있다. 가속기 장치는 특징 맵의 높은 공간적 상호 관계성을 활용하기 위하여 특징 맵을 복수의 단위 타일들로 분할할 수 있다. 예를 들어, 특징 맵을 m×n 단위 타일로 분할하고, 단위 타일 내의 활성값을 컴프레싱할 수 있다. 단위 타일의 폭(width) 및 높이(height)는 미리 결정될 수 있다. m×n 타일은 일 축으로 m개의 픽셀이 배치되고, 일 축과 수직한 다른 축으로 n개의 픽셀이 배치된 타일을 나타낼 수 있다.In operation 320, the accelerator device according to an embodiment may divide the acquired feature map into unit tiles having a predetermined size, and sequentially input the divided unit tiles into a register of the compressor. . The accelerator device may divide the feature map into a plurality of unit tiles in order to utilize the high spatial interrelationship of the feature map. For example, the feature map may be divided into m×n unit tiles, and an active value in the unit tiles may be compressed. The width and height of the unit tile may be predetermined. An m×n tile may indicate a tile in which m pixels are arranged along one axis and n pixels are arranged in another axis perpendicular to one axis.

동작(330)에서 일 실시예에 따른 가속기 장치는 논-제로 타일이 레지스터에 입력되기 전까지 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터(런(run)이라고도 함), 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터(마스크(mask)라고도 함), 및 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값(activation value)에 기초하여 제3 데이터를 생성할 수 있다.In operation 330 , the accelerator device according to an embodiment performs first data (also referred to as a run) indicating the number of zero tiles input to the register before the non-zero tiles are input to the register, and non-zero tiles. second data (also referred to as a mask) indicating a pixel having a zero value and a pixel having a non-zero value in the tile, and an activation value of the pixel having a non-zero value in the non-zero tile ), the third data may be generated.

일 실시예예 따른 가속기 장치는 컴프레서의 레지스터에 입력된 단위 타일을 제로 타일 또는 논-제로 타일로 분류할 수 있다. 제로 타일은 타일 내에서 픽셀의 활성값이 모두 제로값인 타일을 나타낼 수 있다. 논-제로 타일은 타일 내에서 픽셀의 활성값 중 적어도 하나가 논-제로 값인 타일을 나타낼 수 있다. 가속기 장치는 논-제로 타일이 레지스터에 입력되기 전까지 레지스터에 입력된 제로 타일의 개수를 카운팅하고, 카운팅 결과를 지시하는 제1 데이터를 생성할 수 있다. 제1 데이터는 연속적인 제로 타일의 개수를 나타낼 수 있다. 예를 들어, 레지스터에 두개의 연속적인 제로 타일이 입력되는 경우, 제1 데이터는 10(2)이다. 제1 데이터의 비트 폭(bit width)은 미리 결정될 수 있다.The accelerator device according to an embodiment may classify the unit tile input to the register of the compressor into a zero tile or a non-zero tile. The zero tile may indicate a tile in which all active values of pixels within the tile are zero values. The non-zero tile may indicate a tile in which at least one of active values of pixels in the tile is a non-zero value. The accelerator device may count the number of zero tiles input to the register before the non-zero tiles are input to the register, and generate first data indicating a counting result. The first data may indicate the number of consecutive zero tiles. For example, when two consecutive zero tiles are input to the register, the first data is 10 (2) . A bit width of the first data may be predetermined.

일 실시예에 따른 가속기 장치는 레지스터에 입력된 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터를 생성할 수 있다. 제2 데이터의 비트 폭은 단위 타일의 크기(

Figure pat00007
)에 의하여 결정될 수 있다.The accelerator device according to an embodiment may generate second data indicating a pixel having a zero value and a pixel having a non-zero value within a non-zero tile input to a register. The bit width of the second data is the size of the unit tile (
Figure pat00007
) can be determined by

일 실시예에 따른 가속기 장치는 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값에 기초하여 제3 데이터를 생성할 수 있다. 가속기 장치는 논-제로 타일 내에서 제로값을 갖는 픽셀의 활성값을 제외하고, 논-제로 값을 갖는 픽셀의 활성값만을 추출하여 제3 데이터를 생성할 수 있다.The accelerator device according to an embodiment may generate third data based on an active value of a pixel having a non-zero value in a non-zero tile. The accelerator device may generate third data by excluding active values of pixels having a zero value in the non-zero tile and extracting only active values of pixels having a non-zero value.

동작(340)에서 일 실시예에 따른 가속기 장치는 생성된 제1 데이터, 제2 데이터, 및 제3 데이터를 버퍼(buffer)에 저장할 수 있다. 컴프레서는 저장된 데이터를 DRAM으로 출력할 수 있다.In operation 340, the accelerator device according to an embodiment may store the generated first data, second data, and third data in a buffer. The compressor can output the stored data to DRAM.

도 4는 일 실시예에 따른 가속기 장치가 특징 맵을 컴프레싱하는 방법에 관하여 설명한다.4 illustrates a method of compressing a feature map by an accelerator device according to an embodiment.

이하에서는, 특징 맵을 컴프레싱하는 다양한 방법 중 일 실시예에 따른 제1 컴프레싱 방법(440)에 관하여 설명한다. 일 실시예에 따른 가속기 장치의 컴프레서(compressor)는 특징 맵(410)을 단위 타일로 분할(divide)할 수 있고, 분할된 단위 타일 내에서 픽셀의 활성값들을 제로값 또는 논-제로 값으로 분류할 수 있다. 일 실시예에 따른 컴프레서는 논-제로 타일(423)이 컴프레서의 레지스터에 입력되기 전까지 레지스터에 입력된 연속된 제로 타일(421, 422)의 개수를 지시하는 제1 데이터(예를 들어, 10(2))를 제1 데이터(441)로 생성할 수 있다. 제1 데이터의 비트 폭은 미리 결정될 수 있다.Hereinafter, a first compression method 440 according to an embodiment among various methods for compressing the feature map will be described. A compressor of the accelerator device according to an embodiment may divide the feature map 410 into unit tiles, and classify active values of pixels in the divided unit tiles into zero or non-zero values. can do. The compressor according to an exemplary embodiment includes first data (eg, 10 ( 2) ) may be generated as the first data 441 . The bit width of the first data may be predetermined.

컴프레서는 논-제로 타일(423) 내에서 제로값의 활성값을 갖는 픽셀(431)과 논-제로 값의 활성값을 갖는 픽셀(432, 433, 434)을 지시하는 제2 데이터(442)를 생성할 수 있다. 예를 들어, 컴프레서는 제로값의 활성값을 갖는 픽셀(431)이 '0(2)'을 지시하는 것으로 결정할 수 있고, 논-제로 값의 활성값을 갖는 픽셀(432, 433, 434)이 '1'을 지시하는 것으로 결정할 수 있다. 제2 데이터(442)의 비트 폭은 단위 타일의 크기에 따라 결정될 수 있다. 예를 들어, 컴프레서는 단위 타일의 크기가 2×2로 결정된 경우, 제2 데이터(442)를 4 비트 폭으로 결정할 수 있다. 이 경우, 컴프레서는 0111(2)를 제2 데이터로 생성할 수 있다.The compressor generates second data 442 indicating a pixel 431 having an active value of zero and pixels 432 , 433 , and 434 having an active value of a non-zero value in the non-zero tile 423 . can create For example, the compressor may determine that the pixel 431 having an active value of zero indicates '0 (2) ', and the pixels 432, 433, 434 having an active value of non-zero value are It can be determined by indicating '1'. The bit width of the second data 442 may be determined according to the size of the unit tile. For example, when the size of the unit tile is determined to be 2×2, the compressor may determine the second data 442 to have a 4-bit width. In this case, the compressor may generate 0111 (2) as the second data.

일 실시예에 따른 컴프레서는 논-제로 타일(423) 내에서 논-제로 값을 갖는 픽셀(432, 433, 434)에 기초하여 제3 데이터(443)를 생성할 수 있다. 일 실시예에 따르면, 컴프레서는 논-제로 값을 갖는 픽셀(432, 433, 434)의 활성값을 고정된 제1 비트 폭의 데이터로 나타내어 생성할 수 있다. 예를 들어, N 비트 고정 소수점 시스템에서, 제1 비트 폭은 N 비트 폭을 나타낼 수 있다.The compressor according to an embodiment may generate the third data 443 based on the pixels 432 , 433 , and 434 having a non-zero value in the non-zero tile 423 . According to an embodiment, the compressor may generate an active value of the pixels 432 , 433 , and 434 having a non-zero value as data having a fixed first bit width. For example, in an N-bit fixed-point system, the first bit width may represent an N bit width.

더 나아가, 일 실시예에 따른 컴프레서는 논-제로 타일이 레지스터에 입력되기 전까지 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트가 임계값에 도달하는 경우, 임계값을 제1 데이터(441)로 생성하고, 제로값을 제2 데이터(442)로 생성할 수 있다. 여기서, 임계값은 제1 데이터의 미리 결정된 비트 폭에 따라 표현 가능한 최대값을 나타낼 수 있다. 예를 들어, 제1 데이터에 대하여 미리 결정된 비트 폭이 2 비트인 경우, 임계값은 3(11(2))으로 결정된다. 예를 들어, 컴프레서는 레지스터에 입력된 연속적인 제로 타일의 개수가 3개인 경우, 제1 데이터를 11(2)로 생성하고, 제2 데이터는 0000(2)로 생성할 수 있다. 컴프레서는 특징 맵의 단위 타일들의 활성값을 모두 컴프레싱 할 때까지 데이터의 생성 및 저장을 반복하며, 마지막에는 종료 패킷(end of packet)(444)을 생성하고 저장한다. 종료 패킷(444)은 제로 데이터일 수 있다.Furthermore, the compressor according to an embodiment sets the threshold value to the first data when the count of the first data indicating the number of zero tiles input to the register reaches the threshold value before the non-zero tiles are input to the register. 441 , and a zero value may be generated as the second data 442 . Here, the threshold value may represent a maximum value that can be expressed according to a predetermined bit width of the first data. For example, when the predetermined bit width for the first data is 2 bits, the threshold value is determined to be 3 ( 11 ( 2 ) ). For example, when the number of consecutive zero tiles input to the register is three, the compressor may generate the first data as 11 (2) and generate the second data as 0000 (2) . The compressor repeats generation and storage of data until all active values of unit tiles of the feature map are compressed, and finally generates and stores an end of packet 444 . End packet 444 may be zero data.

이하에서는, 특징 맵을 컴프레싱하는 다양한 방법 중 일 실시예에 따른 제2 컴프레싱 방법(450)에 관하여 설명한다. 가속기 장치의 컴프레서는 활성값들의 데이터 표현 비트 폭을 감소시킴으로써 보다 특징 맵의 압축률을 향상시킬 수 있다. 컴프레서는 특징 맵의 활성값을 제로값, 논-아웃라이어, 및 아웃라이어 중 하나로 분류하여 특징 맵을 컴프레싱 할 수 있다.Hereinafter, a second compression method 450 according to an embodiment among various methods for compressing the feature map will be described. The compressor of the accelerator device may further improve the compression ratio of the feature map by reducing the bit width of the data representation of the active values. The compressor may compress the feature map by classifying the active value of the feature map as one of a zero value, a non-outlier, and an outlier.

먼저, 실시예에 따른 컴프레서는 논-제로 타일(423)이 레지스터에 입력되기 전까지 레지스터에 입력된 제로 타일(421, 422)의 개수를 지시하는 제1 데이터(예를 들어, 10(2))를 제1 데이터(451)로 생성할 수 있다.First, in the compressor according to the embodiment, first data indicating the number of zero tiles 421 and 422 input to the register before the non-zero tile 423 is input to the register (eg, 10(2)) may be generated as the first data 451 .

컴프레서는 논-제로 타일(423) 내에서 픽셀의 활성값을 제로값, 논-아웃라이어, 또는 아웃라이어로 분류하여, 각 픽셀을 지시하는 제2 데이터(452)를 생성할 수 있다. 앞서 설명한 바와 같이, 논-아웃라이어는 N 비트 고정 소수점 시스템에서 N/2 비트를 사용하여 표현 가능한 활성값을 나타낼 수 있고, 아웃라이어는 N/2 비트를 사용하여 표현이 불가능한 활성값을 나타낼 수 있다.The compressor classifies an active value of a pixel in the non-zero tile 423 as a zero value, a non-outlier, or an outlier to generate second data 452 indicating each pixel. As described above, a non-outlier can represent an active value that can be expressed using N/2 bits in an N-bit fixed-point system, and an outlier can represent an active value that cannot be expressed using N/2 bits. have.

컴프레서는 논-제로 타일(423) 내의 픽셀을 활성값에 따라 구분할 수 있다. 컴프레서는 논-제로 타일(423) 내에서 제로값의 활성값을 갖는 픽셀(431)에 제1 값을 매핑할 수 있고, 논-아웃라이어의 활성값을 갖는 픽셀(432, 433)에 제2 값을 매핑할 수 있으며, 아웃라이어의 활성값을 갖는 픽셀(434)에 제3 값을 매핑할 수 있다. 예를 들어, 컴프레서는 논-제로 타일(423) 내에서 제로값의 활성값을 갖는 픽셀(431)이 '00(2)'을 지시하는 것으로 결정할 수 있고, 논-아웃라이어의 활성값을 갖는 픽셀(432, 433)이 '01(2)'을 지시하는 것으로 결정할 수 있으며, 아웃라이어의 활성값을 갖는 픽셀(434)이 '10(2)'을 지시하는 것으로 결정할 수 있다. 컴프레서는 각 픽셀이 지시하는 데이터를 연결하여 제2 데이터(452)를 생성할 수 있다. 제2 데이터(452)는 활성값을 제로값, 논-아웃라이어, 또는 아웃라이어로 구분하기 위해, 활성값을 제로값 또는 논-제로값으로 구분하기 위한 경우와 비교하여 추가적인 비트가 필요하게 된다. 그러나, 대부분의 논-제로값의 활성값은 논-아웃라이어이기 때문에, 보다 적은 비트 폭을 사용하여 제3 데이터(453)를 생성할 수 있고, 제1 컴프레싱 방법(440)과 비교하여 효과적인 압축률을 나타낼 수 있다.The compressor may classify pixels in the non-zero tile 423 according to an active value. The compressor may map a first value to a pixel 431 having an active value of zero in the non-zero tile 423 , and a second value to the pixel 432 , 433 having an active value of a non-outlier. A value may be mapped, and a third value may be mapped to the pixel 434 having the active value of the outlier. For example, the compressor may determine that a pixel 431 having an active value of zero in the non-zero tile 423 indicates '00 (2) ', and having an active value of a non-outlier It may be determined that the pixels 432 and 433 indicate '01 (2) ', and it may be determined that the pixel 434 having the active value of the outlier indicates '10 (2) '. The compressor may generate the second data 452 by connecting data indicated by each pixel. In the second data 452 , an additional bit is required to classify an active value as a zero value, a non-outlier, or an outlier, compared to a case for classifying the active value into a zero value or a non-zero value. . However, since most active values of non-zero values are non-outliers, it is possible to generate the third data 453 using a smaller bit width, which is more effective than the first compression method 440 . compression ratio can be expressed.

일 실시예에 따른 컴프레서는 논-제로 타일(423) 내에서 논-제로 값을 갖는 픽셀(432, 433, 434)에 기초하여 제3 데이터(453)를 생성할 수 있다. 일 실시예에 따른 컴프레서는 아웃라이어를 갖는 픽셀(434)의 활성값을 제1 비트 폭의 데이터로 나타내고, 논-아웃라이어를 갖는 픽셀(432, 433)의 활성값을 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 제3 데이터를 생성할 수 있다. 예를 들어, N 비트 고정 소수점 시스템에서, 제1 비트 폭은 N 비트 폭을 나타낼 수 있고, 제2 비트 폭은 N/2 비트 폭을 나타낼 수 있다. 일 실시예에 따르면, 컴프레서는 제3 데이터(453)를 생성하는 경우, 논-아웃라이어를 갖는 픽셀의 활성값을 N/2 비트 폭의 데이터로 나타낼 수 있다. 컴프레서는 논-아웃라이어를 갖는 픽셀의 활성값을 기존 고정된 N 비트 폭의 절반 만큼의 비트 폭을 사용하여 나타낼 수 있으므로 압축 효율을 높일 수 있다.The compressor according to an embodiment may generate the third data 453 based on the pixels 432 , 433 , and 434 having a non-zero value in the non-zero tile 423 . The compressor according to an embodiment represents an active value of the pixel 434 having an outlier as data of a first bit width, and sets the active value of the pixels 432 and 433 having a non-outlier as smaller than the first bit width. The third data may be generated by representing it as data having a second bit width. For example, in an N-bit fixed-point system, a first bit width may represent an N bit width, and a second bit width may represent an N/2 bit width. According to an embodiment, when the compressor generates the third data 453 , the active value of the pixel having the non-outlier may be represented as data having a width of N/2 bits. Since the compressor can represent the active value of a pixel having a non-outlier by using a bit width equal to half of the existing fixed N-bit width, compression efficiency can be increased.

컴프레서는 특징 맵의 단위 타일들의 활성값을 모두 컴프레싱 할 때까지 데이터의 생성 및 저장을 반복하며, 마지막에는 종료 패킷(end of packet)(454)을 생성하고 저장한다. 종료 패킷(454)은 제로 데이터일 수 있다.The compressor repeats generation and storage of data until all active values of unit tiles of the feature map are compressed, and finally generates and stores an end of packet 454 . End packet 454 may be zero data.

도 5는 일 실시예에 따른 가속기 장치의 구성에 관하여 설명한다.5 illustrates a configuration of an accelerator device according to an exemplary embodiment.

일 실시예에 따른 가속기 장치(510)는 프로세싱 엘리먼트 어레이(processing element array, PE array)(511), 온칩 글로벌 버퍼(On-chip global buffer)(512), 제어기(controller)(513), 컴프레서(514), 및 디컴프레서(515)를 포함할 수 있다.The accelerator device 510 according to an embodiment includes a processing element array (PE array) 511 , an on-chip global buffer 512 , a controller 513 , and a compressor ( 514 ), and a decompressor 515 .

프로세싱 엘리먼트 어레이(511)는 컨볼루션 뉴럴 네트워크 연산을 수행할 수 있다. 프로세싱 엘리먼트 어레이(511)의 컨볼루션 뉴럴 네트워크 연산 수행을 위하여 오프 칩 메모리(520)(예를 들어, DRAM)에서 적절한 데이터가 디컴프레서(515)에 의하여 디컴프레싱되고, 디컴프레싱된 데이터가 온칩 글로벌 버퍼(512)에 로드될 수 있다. 프로세싱 엘리먼트 어레이(511)에서 컨볼루션 뉴럴 네트워크 연산을 통하여 계산된 데이터는 온칩 글로벌 버퍼(512)로 전송되어 저장되고, 컴프레서(514)를 통하여 컴프레싱된 데이터가 오프 칩 메모리(520)로 전송되어 저장될 수 있다. 이하, 도 6에서는 컴프레서의 구조에 관하여 보다 자세히 설명하고, 도 7에서는 디컴프레서의 구조에 관하여 보다 자세히 설명한다.The processing element array 511 may perform a convolutional neural network operation. Appropriate data from the off-chip memory 520 (eg, DRAM) is decompressed by the decompressor 515 to perform the convolutional neural network operation of the processing element array 511 , and the decompressed data is transferred to the on-chip global It may be loaded into the buffer 512 . Data calculated through the convolutional neural network operation in the processing element array 511 is transmitted to and stored in the on-chip global buffer 512 , and data compressed through the compressor 514 is transmitted to the off-chip memory 520 . can be saved. Hereinafter, the structure of the compressor will be described in more detail in FIG. 6 , and the structure of the decompressor will be described in more detail in FIG. 7 .

도 6은 일 실시예에 따른 컴프레서의 구조에 관하여 설명한다.6 illustrates a structure of a compressor according to an embodiment.

일 실시예에 따른 컴프레서는 특징 맵을 컴프레싱 할 수 있다. 일 실시예에 따른 컴프레서(600)는 레지스터(601), 비교기(602), 버퍼(603), 및 제어기(613)를 포함할 수 있다.The compressor according to an embodiment may compress the feature map. The compressor 600 according to an embodiment may include a register 601 , a comparator 602 , a buffer 603 , and a controller 613 .

가속기 장치는 입력 이미지로부터 컨볼루션 뉴럴 네트워크 모델에 포함된 하나 이상의 레이어에 기초하여 획득된 특징 맵에 대하여, 미리 결정된 크기의 단위 타일들로 특징 맵을 분할할 수 있다. 일 실시예에 따른 컴프레서의 레지스터(601)는 특징 맵의 분할된 단위 타일들을 순차적으로 입력 받을 수 있다. 레지스터(601)에 단위 타일이 포함하는 픽셀의 활성값들이 입력될 수 있다. 비교기(602)는 레지스터에 입력되어 저장된 데이터들을 비교할 수 있다. 이하에서는, 일 실시예에 따른 제2 압축 방법(450)을 컴프레서(600)의 구조와 함께 설명한다.The accelerator device may divide the feature map into unit tiles having a predetermined size with respect to the feature map obtained from the input image based on one or more layers included in the convolutional neural network model. The register 601 of the compressor according to an embodiment may sequentially receive the divided unit tiles of the feature map. Active values of pixels included in the unit tile may be input to the register 601 . The comparator 602 may compare data input and stored in a register. Hereinafter, the second compression method 450 according to an embodiment will be described along with the structure of the compressor 600 .

첫 번째 주기(cycle)에서, 컴프레서의 병렬 레지스터(601)에 단위 타일의 활성값들(Din0, Din1, ..., Dink-1)이 입력되어 저장될 수 있다. 일 실시예에 따르면, 컴프레서의 병렬 레지스터(601)에 픽셀의 활성값이 상위 비트 데이터(641)와 하위 비트 데이터(642)로 나누어져 입력될 수 있다. 컴프레서의 제어기가 픽셀의 활성값을 상위 비트 데이터(641) 및 하위 비트 데이터(642)로 나누어 레지스터(601)에 입력할 수 있다. 상위 비트 데이터(641)는 N/2 비트 위치로부터 최상위 비트(most significant bit, MSB) 위치까지의 비트 위치에 대응하는 데이터를 나타낼 수 있다. 상위 비트 데이터(641)는 N 비트 고정 소수점 시스템에서 활성값을 N 비트로 표현하는 경우, 상위 N/2 비트에 대응하는 데이터를 나타낼 수 있다. 하위 비트 데이터(642)는 최하위 비트(least significant bit, LSB)로부터 N/2 비트 위치까지의 비트 위치에 대응하는 데이터를 나타낼 수 있다. 하위 비트 데이터(642)는 활성값을 N 비트로 표현하는 경우, 하위 N/2 비트에 대응하는 데이터를 나타낼 수 있다.In a first cycle, active values Din 0 , Din 1 , ..., Din k-1 of the unit tile may be input to and stored in the parallel register 601 of the compressor. According to an embodiment, an active value of a pixel may be divided into high-order bit data 641 and low-order bit data 642 and input to the parallel register 601 of the compressor. The controller of the compressor may divide the active value of the pixel into high-order bit data 641 and low-order bit data 642 and input it to the register 601 . The high-order bit data 641 may indicate data corresponding to a bit position from an N/2 bit position to a most significant bit (MSB) position. High-order bit data 641 may represent data corresponding to high-order N/2 bits when an active value is expressed by N bits in an N-bit fixed-point system. The low-order bit data 642 may indicate data corresponding to bit positions from a least significant bit (LSB) to an N/2 bit position. The low-order bit data 642 may represent data corresponding to the low-order N/2 bits when an active value is expressed by N bits.

비교기(602)는 하나의 픽셀에 대응하는 활성값의 상위 비트 데이터(641) 및 하위 비트 데이터(642)가 각각 제로값인지 여부를 판단할 수 있다. 제어기(613)는 비교 결과에 기초하여 활성값을 아웃라이어, 논-아웃라이어, 또는 제로값 중 하나로 분류할 수 있다. 컴프레서의 제어기는 비교 결과에 기초하여, 하나의 픽셀에 대응하는 활성값의 상위 비트 데이터(641) 및 하위 비트 데이터(642)가 모두 논-제로 값인 경우, 활성값을 아웃라이어로 분류할 수 있다. 마찬가지로, 컴프레서의 제어기는 상위 비트 데이터(641)가 제로값이고, 하위 비트 데이터(642)가 논-제로 값인 경우 활성값을 논-아웃라이어로 분류하며, 상위 비트 데이터(641) 및 하위 비트 데이터(642)가 모두 제로 값인 경우 활성값을 제로값으로 분류할 수 있다.The comparator 602 may determine whether the higher bit data 641 and the lower bit data 642 of the active value corresponding to one pixel are zero values, respectively. The controller 613 may classify the active value as one of an outlier, a non-outlier, or a zero value based on the comparison result. Based on the comparison result, the controller of the compressor may classify the active value as an outlier when both the upper bit data 641 and the lower bit data 642 of the active value corresponding to one pixel are non-zero values. . Similarly, when the high-order bit data 641 is a zero value and the low-order bit data 642 is a non-zero value, the controller of the compressor classifies the active value as a non-outlier, and the high-bit data 641 and the low-order bit data When all (642) is a zero value, the active value may be classified as a zero value.

다음 주기에서, 일 실시예에 따른 컴프레서(600)는 입력된 단위 픽셀의 활성값 중 논-제로 값을 갖는 픽셀의 활성값에 기초하여 데이터(631)를 생성할 수 있다. 제어기는 픽셀의 활성값 중 제로값을 제거하는 시프트 앤 어팬드(shift-and-append) 로직을 통하여 논-제로 값을 순차적으로 추출할 수 있다. 컴프레서는 먹스(mux)(604)를 사용하여 아웃라이어로 분류된 활성값은 제1 비트 폭 데이터로 나타내고, 논-아웃라이어로 분류된 활성값은 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 제3 데이터(630)를 생성할 수 있다.In the next cycle, the compressor 600 according to an embodiment may generate the data 631 based on the active value of the pixel having the non-zero value among the input active values of the unit pixel. The controller may sequentially extract non-zero values through a shift-and-append logic that removes a zero value among active values of a pixel. The compressor uses a mux 604 to represent an active value classified as an outlier as first bit-width data, and an active value classified as a non-outlier is data of a second bit width that is smaller than the first bit width By representing , the third data 630 may be generated.

마지막 주기에서, 컴프레서는 제1 데이터(610), 제2 데이터(620), 제3 데이터(630)를 버퍼(603)에 저장할 수 있다. 일 실시예에 따른 컴프레서의 제어기는 비교기의 비교 결과에 따라 제로값으로 분류된 활성값을 제1 값에 대응시키고, 논-아웃라이어로 분류된 활성값을 제2 값에 대응시키며, 아웃라이어로 분류된 활성값을 제3 값에 대응시킴으로써 제2 데이터(620)를 생성할 수 있다. 제어기는 비교기의 비교 결과에 따라 제로값으로 분류된 활성값의 픽셀에 제1 값을 매핑하고, 논-아웃라이어로 분류된 활성값의 픽셀에 제2 값을 매핑하며, 아웃라이어로 분류된 활성값의 픽셀에 제3 값을 매핑하여 제2 데이터(620)를 생성할 수 있다. 제1 값, 제2 값, 및 제3 값은 서로 상이한 데이터일 수 있다. 예를 들어, 제1 값은 '00(2)'일 수 있고, 제2 값은 '01(2)'일 수 있으며, 제3 값은 '10(2)'일 수 있다. 각 픽셀이 지시하는 값을 순차적으로 연결함으로써 제2 데이터(620)를 생성할 수 있다. 여기서, 제2 데이터의 비트 수는 단위 타일이 포함하는 픽셀 수의 2배일 수 있다.In the last cycle, the compressor may store the first data 610 , the second data 620 , and the third data 630 in the buffer 603 . The controller of the compressor according to an embodiment corresponds to the first value the active value classified as a zero value according to the comparison result of the comparator, and the active value classified as non-outlier to the second value, and to the outlier The second data 620 may be generated by matching the classified activity value to the third value. The controller maps the first value to the pixel with the active value classified as a zero value according to the comparison result of the comparator, maps the second value to the pixel with the active value classified as a non-outlier, and maps the active value classified as an outlier. The second data 620 may be generated by mapping the third value to the pixel of the value. The first value, the second value, and the third value may be different data. For example, the first value may be '00 (2) ', the second value may be '01 (2) ', and the third value may be '10 (2) '. The second data 620 may be generated by sequentially connecting values indicated by each pixel. Here, the number of bits of the second data may be twice the number of pixels included in the unit tile.

일 실시예에 따른 컴프레서의 제어기는 입력된 단위 타일을 제로 타일 또는 논-제로 타일로 분류할 수 있다. 컴프레서의 제어기는 단위 타일의 입력된 활성값이 모두 제로값인 경우에 입력된 단위 타일이 제로 타일인 것으로 판단할 수 있다. 보다 구체적으로, 제어기는 단위 픽셀 내에서 각 픽셀을 지시하는 제2 데이터(620)를 사용하여 입력된 단위 타일이 제로 타일인 지 판단할 수 있다. 컴프레서(600)는 입력된 단위 타일 내에서 각 픽셀이 지시하는 값의 합(611)이 제로값인지 여부를 판단할 수 있다. 컴프레서(600)는 각 픽셀이 지시하는 값의 합(611)이 제로값인 경우, 입력된 단위 타일이 제로 타일인 것으로 판단할 수 있다. 컴프레서는 각 픽셀이 지시하는 값의 합이 논-제로 값인 경우, 입력된 단위 타일이 논-제로 타일인 것으로 판단할 수 있다. 일 실시예에 따른 컴프레서는 입력된 단위 픽셀이 제로 타일인 것으로 판단된 경우, 논-제로 타일이 레지스터에 입력되기 전까지 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트(612)를 '1'만큼 증가시킬 수 있다. 다시 말해, 컴프레서는 입력된 단위 타일의 각 픽셀이 지시하는 값의 합(611)이 제로값인 경우, 제1 데이터의 카운트(612)를 '1'만큼 증가시킬 수 있다. 제어기(613)는 입력된 단위 타일의 각 픽셀이 지시하는 값의 합(611)이 논-제로 인 경우, 입력된 단위 타일이 논-제로 타일인 것으로 판단할 수 있다. 컴프레서의 제어기는 논-제로 타일이 레지스터에 입력된 경우, 제1 데이터의 카운트(612)에 저장된 값에 따라 제1 데이터(610)를 생성하고, 생성된 제1 데이터(610)를 버퍼(603)에 저장할 수 있다. 또한, 컴프레서는 논-제로 타일이 레지스터에 입력된 경우, 생성된 제2 데이터(620)를 버퍼(603)에 저장할 수 있고, 제3 데이터(630)를 버퍼(603)에 저장할 수 있다.The controller of the compressor according to an embodiment may classify the input unit tile into a zero tile or a non-zero tile. The controller of the compressor may determine that the input unit tile is a zero tile when all of the input active values of the unit tile are zero values. More specifically, the controller may determine whether the input unit tile is a zero tile using the second data 620 indicating each pixel within the unit pixel. The compressor 600 may determine whether the sum 611 of values indicated by each pixel within the input unit tile is zero. When the sum 611 of the values indicated by each pixel is a zero value, the compressor 600 may determine that the input unit tile is a zero tile. When the sum of values indicated by each pixel is a non-zero value, the compressor may determine that the input unit tile is a non-zero tile. When it is determined that the input unit pixel is a zero tile, the compressor according to an embodiment calculates a count 612 of first data indicating the number of zero tiles input to the register before the non-zero tile is input to the register. It can be increased by '1'. In other words, when the sum 611 of the values indicated by each pixel of the input unit tile is zero, the compressor may increase the count 612 of the first data by '1'. When the sum 611 of values indicated by each pixel of the input unit tile is non-zero, the controller 613 may determine that the input unit tile is a non-zero tile. When the non-zero tile is input to the register, the controller of the compressor generates the first data 610 according to the value stored in the count 612 of the first data, and stores the generated first data 610 in the buffer 603 ) can be stored in Also, when the non-zero tile is input to the register, the compressor may store the generated second data 620 in the buffer 603 and store the third data 630 in the buffer 603 .

단위 타일을 컴프레싱하기 위한 지연 시간은 3 내지 4+k 사이클(cycle)로 다양하게 나타난다. 여기서, k는 단위 타일이 포함하는 픽셀의 수를 나타낼 수 있다. 최소 주기는 제로 타일이 레지스터에 입력되는 경우에 나타나며, 최대 주기는 단위 타일의 모든 픽셀의 활성값이 논-제로 값인 경우에 나타난다. 컴프레서가 n개 사용되는 경우에 특징 맵을 컴프레싱 하기 위한 시간은 n 배 감소한다. 여기서, n은 자연수를 나타낼 수 있다.The delay time for compressing the unit tile varies from 3 to 4+k cycles. Here, k may represent the number of pixels included in the unit tile. The minimum period appears when a zero tile is input to the register, and the maximum period appears when the active values of all pixels of the unit tile are non-zero values. When n compressors are used, the time to compress the feature map is reduced by n times. Here, n may represent a natural number.

도 7은 일 실시예에 따른 특징 맵을 디컴프레싱하는 디컴프레서의 구조에 관하여 설명한다.7 illustrates a structure of a decompressor for decompressing a feature map according to an embodiment.

일 실시예에 따른 특징 맵을 디컴프레싱하는 디컴프레서(700)(이하, '디컴프레서')는 CNN 모델의 레이어에 기초하여 획득된 특징 맵이 컴프레싱된 데이터를 디컴프레싱 할 수 있다. 디컴프레서의 레지스터에는 특징 맵이 컴프레싱된 데이터가 입력될 수 있다.The decompressor 700 (hereinafter, 'decompressor') for decompressing the feature map according to an embodiment may decompress the data obtained by compressing the feature map obtained based on the layer of the CNN model. Data obtained by compressing the feature map may be input to the register of the decompressor.

첫 번째 주기에서 제1 데이터(710), 제2 데이터(720)가 동시에 디컴프레서(700)의 레지스터로 입력되어 저장될 수 있다. 다음 주기에서 제3 데이터(730)가 디컴프레서(700)의 레지스터로 입력되어 저장될 수 있다. 디컴프레서(700)는 논-제로 값의 활성값을 나타내는 제3 데이터(730)를 입력되는 순서대로 레지스터에 저장할 수 있다. 다음 주기에서 디컴프레서의 제어기(713)는 제1 데이터(710)에 대응하는 개수의 제로 타일을 생성하여 버퍼로 전송할 수 있다. 마지막 주기에서 디컴프레서의 제어기는 제2 데이터(720) 및 제3 데이터(730)를 사용하여 논-제로 타일을 생성하고, 버퍼로 전송할 수 있다. 디컴프레서의 제어기(713)는 제2 데이터(720)를 이용하여 논-제로 타일 내에서 제로값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 구분할 수 있다. 디컴프레서의 제어기(713)는 제로값을 갖는 픽셀의 활성값은 제로값과 대응시키고, 논-제로 값을 갖는 픽셀의 활성값은 제3 데이터와 순차적으로 대응시켜 논-제로 타일을 생성할 수 있다. 디컴프레서는 종료 패킷이 전송될 때까지 위의 순서를 반복한다.In the first cycle, the first data 710 and the second data 720 may be simultaneously input to and stored in the register of the decompressor 700 . In the next cycle, the third data 730 may be input to and stored in the register of the decompressor 700 . The decompressor 700 may store the third data 730 indicating the active value of the non-zero value in the register in the order in which it is input. In the next cycle, the controller 713 of the decompressor may generate and transmit the number of zero tiles corresponding to the first data 710 to the buffer. In the last cycle, the controller of the decompressor may generate a non-zero tile by using the second data 720 and the third data 730 and transmit it to the buffer. The controller 713 of the decompressor may distinguish a pixel having a zero value and a pixel having a non-zero value in the non-zero tile using the second data 720 . The controller 713 of the decompressor may generate a non-zero tile by sequentially matching the active value of the pixel having a zero value with the zero value, and sequentially matching the active value of the pixel having a non-zero value with the third data. have. The decompressor repeats the above sequence until the end packet is transmitted.

특징 맵 컴프레싱 데이터를 디컴프레싱 하기 위한 지연 시간은 3 내지 3+l 사이클(cycle)로 다양하게 나타난다. 여기서, l은 제1 데이터의 최대 크기(magnitude)를 나타낼 수 있다. 최소 주기는 종료 패킷을 디컴프레싱하는 경우에 나타나며, 최대 주기는 제1 데이터가 최대 크기를 가지는 경우에 나타날 수 있다. 디컴프레서가 n개 사용되는 경우에 특징 맵 컴프레싱 데이터의 디컴프레싱을 위한 시간은 n 배 감소한다. 여기서, n은 자연수를 나타낼 수 있다.The delay time for decompressing the feature map compression data varies from 3 to 3+1 cycles. Here, l may represent the maximum magnitude of the first data. The minimum period may appear when the end packet is decompressed, and the maximum period may appear when the first data has a maximum size. When n decompressors are used, the time for decompressing the feature map compression data is reduced by n times. Here, n may represent a natural number.

아래 표 1은 일 실시예에 따른 컴프레서와 디컴프레서에 대한 하드웨어의 크기 및 전력 소모에 대하여 나타낸다.Table 1 below shows hardware sizes and power consumption for a compressor and a decompressor according to an embodiment.

장치Device 크기[

Figure pat00008
]size[
Figure pat00008
] 전력 소모[mW]Power consumption [mW] 도 6에 따른 컴프레서Compressor according to fig. 11,12411,124 0.4880.488 도 7에 따른 디컴프레서Decompressor according to Fig. 7 4,0604,060 0.240.24 MAC(multiply-accumulate)MAC (multiply-accumulate) 1,2831,283 0.2480.248 256 MACs256 MACs 328,448328,448 63.488863.4888

표 1에서는 일 실시예에 따른 컴프레서 및 디컴프레서에 대한 하드웨어의 크기 및 전력 소모와 함께, CNN 가속기 장치 내 MAC(multiply-accumulate) 유닛에 대한 크기 및 전력 소모, 일반적인 CNN 가속기 장치에서 사용되는 개수(예를 들어, 256개) 만큼의 MAC 유닛 전체의 크기 및 전력소모에 대하여 나타낸다. MAC 유닛은 8-비트 곱셈기와 28-비트 누산기로 이루어져 있다. 일 실시예에 따른 컴프레서 및 디컴프레서의 크기 및 전력 소모는 한 개의 MAC 유닛과 비슷한 수준을 보인다. MAC 유닛은 CNN 가속기 장치에서 아주 작은 부분을 차지 하고 있기 때문에, 일 실시예에 따른 컴프레서 또는 디컴프레서의 크기와 전력소모는 아주 작다고 할 수 있다. 일 실시예에 따른 컴프레서 또는 디컴프레서의 크기와 전력소모는 일반적인 CNN 가속기 장치와 비교하여 크기는 4.62%, 전력소모는 1.15% 정도에 불과하다.In Table 1, along with the size and power consumption of hardware for the compressor and decompressor according to an embodiment, the size and power consumption for the MAC (multiply-accumulate) unit in the CNN accelerator device, the number used in the general CNN accelerator device ( For example, it represents the size and power consumption of the entire MAC unit as much as 256). The MAC unit consists of an 8-bit multiplier and a 28-bit accumulator. The size and power consumption of the compressor and the decompressor according to an embodiment are similar to that of one MAC unit. Since the MAC unit occupies a very small part in the CNN accelerator device, the size and power consumption of the compressor or decompressor according to an embodiment are very small. The size and power consumption of the compressor or decompressor according to an embodiment are 4.62% and power consumption of only about 1.15% compared to a general CNN accelerator device.

도 8은 단위 타일의 크기에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 도시한다.8 shows a graph of the reciprocal of normalized DRAM access according to the size of a unit tile.

이하에서는, 일 실시예에 따른 가속기 장치가 컴프레서 또는 디컴프레서를 사용하여 특징 맵을 컴프레싱 또는 디컴프레싱한 결과에 관하여 설명한다. VGG16, ExtractionNet, 및 ResNet-18의 세가지 CNN 네트워크를 사용하여 특징 맵이 추론(inference)될 수 있다. 3개의 CNN 특징 맵은 아래 수학식 3을 사용하여 k 비트로 양자화될 수 있다.Hereinafter, a result of compressing or decompressing a feature map using a compressor or a decompressor by the accelerator device according to an exemplary embodiment will be described. Feature maps can be inferred using three CNN networks: VGG16, ExtractionNet, and ResNet-18. The three CNN feature maps can be quantized to k bits using Equation 3 below.

Figure pat00009
Figure pat00009

특징 맵을 컴프레싱하는 방법에 대한 압축률(Compression ratio)은 아래 수학식 4와 같이 정의된다.A compression ratio for a method of compressing the feature map is defined as in Equation 4 below.

Figure pat00010
Figure pat00010

압축률(Compression ration)은 양의 유리수로 나타나되, 압축되지 않은 데이터의 압축률은 '1'로 나타난다.The compression ratio is expressed as a positive rational number, but the compression rate of uncompressed data is expressed as '1'.

일 실시예에 따른 특징 맵을 컴프레싱하는 방법 또는 특징 맵을 디컴프레싱하는 방법에 대한 압축 효과(compression effect)는 정규화된 DRAM 액세스의 역수를 사용하여 평가될 수 있다. 도 8은 세가지의 CNN 네트워크에서 단위 타일의 크기에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 도시한다. 그래프(810)은 VGG-16 네트워크에서 단위 타일의 크기(

Figure pat00011
)에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 나타낸다. 그래프(820)은 ExtractionNet 네트워크에서 단위 타일의 크기에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 나타낸다. 그래프(830)은 ResNet-18 네트워크에서 단위 타일의 크기에 따른 정규화된 DRAM 액세스의 역수에 대한 그래프를 나타낸다.A compression effect of a method of compressing a feature map or a method of decompressing a feature map according to an embodiment may be evaluated using the reciprocal of normalized DRAM accesses. 8 shows a graph of the reciprocal of normalized DRAM access according to the size of a unit tile in three CNN networks. The graph 810 shows the size of the unit tile in the VGG-16 network (
Figure pat00011
) shows a graph for the inverse of normalized DRAM access according to The graph 820 shows a graph of the reciprocal of normalized DRAM access according to the size of a unit tile in the ExtractionNet network. The graph 830 shows a graph of the reciprocal of normalized DRAM access according to the size of a unit tile in the ResNet-18 network.

각 DRAM 액세스는 다양한 비트로 양자화된 특징 맵(예를 들어, 4 비트 내지 8 비트로 양자화된 특징 맵)의 평균 액세스의 수를 나타내고, 각 평균 액세스의 수는 압축 전의 데이터 크기로 정규화 되었다. VGG-16 네트워크에서는 m 및 n이 2인 경우에 DRAM 액세스의 수가 가장 작게 나타난다. VGG-16 네트워크에서 m 또는 n이 2보다 큰 값을 가지는 경우에는, DRAM 액세스의 수가 증가하는 것으로 나타난다. 큰 단위 타일을 사용하여 특징 맵을 분할하는 경우, 제로 타일로 많은 제로값을 한 번에 컴프레싱 할 수 있으나, 큰 단위 타일 내에서 픽셀의 모든 활성값이 제로값인 경우는 거의 없기 때문에 제로 타일의 수가 급격히 감소하여 압축률이 좋지 않게 나타난다. 이러한 경향성의 원인은, 도 2를 참조하면, VGG-16 네트워크에서 평균적인 공간적 상호 관계성(Moran의 I)이 활성값 사이의 거리가 '3'이상인 경우에 크게 감소하기 때문에 발생한다. 따라서, 활성값 사이의 거리, 즉 단위 타일의 가로 길이 또는 세로 길이가 '3' 이상인 경우, 제로 타일의 개수가 줄어든다. 더 나아가, 크기가 큰 단위 타일일수록 많은 비트 폭(bit width)의 제2 데이터를 필요로 하기 때문에, 단위 타일의 크기는 공간적 상호 관계성을 고려하여 결정되어야 한다. 결과적으로 DRAM 액세스의 수는 VGG-16 네트워크에서 0.36으로 m=2, n=2에서 최소이다. 또한, 그래프(820) 및 그래프(830)을 참조하면, ExtractionNet 네트워크 및 ResNet-18 네트워크에서도 DRAM 액세스의 수는 각각 0.37 및 0.34로 m=2, n=2에서 최소이다.Each DRAM access represents the average number of accesses of a feature map quantized to various bits (eg, a feature map quantized to 4 to 8 bits), and the average number of accesses for each is normalized to the data size before compression. In the VGG-16 network, the number of DRAM accesses is smallest when m and n are 2. When m or n has a value greater than 2 in the VGG-16 network, the number of DRAM accesses appears to increase. When a feature map is segmented using a large unit tile, many zeros can be compressed with zero tiles at once. The number of is rapidly decreased, resulting in poor compression ratio. The cause of this tendency is that, referring to FIG. 2, the average spatial correlation (Moran's I) in the VGG-16 network is greatly reduced when the distance between active values is '3' or more. Accordingly, when the distance between active values, that is, the horizontal length or the vertical length of the unit tile is '3' or more, the number of zero tiles is reduced. Furthermore, since a unit tile having a larger size requires a large amount of second data having a bit width, the size of the unit tile should be determined in consideration of spatial interrelationship. As a result, the number of DRAM accesses is 0.36 in the VGG-16 network, which is the minimum at m=2 and n=2. In addition, referring to the graph 820 and the graph 830, the number of DRAM accesses in the ExtractionNet network and the ResNet-18 network is 0.37 and 0.34, respectively, respectively, which is the minimum at m=2 and n=2.

도 9는 다양한 컴프레싱 방법에 따른 특징 맵의 압축률 및 희소성(sparsity)에 관한 그래프를 나타낸다.9 is a graph showing a compression ratio and sparsity of a feature map according to various compression methods.

그래프(910)는 VGG-16 네트워크에서 컴프레싱 방법에 따른 각 레이어에 대한 특징 맵의 압축률 및 희소성에 관한 그래프를 나타낸다. 그래프(920)는 ExtractionNet 네트워크에서 컴프레싱 방법에 따른 각 레이어에 대한 특징 맵의 압축률 및 희소성에 관한 그래프를 나타낸다. 그래프(930)는 ResNet-18 네트워크에서 컴프레싱 방법에 따른 각 레이어에 대한 특징 맵의 압축률 및 희소성에 관한 그래프를 나타낸다.The graph 910 represents a graph regarding the compression ratio and sparsity of the feature map for each layer according to the compression method in the VGG-16 network. The graph 920 represents a graph regarding the compressibility and sparsity of the feature map for each layer according to the compression method in the ExtractionNet network. The graph 930 shows a graph regarding the compression ratio and sparsity of the feature map for each layer according to the compression method in the ResNet-18 network.

그래프(911), 그래프(912), 그래프(913), 그래프(914), 및 그래프(915)는 VGG-16 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 레이어에 대한 특징 맵의 압축률을 나타낸다. 그래프(916)은 VGG-16 네트워크에서 레이어에 대한 특징 맵의 희소성에 관한 그래프를 나타낸다.Graph 911 , graph 912 , graph 913 , graph 914 , and graph 915 are RLC8, RLC4, ZVC, first compression method 440, and second compression method in the VGG-16 network, respectively. It represents the compression ratio of the feature map for the layer according to the pressing method 450 . Graph 916 represents a graph regarding the sparsity of feature maps for layers in the VGG-16 network.

RLC(Run-length Compression, 런 렝스 부호화)는 특징 맵 내에서 연속적인 제로 타일들을 하나의 런(run) 데이터로 표현함으로써 DRAM 액세스를 낮추는 방법이다. RLC는 런 데이터 뒤에 제로값이 아닌 데이터를 저장한다. RLC4 및 RLC8은 각각 4 비트의 런 데이터 및 8 비트의 런 데이터를 사용하는 컴프레싱 방법을 나타낸다. ZVC(Zero-value Compression)은 특징 맵 내에서 제로값이 아닌 데이터를 저장하고, 해당 데이터의 위치값을 나타내는 마스크(mask) 데이터를 저장하는 방법이다.Run-length compression (RLC) is a method of lowering DRAM access by expressing consecutive zero tiles in a feature map as one run data. RLC stores non-zero data after run data. RLC4 and RLC8 indicate a compression method using 4 bits of run data and 8 bits of run data, respectively. ZVC (Zero-Value Compression) is a method of storing non-zero data in a feature map and storing mask data indicating a position value of the corresponding data.

도 9를 참조하면, 압축률은 특징 맵의 희소성과 상당한 연관관계를 나타낸다. 뒤 쪽의 레이어에서는 특징 맵의 희소성이 상승하게 된다. 따라서 레이어가 더 깊을수록, 모든 알고리즘의 압축률은 증가하는 것으로 나타난다. 일 실시예에 따른 제2 컴프레싱 방법(450)은 2.77의 가장 높은 평균 압축률을 나타내며, RLC8, RLC4, ZVC의 평균 압축률은 각각 1.60, 1.86 및 2.21로 나타난다.Referring to FIG. 9 , the compression ratio shows a significant correlation with the sparsity of the feature map. In the back layer, the sparseness of the feature map increases. Therefore, it appears that the deeper the layer, the higher the compression rate of all algorithms. The second compression method 450 according to an embodiment shows the highest average compression ratio of 2.77, and the average compression ratios of RLC8, RLC4, and ZVC are 1.60, 1.86, and 2.21, respectively.

특정 레이어에서 특징 맵의 낮은 희소성으로 인해 RLC8 및 RLC4의 압축률은 1.0 이하로 나타난다. 그러나, ZVC, 제1 컴프레싱 방법(440) 및 제2 컴프레싱 방법(450)에 따른 압축률은 항상 1.0 이상으로 나타난다. 8 번째 레이어부터는 제1 컴프레싱 방법 또는 제2 컴프레싱 방법의 압축률과 ZVC의 압축률 간의 차이가 점진적으로 증가하는 것으로 나타나는데, 이는 특징 맵의 희소성이 상승하였을 때, 제1 컴프레싱 방법 또는 제2 컴프레싱 방법은 논-제로 타일을 이용하여 효과적으로 제로값을 압축할 수 있기 때문이다. 비록 몇 개의 레이어(예를 들어, 2, 3, 4, 및 7번째 레이어)에서 ZVC가 제1 컴프레싱 방법(440)에 비하여 더 높은 압축률을 갖는 것으로 나타나나, 해당 레이어에서 ZVC와 제1 컴프레싱 방법(440) 간의 압축률의 차이는 0.04 이하로 아주 작게 나타난다.Due to the low sparseness of the feature map in a specific layer, the compression ratios of RLC8 and RLC4 are less than 1.0. However, the compression ratio according to the ZVC, the first compression method 440 and the second compression method 450 always appears as 1.0 or more. From the 8th layer, the difference between the compression ratio of the first compression method or the second compression method and the compression ratio of the ZVC gradually increases, which occurs when the sparsity of the feature map increases. This is because the pressing method can effectively compress a zero value using a non-zero tile. Although it is shown that ZVC has a higher compression ratio than that of the first compression method 440 in some layers (eg, the 2nd, 3rd, 4th, and 7th layers), ZVC and the first Compression The difference in compression ratio between the pressing methods 440 is very small, 0.04 or less.

그래프(921), 그래프(922), 그래프(923), 그래프(924), 및 그래프(95)는 ExtractionNet 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 레이어에 대한 특징 맵의 압축률을 나타낸다. 그래프(926)은 ExtractionNet 네트워크에서 레이어에 대한 특징 맵의 희소성에 관한 그래프를 나타낸다. ExtractionNet 네트워크에서도 제2 컴프레싱 방법(450)에 따른 압축률이 가장 좋은 압축률을 나타낸다. ExtractionNet에 대한 RLC8, RLC4, ZVC 및 제2 컴프레싱 방법(450)의 평균 압축 비율은 각각 1.73, 1.97, 2.32 및 2.84로 나타난다.Graph 921, graph 922, graph 923, graph 924, and graph 95 are RLC8, RLC4, ZVC, first compression method 440, and second compression method, respectively, in the ExtractionNet network. It represents the compression ratio of the feature map for the layer according to (450). Graph 926 represents a graph regarding the sparsity of feature maps for layers in the ExtractionNet network. In the ExtractionNet network, the compression ratio according to the second compression method 450 represents the best compression ratio. The average compression ratios of RLC8, RLC4, ZVC and the second compression method 450 for ExtractionNet are 1.73, 1.97, 2.32 and 2.84, respectively.

그래프(931), 그래프(932), 그래프(933), 그래프(934), 및 그래프(935)는 ResNet-18 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 레이어에 대한 특징 맵의 압축률을 나타낸다. 그래프(926)은 ResNet-18 네트워크에서 레이어에 대한 특징 맵의 희소성에 관한 그래프를 나타낸다. RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440) 및 제2 컴프레싱 방법(450)의 평균 압축률은 각각 2.21, 2.36, 2.66, 3.30 및 3.52로 나타난다. ResNet-18의 희소성이 출렁이는 이유는 숏컷-레이어(shortcut-layer)의 영향이다.Graph 931 , graph 932 , graph 933 , graph 934 , and graph 935 are RLC8, RLC4, ZVC, first compression method 440, second compression method, respectively, in the ResNet-18 network. It represents the compression ratio of the feature map for the layer according to the pressing method 450 . Graph 926 represents a graph regarding the sparsity of feature maps for layers in the ResNet-18 network. The average compression rates of RLC8, RLC4, ZVC, the first compression method 440 and the second compression method 450 are 2.21, 2.36, 2.66, 3.30, and 3.52, respectively. The reason ResNet-18's rarity fluctuates is the effect of the shortcut-layer.

도 10은 양자화된 활성값에 대하여 컴프레싱된 특징 맵의 정규화된 DRAM 액세스의 값을 나타낸다.Figure 10 shows the values of normalized DRAM accesses of the compressed feature map with respect to quantized activation values.

그래프(1010), 그래프(1020), 그래프(1030)는 각각 VGG-16 네트워크, Extraction 네트워크, ResNet 네트워크에서 4비트부터 8비트까지 양자화된 활성값에 대하여 컴프레싱된 특징 맵의 정규화된 DRAM 액세스 값을 나타낸다.Graph 1010, graph 1020, and graph 1030 are the normalized DRAM access values of the feature map compressed with respect to active values quantized from 4 bits to 8 bits in the VGG-16 network, the Extraction network, and the ResNet network, respectively. indicates

그래프(1011), 그래프(1012), 그래프(1013), 그래프(1014), 그래프(1015)는 VGG-16 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 컴프레싱된 특징 맵의 정규화된 DRAM 액세스의 값에 대한 그래프를 나타낸다.Graph 1011, Graph 1012, Graph 1013, Graph 1014, Graph 1015 are RLC8, RLC4, ZVC, First Compression Method 440, Second Compression, respectively, in the VGG-16 network. A graph is shown for values of normalized DRAM accesses of a compressed feature map according to method 450 .

4비트부터 8비트까지 양자화된 활성값에 대하여 컴프레싱된 특징 맵의 정규화된 DRAM 액세스 값이 측정된다. 4비트로 양자화된 특징 맵을 제외하고, 제2 컴프레싱 방법(450)은 가장 낮은 정규화된 DRAM 액세스 값을 나타낸다. 제1 컴프레싱 방법(440)이 4비트로 양자화된 특징 맵에서 가장 높은 DRAM 액세스 값의 감소를 나타낸다. 8비트로 양자화된 특징 맵에서 제2 컴프레싱 방법(450)은 50%의 DRAM 액세스 값의 감소를 나타내고, ZVC, RLC4, 및 RLC8은 각각 39%, 20%, 10%의 DRAM 액세스 값의 감소를 나타낸다. 8비트 이하로 특징맵이 양자화되는 경우 컴프레싱 방법에 상관 없이 DRAM 액세스 값이 감소한다. 이는, 특징 맵의 희소성이 증가함으로써 압축률이 상승하기 때문이다. 이러한 DRAM 액세스 값의 감소는, ZVC가 고정된 크기의 마스크(mask) 데이터를 사용하기 때문에, ZVC에서 가장 작게 나타난다. 제1 컴프레싱 방법(440) 및 제2 컴프레싱 방법(450)은 양자화된 특징 맵을 효과적으로 컴프레싱 할 수 있다. 특히, 4비트로 양자화된 특징맵에서 제1 컴프레싱 방법(440) 및 제2 컴프레싱 방법(450)은 DRAM 액세스 값을 82% 및 80%로 줄일 수 있다. 또한, 제1 컴프레싱 방법(440)이 4비트로 양자화된 특징맵에서 더 작은 DRAM 액세스 값을 나타내는데, 이는 특징 맵이 충분히 희소성이 높고 제2 컴프레싱 방법(450)은 활성값을 아웃라이어, 논-아웃라이어, 제로값으로 표현하기 위하여 비트 폭이 더 큰 제2 데이터(마스크)를 사용하기 때문이다.Normalized DRAM access values of the compressed feature map are measured for quantized activation values from 4 bits to 8 bits. Except for the 4-bit quantized feature map, the second compression method 450 exhibits the lowest normalized DRAM access value. The first compression method 440 represents a decrease in the highest DRAM access value in the feature map quantized to 4 bits. In the 8-bit quantized feature map, the second compression method 450 shows a reduction in DRAM access value of 50%, and ZVC, RLC4, and RLC8 show a reduction in DRAM access value of 39%, 20%, and 10%, respectively. indicates. When the feature map is quantized to 8 bits or less, the DRAM access value decreases regardless of the compression method. This is because the compression ratio increases as the sparseness of the feature map increases. This reduction in DRAM access values is smallest in ZVC because it uses a fixed size of mask data. The first compression method 440 and the second compression method 450 may effectively compress the quantized feature map. In particular, in the feature map quantized to 4 bits, the first compression method 440 and the second compression method 450 may reduce DRAM access values to 82% and 80%. Also, the first compression method 440 shows a smaller DRAM access value in the feature map quantized to 4 bits, which means that the feature map is sufficiently sparse and the second compression method 450 converts the active value into an outlier, non -Outlier, this is because the second data (mask) with a larger bit width is used to express it as a zero value.

그래프(1011), 그래프(1012), 그래프(1013), 그래프(1014), 그래프(1015)는 ExtractionNet 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 컴프레싱된 특징 맵의 정규화된 DRAM 액세스의 값에 대한 그래프를 나타낸다.Graph 1011, graph 1012, graph 1013, graph 1014, and graph 1015 are RLC8, RLC4, ZVC, first compression method 440, second compression method ( 450) shows a graph of the values of normalized DRAM accesses of the compressed feature map.

그래프(1011), 그래프(1012), 그래프(1013), 그래프(1014), 그래프(1015)는 ResNet-18 네트워크에서 각각 RLC8, RLC4, ZVC, 제1 컴프레싱 방법(440), 제2 컴프레싱 방법(450)에 따른 컴프레싱된 특징 맵의 정규화된 DRAM 액세스의 값에 대한 그래프를 나타낸다.Graph 1011, Graph 1012, Graph 1013, Graph 1014, Graph 1015 are RLC8, RLC4, ZVC, First Compression Method 440, Second Compression, respectively, in the ResNet-18 network. A graph is shown for values of normalized DRAM accesses of a compressed feature map according to method 450 .

ExtractionNet 및 ResNet-18에서 DRAM 액세스 값은 VGG-16과 유사한 경향을 나타낸다. 8비트로 양자화된 특징 맵에서 제2 컴프레싱 방법(450)은 DRAM 액세스 값을 각각 54 % 및 57 % 감소시키며, 제1 컴프레싱 방법은 DRAM 액세스 값을 각각 48 % 및 50 % 감소시킨다. 4 비트로 양자화된 특징맵에서 제2 컴프레싱 방법(450)은 DRAM 액세스 값을 각각 76 % 및 78 % 감소시키고, 제1 컴프레싱 방법(440)은 DRAM 액세스 값을 각각 78 % 및 80 % 감소시킨다.In ExtractionNet and ResNet-18, DRAM access values show a similar trend to that of VGG-16. In the 8-bit quantized feature map, the second compression method 450 reduces DRAM access values by 54% and 57%, respectively, and the first compression method reduces DRAM access values by 48% and 50%, respectively. In the feature map quantized to 4 bits, the second compression method 450 reduces the DRAM access value by 76% and 78%, respectively, and the first compression method 440 reduces the DRAM access value by 78% and 80%, respectively .

도 11은 특징 맵을 저장 및 로드(load)하는데 소비되는 에너지에 관한 그래프를 나타낸다.11 shows a graph of energy consumed to store and load a feature map.

그래프(1111), 그래프(1121) 및 그래프(1131)은 VGG-16, ExtractionNet, ResNet-18 네트워크에서 RLC4를 사용하여 특징 맵을 컴프레싱하는 경우, 특징 맵을 저장 및 로드하는데 소비되는 에너지에 관한 그래프를 나타낸다. 그래프(1112), 그래프(1122) 및 그래프(1132)은 VGG-16, ExtractionNet, ResNet-18 네트워크에서 ZVC를 사용하여 특징 맵을 컴프레싱하는 경우, 특징 맵을 저장 및 로드하는데 소비되는 에너지에 관한 그래프를 나타낸다. 그래프(1113), 그래프(1123) 및 그래프(1133)은 VGG-16, ExtractionNet, ResNet-18 네트워크에서 일 실시예에 따른 컴프레싱 방법을 사용하여 특징 맵을 컴프레싱하는 경우, 특징 맵을 저장 및 로드하는데 소비되는 에너지에 관한 그래프를 나타낸다.Graph 1111, graph 1121, and graph 1131 relate to the energy consumed to store and load the feature map when compressing the feature map using RLC4 in VGG-16, ExtractionNet, and ResNet-18 networks. show the graph. Graph 1112, graph 1122, and graph 1132 relate to the energy consumed to store and load the feature map when compressing the feature map using ZVC in the VGG-16, ExtractionNet, and ResNet-18 networks. show the graph. The graph 1113, the graph 1123, and the graph 1133 store the feature map and Shows a graph of the energy consumed to load.

에너지 소비는 컴프레서가 없는 CNN 가속기 장치에 대하여 정규화된다. 앞서 설명한 바와 같이, DRAM 액세스는 대부분의 에너지 소비를 담당한다. 따라서 일 실시예에 따른 컴프레싱 방법은 하드웨어의 에너지 소비량이 RLC4 및 ZVC보다 높더라도, 특징 맵을 저장하고 로드 하기 위한 에너지 소비량이 RLC4 및 ZVC 보다 감소한다. 일 실시예에 따른 컴프레싱 방법은 VGG-16, ExtractionNet 및 ResNet-18 네트워크에서 DRAM 액세스를 위한 에너지 소비를 각각 0.35, 0.38 및 0.40으로 감소시킨다. 결과적으로, 일 실시예에 따른 컴프레싱 방법은 평균 37.7 %의 에너지 소비를 감소시킬 수 있다.Energy consumption is normalized to the CNN accelerator device without a compressor. As mentioned earlier, DRAM access is responsible for most of the energy consumption. Accordingly, in the compression method according to an embodiment, energy consumption for storing and loading the feature map is reduced compared to RLC4 and ZVC, even though the energy consumption of hardware is higher than that of RLC4 and ZVC. The compression method according to an embodiment reduces energy consumption for DRAM access in VGG-16, ExtractionNet and ResNet-18 networks to 0.35, 0.38 and 0.40, respectively. As a result, the compression method according to an embodiment may reduce energy consumption by an average of 37.7%.

이상에서 설명된 실시예들은 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치, 방법 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 컨트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The embodiments described above may be implemented by a hardware component, a software component, and/or a combination of a hardware component and a software component. For example, the apparatus, methods and components described in the embodiments may include, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate (FPGA) array), a programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions, may be implemented using a general purpose computer or special purpose computer. The processing device may execute an operating system (OS) and a software application running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to execution of the software. For convenience of understanding, although one processing device is sometimes described as being used, one of ordinary skill in the art will recognize that the processing device includes a plurality of processing elements and/or a plurality of types of processing elements. It can be seen that may include For example, the processing device may include a plurality of processors or one processor and one controller. Other processing configurations are also possible, such as parallel processors.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.The software may comprise a computer program, code, instructions, or a combination of one or more thereof, which configures a processing device to operate as desired or is independently or collectively processed You can command the device. The software and/or data may be any kind of machine, component, physical device, virtual equipment, computer storage medium or device, to be interpreted by or to provide instructions or data to the processing device. , or may be permanently or temporarily embody in a transmitted signal wave. The software may be distributed over networked computer systems and stored or executed in a distributed manner. Software and data may be stored in a computer-readable recording medium.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있으며 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. The method according to the embodiment may be implemented in the form of program instructions that can be executed through various computer means and recorded in a computer-readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination, and the program instructions recorded on the medium are specially designed and configured for the embodiment or may be known and available to those skilled in the art of computer software. may be Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic such as floppy disks. - includes magneto-optical media, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like.

위에서 설명한 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 또는 복수의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The hardware devices described above may be configured to operate as one or a plurality of software modules to perform the operations of the embodiments, and vice versa.

이상과 같이 실시예들이 비록 한정된 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 이를 기초로 다양한 기술적 수정 및 변형을 적용할 수 있다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.As described above, although the embodiments have been described with reference to the limited drawings, a person skilled in the art may apply various technical modifications and variations based thereon. For example, the described techniques are performed in a different order than the described method, and/or the described components of the system, structure, apparatus, circuit, etc. are combined or combined in a different form than the described method, or other components Or substituted or substituted by equivalents may achieve an appropriate result.

그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (20)

컴프레서에 의해 수행되는 특징 맵(feature map)을 컴프레싱하는 방법에 있어서,
입력 이미지로부터 컨볼루션 뉴럴 네트워크(convolution neural network, CNN) 모델에 포함된 하나 이상의 레이어에 기초하여 특징 맵(feature map)을 획득하는 단계;
상기 획득된 특징 맵을 미리 결정된 크기의 단위 타일(unit tile)로 분할(divide)하고, 상기 분할된 단위 타일들을 순차적으로 레지스터에 입력시키는 단계;
논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값(activation value)에 기초하여 제3 데이터를 생성하는 단계; 및
상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 상기 버퍼에 저장하는 단계
를 포함하는 특징 맵 컴프레싱 방법.
A method of compressing a feature map performed by a compressor, the method comprising:
obtaining a feature map from an input image based on one or more layers included in a convolutional neural network (CNN) model;
dividing the acquired feature map into unit tiles of a predetermined size, and sequentially inputting the divided unit tiles into a register;
First data indicating the number of zero tiles input to the register before the non-zero tiles are input to the register, indicating a pixel having a zero value and a pixel having a non-zero value within the non-zero tile generating third data based on the second data and an activation value of a pixel having a non-zero value in the non-zero tile; and
storing the first data, the second data, and the third data in the buffer;
A feature map compression method comprising:
제1항에 있어서,
상기 데이터를 생성하는 단계는,
상기 레지스터에 입력된 단위 타일 내에서 모든 픽셀이 제로값을 갖는 경우, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트를 증가시키는 단계
를 포함하는 특징 맵 컴프레싱 방법.
According to claim 1,
The step of generating the data includes:
When all pixels within the unit tile input to the register have zero values, the count of first data indicating the number of zero tiles input to the register is increased before the non-zero tiles are input to the register step
A feature map compression method comprising:
제1항에 있어서,
상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트가 임계값에 도달하는 경우, 임계값을 상기 제1 데이터로 생성하고, 제로값을 상기 제2 데이터로 생성하는 단계
를 더 포함하는 특징 맵 컴프레싱 방법.
According to claim 1,
When the count of first data indicating the number of zero tiles input to the register reaches a threshold before the non-zero tiles are input to the register, a threshold value is generated as the first data, and a zero value is generated. generating as the second data
A feature map compression method further comprising a.
제1항에 있어서,
상기 데이터를 생성하는 단계는,
상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값을 제1 비트 폭(bit width)의 데이터로 나타내어 상기 제3 데이터를 생성하는 단계
를 포함하는 특징 맵 컴프레싱 방법.
According to claim 1,
The step of generating the data includes:
generating the third data by representing an active value of a pixel having a non-zero value in the non-zero tile as data having a first bit width
A feature map compression method comprising:
제1항에 있어서,
상기 데이터를 생성하는 단계는,
상기 논-제로 타일 내에서 픽셀들이 갖는 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하는 단계; 및
아웃라이어로 분류된 활성값을 제1 비트 폭의 데이터로 나타내고, 논-아웃라이어로 분류된 활성값을 상기 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 상기 제3 데이터를 생성하는 단계
를 포함하는 특징 맵 컴프레싱 방법.
According to claim 1,
The step of generating the data includes:
classifying active values of pixels in the non-zero tile into one of an outlier, a non-outlier, and a zero value; and
generating the third data by representing an active value classified as an outlier as data having a first bit width, and representing an active value classified as a non-outlier as data having a second bit width smaller than the first bit width step
A feature map compression method comprising:
제5항에 있어서,
상기 분할된 단위 타일들을 레지스터에 입력시키는 단계는,
단위 타일이 포함하는 픽셀 각각의 활성값을 상위 비트 데이터 및 하위 비트 데이터로 나누어 상기 레지스터에 입력시키는 단계
를 포함하고,
상기 데이터를 생성하는 단계는,
픽셀의 활성값에 대응하는 상위 비트 데이터 및 하위 비트 데이터가 제로값인지 여부를 판단하여, 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하는 단계
를 포함하는 특징 맵 컴프레싱 방법.
6. The method of claim 5,
The step of inputting the divided unit tiles into a register comprises:
dividing the active value of each pixel included in the unit tile into high-order bit data and low-order bit data and inputting them into the register
including,
The step of generating the data includes:
classifying the active value into one of an outlier, a non-outlier, and a zero value by determining whether the upper bit data and the lower bit data corresponding to the active value of the pixel are zero values
A feature map compression method comprising:
제6항에 있어서,
상기 활성값을 분류하는 단계는,
상위 비트 데이터 및 하위 비트 데이터가 모두 논-제로 값인 경우, 활성값을 아웃라이어로 분류하는 단계;
상위 비트 데이터가 제로값이고, 하위 비트 데이터가 논-제로 값인 경우 활성값을 논-아웃라이어로 분류하는 단계; 및
상위 비트 데이터 및 하위 비트 데이터가 모두 제로값인 경우, 활성값을 제로값으로 분류하는 단계
를 포함하는 특징 맵 컴프레싱 방법.
7. The method of claim 6,
The step of classifying the active value is,
classifying the active value as an outlier when both the upper bit data and the lower bit data are non-zero values;
classifying the active value as a non-outlier when the upper bit data is a zero value and the lower bit data is a non-zero value; and
Classifying the active value as a zero value when both the upper bit data and the lower bit data are zero values
A feature map compression method comprising:
제5항에 있어서,
상기 데이터를 생성하는 단계는,
상기 논-제로 타일 내에서 제로값을 갖는 픽셀에 제1 값을 매핑하고, 논-아웃라이어를 갖는 픽셀에 제2 값을 매핑하며, 아웃라이어를 갖는 픽셀에 제3 값을 매핑하여 상기 제2 데이터를 생성하는 단계
를 포함하고,
상기 제1 값, 상기 제2 값, 및 상기 제3 값은 서로 상이한 데이터인,
특징 맵 컴프레싱 방법.
6. The method of claim 5,
The step of generating the data includes:
In the non-zero tile, a first value is mapped to a pixel having a zero value, a second value is mapped to a pixel having a non-outlier, and a third value is mapped to a pixel having an outlier so that the second value is mapped to the second value. Steps to generate data
including,
wherein the first value, the second value, and the third value are different data from each other,
Feature map compression method.
제1항 내지 제8항 중 어느 한 항의 방법을 수행하기 위한 명령어를 포함하는 하나 이상의 컴퓨터 프로그램을 저장한 컴퓨터 판독 가능 저장 매체.
A computer-readable storage medium storing one or more computer programs comprising instructions for performing the method of any one of claims 1 to 8.
특징 맵을 컴프레싱하는 컴프레서에 있어서,
입력 이미지로부터 컨볼루션 뉴럴 네트워크 모델에 포함된 하나 이상의 레이어에 기초하여 획득된 특징 맵(feature map)에 대하여, 상기 특징 맵이 미리 결정된 크기의 단위 타일들로 분할되고, 상기 분할된 단위 타일들이 순차적으로 입력되는 레지스터;
레지스터에 저장된 데이터들을 비교하는 비교기;
상기 비교의 결과에 기초하여 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값에 기초하여 제3 데이터를 생성하는 제어기; 및
상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 저장하고, 저장된 데이터를 동적 랜덤 액세스 메모리(DRAM)으로 출력하는 버퍼
를 포함하는 컴프레서.
A compressor for compressing a feature map, comprising:
With respect to a feature map obtained from an input image based on one or more layers included in the convolutional neural network model, the feature map is divided into unit tiles of a predetermined size, and the divided unit tiles are sequentially register input to;
a comparator for comparing data stored in the register;
First data indicating the number of zero tiles input to the register before a non-zero tile is input to the register based on the result of the comparison, a pixel having a zero value in the non-zero tile and a non-zero tile a controller for generating third data based on second data indicating a pixel having a value, and an active value of a pixel having a non-zero value within the non-zero tile; and
A buffer for storing the first data, the second data, and the third data, and outputting the stored data to a dynamic random access memory (DRAM)
Compressor containing
제10항에 있어서,
상기 제어기는,
상기 레지스터에 입력된 단위 타일의 모든 픽셀이 제로값을 갖는 경우, 상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트를 증가시키는,
컴프레서.
11. The method of claim 10,
The controller is
When all pixels of the unit tile input to the register have a zero value, increasing the count of first data indicating the number of zero tiles input to the register before the non-zero tile is input to the register;
Compressor.
제10항에 있어서,
상기 제어기는,
상기 논-제로 타일이 상기 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터의 카운트가 임계값에 도달하는 경우, 임계값을 상기 제1 데이터로 생성하고, 제로값을 상기 제2 데이터로 생성하는
컴프레서.
11. The method of claim 10,
The controller is
When the count of first data indicating the number of zero tiles input to the register reaches a threshold before the non-zero tiles are input to the register, a threshold value is generated as the first data, and a zero value is generated. to generate as the second data
Compressor.
제10항에 있어서,
상기 제어기는,
상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값을 제1 비트 폭(bit width)의 데이터로 나타내어 상기 제3 데이터를 생성하는
컴프레서.
11. The method of claim 10,
The controller is
generating the third data by representing an active value of a pixel having a non-zero value in the non-zero tile as data having a first bit width
Compressor.
제10항에 있어서,
상기 제어기는,
상기 논-제로 타일 내에서 픽셀들이 갖는 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하고,
아웃라이어로 분류된 활성값을 제1 비트 폭의 데이터로 나타내며, 논-아웃라이어로 분류된 활성값을 상기 제1 비트 폭 보다 작은 제2 비트 폭의 데이터로 나타냄으로써 상기 제3 데이터를 생성하는
컴프레서.
11. The method of claim 10,
The controller is
classifying an active value of pixels in the non-zero tile into one of an outlier, a non-outlier, and a zero value;
generating the third data by representing an active value classified as an outlier as data having a first bit width, and representing an active value classified as a non-outlier as data having a second bit width smaller than the first bit width
Compressor.
제14항에 있어서,
상기 레지스터는,
단위 타일이 포함하는 픽셀 각각의 활성값이 상위 비트 데이터 및 하위 비트 데이터로 나누어진 입력을 수신하고,
상기 비교기는,
픽셀의 활성값에 대응하는 상위 비트 데이터 및 하위 비트 데이터가 제로 값인지 여부를 판단하고,
상기 제어기는,
상기 판단 결과에 기초하여 활성값을 아웃라이어, 논-아웃라이어, 및 제로값 중 하나로 분류하는,
컴프레서.
15. The method of claim 14,
The register is
receiving an input in which an active value of each pixel included in a unit tile is divided into high-order bit data and low-order bit data;
The comparator is
Determining whether high-order bit data and low-order bit data corresponding to the active value of the pixel are zero values;
The controller is
classifying an active value into one of an outlier, a non-outlier, and a zero value based on the determination result;
Compressor.
제15항에 있어서,
상기 제어기는,
상기 비교 결과에 기초하여, 상위 비트 데이터 및 하위 비트 데이터가 모두 논-제로 값인 경우, 활성값을 아웃라이어로 분류하고, 상위 비트 데이터가 제로값이고, 하위 비트 데이터가 논-제로 값인 경우 활성값을 논-아웃라이어로 분류하며, 상위 비트 데이터 및 하위 비트 데이터가 모두 제로값인 경우, 활성값을 제로값으로 분류하는
컴프레서.
16. The method of claim 15,
The controller is
Based on the comparison result, when both high-order bit data and low-order bit data are non-zero values, an active value is classified as an outlier, and when the high-order bit data is a zero value, and the low-order bit data is a non-zero value, an active value is classified as non-outlier, and when both high-order bit data and low-order bit data are zero values, the active value is classified as a zero value.
Compressor.
제14항에 있어서,
상기 제어기는,
상기 논-제로 타일 내에서 제로값을 갖는 픽셀에 제1 값을 매핑하고, 논-아웃라이어를 갖는 픽셀에 제2 값을 매핑하며, 아웃라이어를 갖는 픽셀에 제3 값을 매핑하여 상기 제2 데이터를 생성하고,
상기 제1 값, 상기 제2 값, 및 상기 제3 값을 서로 상이한 데이터인,
컴프레서.
15. The method of claim 14,
The controller is
In the non-zero tile, a first value is mapped to a pixel having a zero value, a second value is mapped to a pixel having a non-outlier, and a third value is mapped to a pixel having an outlier so that the second value is mapped to the second value. create data,
The first value, the second value, and the third value are different data from each other,
Compressor.
뉴럴 네트워크 가속기 장치에 있어서,
컨볼루션 뉴럴 네트워크 연산을 수행하는 프로세싱 엘리먼트 어레이(PE array)를 이용하여 컨볼루션 뉴런 네트워크 모델에 포함된 하나 이상의 레이어에 기초하여 입력 이미지로부터 추출된 특징 맵을 획득하는 버퍼;
상기 획득된 특징 맵을 미리 결정된 크기의 단위 타일들로 분할하고, 상기 분할된 단위 타일들을 순차적으로 컴프레서에 입력시키는 제어기(controller); 및
논-제로 타일이 레지스터에 입력되기 전까지 상기 레지스터에 입력된 제로 타일의 개수를 지시하는 제1 데이터, 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 지시하는 제2 데이터, 및 상기 논-제로 타일 내에서 논-제로 값을 갖는 픽셀의 활성값에 기초하여 제3 데이터를 생성하고, 상기 제1 데이터, 상기 제2 데이터, 및 상기 제3 데이터를 저장하며, 저장된 데이터를 동적 랜덤 액세스 메모리(DRAM)으로 출력하는 컴프레서(compressor)
를 포함하는 뉴럴 네트워크 가속기 장치.
In the neural network accelerator device,
a buffer for obtaining a feature map extracted from an input image based on one or more layers included in the convolutional neural network model using a processing element array (PE array) that performs a convolutional neural network operation;
a controller dividing the acquired feature map into unit tiles of a predetermined size and sequentially inputting the divided unit tiles into a compressor; and
First data indicating the number of zero tiles input to the register before the non-zero tiles are input to the register, the first data indicating a pixel having a zero value and a pixel having a non-zero value within the non-zero tile generate third data based on two data and an active value of a pixel having a non-zero value in the non-zero tile, and store the first data, the second data, and the third data; Compressor that outputs stored data to dynamic random access memory (DRAM)
A neural network accelerator device comprising a.
디컴프레서에 의해 수행되는 특징 맵을 디컴프레싱하는 방법에 있어서,
컨볼루션 네트워크 모델의 레이어에 기초하여 획득된 특징 맵이 컴프레싱된 데이터를 레지스터에 입력시키는 단계; 및
제1 데이터에 대응하는 개수의 제로 타일을 생성하여 버퍼로 전송하고, 제2 데이터 및 제3 데이터에 기초하여 논-제로 타일을 생성하여 버퍼로 전송하는 단계
를 포함하고,
상기 논-제로 타일을 생성하여 버퍼로 전송하는 단계는,
상기 제2 데이터를 이용하여 상기 논-제로 타일 내에서 제로 값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 구분하고, 상기 제로값을 갖는 픽셀의 활성값은 제로값과 대응시키고, 논-제로 값을 갖는 픽셀의 활성값은 상기 제3 데이터와 순차적으로 대응시켜 상기 논-제로 타일을 생성하는 단계
를 포함하는 특징 맵 디컴프레싱 방법.
A method of decompressing a feature map performed by a decompressor, comprising:
inputting the compressed data of the feature map obtained based on the layer of the convolutional network model into a register; and
generating and transmitting the number of zero tiles corresponding to the first data to the buffer, and generating and transmitting non-zero tiles based on the second data and the third data to the buffer;
including,
The step of generating the non-zero tile and transmitting it to the buffer comprises:
A pixel having a zero value and a pixel having a non-zero value are distinguished from a pixel having a non-zero value in the non-zero tile by using the second data, and an active value of the pixel having a zero value corresponds to the zero value, and a non-zero value is used. generating the non-zero tile by sequentially matching an active value of a pixel having a value with the third data;
A feature map decompressing method comprising a.
특징 맵을 디컴프레싱하는 디컴프레서에 있어서,
컨볼루션 네트워크 모델의 레이어에 기초하여 획득된 특징 맵이 압축된 데이터가 입력되는 레지스터;
제1 데이터에 대응하는 개수의 제로 타일을 생성하여 버퍼로 전송하고, 제2 데이터 및 제3 데이터에 기초하여 논-제로 타일을 생성하여 버퍼로 전송하는 제어기
를 포함하고,
상기 제어기는,
상기 제2 데이터를 이용하여 상기 논-제로 타일 내에서 제로값을 갖는 픽셀과 논-제로 값을 갖는 픽셀을 구분하고, 상기 제로값을 갖는 픽셀의 활성값은 제로값과 대응시키고, 논-제로 값을 갖는 픽셀의 활성값은 상기 제3 데이터와 순차적으로 대응시켜 상기 논-제로 타일을 생성하는
디컴프레서.
A decompressor for decompressing a feature map, comprising:
a register to which compressed data of a feature map obtained based on a layer of a convolutional network model is input;
A controller that generates and transmits the number of zero tiles corresponding to the first data to the buffer, and generates non-zero tiles based on the second data and the third data and transmits them to the buffer
including,
The controller is
A pixel having a zero value and a pixel having a non-zero value are distinguished from a pixel having a non-zero value in the non-zero tile by using the second data, and an active value of the pixel having a zero value corresponds to the zero value, and a non-zero value is used. The active value of the pixel having a value is sequentially matched with the third data to generate the non-zero tile.
decompressor.
KR1020210056723A 2021-04-30 2021-04-30 Apparatus and method for compressing feature map KR102502162B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210056723A KR102502162B1 (en) 2021-04-30 2021-04-30 Apparatus and method for compressing feature map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210056723A KR102502162B1 (en) 2021-04-30 2021-04-30 Apparatus and method for compressing feature map

Publications (2)

Publication Number Publication Date
KR20220149281A true KR20220149281A (en) 2022-11-08
KR102502162B1 KR102502162B1 (en) 2023-02-21

Family

ID=84041394

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210056723A KR102502162B1 (en) 2021-04-30 2021-04-30 Apparatus and method for compressing feature map

Country Status (1)

Country Link
KR (1) KR102502162B1 (en)

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Jorge Albericio, et al., "Cnvlutin: ineffectual-neuron-free deep neural network computing", ACM SIGARCH Computer Architecture NewsVolume 44 Issue 3, (2016.06.18.) *
Lin, et al., "Supporting Compressed-Sparse Activations and Weights on SIMD-like Accelerator for Sparse Convolutional Neural Networks", 2018 23rd Asia and South Pacific Design Automation Conference *
Li-Na Wang, et al., "Compressing Deep Networks by Neuron Agglomerative Clustering", Smart Sensing and Advanced Machine Learning Based Emerging Intelligent Systems, (2020.10.23.) *
Rutishauser, et al., "An On-the-Fly Feature Map Compression Engine for Background Memory Access Cost Reduction in DNN Inference", (2020.01.09.) *

Also Published As

Publication number Publication date
KR102502162B1 (en) 2023-02-21

Similar Documents

Publication Publication Date Title
US10096134B2 (en) Data compaction and memory bandwidth reduction for sparse neural networks
US10938413B2 (en) Processing core data compression and storage system
CN109002889B (en) Adaptive iterative convolution neural network model compression method
KR102562320B1 (en) Method and apparatus for processing neural network based on bitwise operation
WO2014055511A1 (en) Data compression profiler for configuration of compression
EP4008057B1 (en) Lossless exponent and lossy mantissa weight compression for training deep neural networks
WO2023236365A1 (en) Data processing method and apparatus, and ai chip, electronic device and storage medium
KR102233174B1 (en) Neural network accelerator and operating method thereof
CN111240746B (en) Floating point data inverse quantization and quantization method and equipment
Cavigelli et al. Extended bit-plane compression for convolutional neural network accelerators
WO2022168604A1 (en) Softmax function approximation calculation device, approximation calculation method, and approximation calculation program
KR102502162B1 (en) Apparatus and method for compressing feature map
JP7026808B2 (en) Information processing equipment, methods and programs
Park et al. GRLC: Grid-based run-length compression for energy-efficient CNN accelerator
TW202044129A (en) Computing system and compressing method thereof for neural network parameters
TWI708196B (en) Method and processor for decompression of model parameters using functions based upon cumulative count distributions
US10938412B2 (en) Decompression of model parameters using functions based upon cumulative count distributions
CN113537447A (en) Method and device for generating multilayer neural network, application method and storage medium
KR20210116182A (en) Softmax approximation method and apparatus
CN112085154A (en) Asymmetric quantization for compression and inference acceleration of neural networks
Bae et al. Dc-ac: Deep correlation-based adaptive compression of feature map planes in convolutional neural networks
JP2020166690A (en) Storage system, and data recording method
KR102420763B1 (en) Neural network system and processing method of filter data of neural network
US11742875B1 (en) Compression of floating-point numbers for neural networks
TWI729939B (en) Method and processor for decompression of model parameters using functions based upon cumulative count distributions

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant