KR102487535B1 - Method and apparatus for operating deep learning by using the systolic array - Google Patents

Method and apparatus for operating deep learning by using the systolic array Download PDF

Info

Publication number
KR102487535B1
KR102487535B1 KR1020180020015A KR20180020015A KR102487535B1 KR 102487535 B1 KR102487535 B1 KR 102487535B1 KR 1020180020015 A KR1020180020015 A KR 1020180020015A KR 20180020015 A KR20180020015 A KR 20180020015A KR 102487535 B1 KR102487535 B1 KR 102487535B1
Authority
KR
South Korea
Prior art keywords
data
input
feature map
value
operator
Prior art date
Application number
KR1020180020015A
Other languages
Korean (ko)
Other versions
KR20190099931A (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 KR1020180020015A priority Critical patent/KR102487535B1/en
Priority to PCT/KR2019/002029 priority patent/WO2019164237A1/en
Publication of KR20190099931A publication Critical patent/KR20190099931A/en
Application granted granted Critical
Publication of KR102487535B1 publication Critical patent/KR102487535B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

시스톨릭 배열을 통해 입력 데이터에 관하여 컨볼루션 연산을 수행하여 출력 데이터를 학습하는 인공 지능(Artificial Intelligence, AI) 학습 방법 및 장치를 제공한다. 본 개시의 일 실시예에 따르면, 시스톨릭 배열 연산기에 입력되는 데이터의 순서(sequence)를 변경하는 매핑(mapping)을 통해 컨볼루션 연산을 수행하는데 소모되는 전력량을 감소시키고, 연산 속도를 증가시키는 방법 및 장치를 제공한다. Provided is an artificial intelligence (AI) learning method and apparatus for learning output data by performing a convolution operation on input data through a systolic array. According to an embodiment of the present disclosure, a method for reducing the amount of power consumed in performing a convolution operation and increasing the operation speed through mapping to change the sequence of data input to a systolic array operator and devices.

Description

시스톨릭 배열(Systolic Array)을 이용하여 딥 러닝(Deep Learning) 연산을 수행하는 방법 및 장치 {METHOD AND APPARATUS FOR OPERATING DEEP LEARNING BY USING THE SYSTOLIC ARRAY}Method and apparatus for performing deep learning operation using systolic array {METHOD AND APPARATUS FOR OPERATING DEEP LEARNING BY USING THE SYSTOLIC ARRAY}

본 개시는 컨볼루션 뉴럴 네트워크(Convolution Neural Network, CNN)를 기반으로 한 딥 러닝 연산에 있어서, 시스톨릭 배열(Systolic Array)을 이용하여 입력 특징 맵과 필터의 컨볼루션 연산을 수행하는 방법 및 장치에 관한 것이다. The present disclosure provides a method and apparatus for performing a convolution operation between an input feature map and a filter using a systolic array in a deep learning operation based on a convolutional neural network (CNN). it's about

인공 지능(Artificial Intelligence, AI) 시스템은 인간 수준의 지능을 구현하는 컴퓨터 시스템이며, 기존 Rule 기반 스마트 시스템과 달리 기계가 스스로 학습하고 판단하며 똑똑해지는 시스템이다. 인공지능 시스템은 사용할수록 인식률이 향상되고 사용자 취향을 보다 정확하게 이해할 수 있게 되어, 기존 Rule 기반 스마트 시스템은 점차 딥 러닝 기반 인공지능 시스템으로 대체되고 있다.An artificial intelligence (AI) system is a computer system that implements human-level intelligence, and unlike existing rule-based smart systems, machines learn, judge, and become smarter on their own. The more AI systems are used, the higher the recognition rate and the more accurate understanding of user preferences. Existing rule-based smart systems are gradually being replaced by deep learning-based AI systems.

인공지능 기술은 기계학습(딥 러닝) 및 기계학습을 활용한 요소 기술들로 구성된다.Artificial intelligence technology consists of machine learning (deep learning) and element technologies using machine learning.

기계학습은 입력 데이터들의 특징을 스스로 분류/학습하는 알고리즘 기술이며, 요소기술은 딥 러닝 등의 기계학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 기술로서, 언어적 이해, 시각적 이해, 추론/예측, 지식 표현, 동작 제어 등의 기술 분야로 구성된다.Machine learning is an algorithm technology that classifies/learns the characteristics of input data by itself, and element technology is a technology that uses machine learning algorithms such as deep learning to mimic the functions of the human brain, such as cognition and judgment. It consists of technical fields such as understanding, inference/prediction, knowledge expression, and motion control.

인공지능 기술이 응용되는 다양한 분야는 다음과 같다. 언어적 이해는 인간의 언어/문자를 인식하고 응용/처리하는 기술로서, 자연어 처리, 기계 번역, 대화시스템, 질의 응답, 음성 인식/합성 등을 포함한다. 시각적 이해는 사물을 인간의 시각처럼 인식하여 처리하는 기술로서, 객체 인식, 객체 추적, 영상 검색, 사람 인식, 장면 이해, 공간 이해, 영상 개선 등을 포함한다. 추론 예측은 정보를 판단하여 논리적으로 추론하고 예측하는 기술로서, 지식/확률 기반 추론, 최적화 예측, 선호 기반 계획, 추천 등을 포함한다. 지식 표현은 인간의 경험정보를 지식데이터로 자동화 처리하는 기술로서, 지식 구축(데이터 생성/분류), 지식 관리(데이터 활용) 등을 포함한다. 동작 제어는 차량의 자율 주행, 로봇의 움직임을 제어하는 기술로서, 움직임 제어(항법, 충돌, 주행), 조작 제어(행동 제어) 등을 포함한다.The various fields where artificial intelligence technology is applied are as follows. Linguistic understanding is a technology for recognizing and applying/processing human language/characters, including natural language processing, machine translation, dialogue systems, question and answering, voice recognition/synthesis, and the like. Visual understanding is a technology for recognizing and processing objects like human vision, and includes object recognition, object tracking, image search, person recognition, scene understanding, space understanding, image improvement, and the like. Inference prediction is a technique of reasoning and predicting logically by judging information, and includes knowledge/probability-based reasoning, optimization prediction, preference-based planning, and recommendation. Knowledge expression is a technology that automatically processes human experience information into knowledge data, and includes knowledge construction (data creation/classification) and knowledge management (data utilization). Motion control is a technology for controlling the autonomous driving of a vehicle and the movement of a robot, and includes motion control (navigation, collision, driving), manipulation control (action control), and the like.

딥 러닝 연산을 수행할 때, 계산량이 많은 컨볼루션의 경우, 기가 단위(Giga)의 연산 또는 그에 상응하는 능력을 요구하며, 특히 32bit 또는 16 bit 입력 데이터와 필터의 웨이트(weight) 버스를 사용하는 경우, 추론만 하더라도 프로세서(processor) 내부에서 토글(toggle)되는 데이터의 양이 많다. 토글되는 데이터의 양이 많을수록 프로세서에서 소모되는 전력량이 증가하게 되는바, 최근의 모바일(mobile) 디바이스 환경에서 배터리의 용량 한계로 인한 문제점이 있다.When performing deep learning operations, in the case of convolution with a large amount of calculation, giga units of operation or equivalent capabilities are required, especially when using 32-bit or 16-bit input data and filter weight buses. In this case, there is a large amount of data that is toggled inside the processor even if only inference is made. As the amount of data to be toggled increases, the amount of power consumed by the processor increases. In a recent mobile device environment, there is a problem due to a battery capacity limit.

본 개시는 시스톨릭 배열을 통해 입력 데이터에 관하여 컨볼루션 연산을 수행하여 출력 데이터를 학습하는 딥 러닝 연산에 관한 것으로서, 시스톨릭 배열 연산기에 입력되는 데이터의 순서를 변경하는 매핑(mapping)을 통해 연산을 수행하는데 소모되는 전력량을 감소시키고, 연산 속도를 증가시키는 방법 및 장치를 제공하는 것을 목적으로 한다. The present disclosure relates to a deep learning operation that learns output data by performing a convolution operation on input data through a systolic array, and operates through mapping to change the order of data input to a systolic array operator. It is an object of the present invention to provide a method and apparatus for reducing the amount of power consumed in performing and increasing an operation speed.

상술한 기술적 과제를 해결하기 위하여, 본 개시의 일 실시예는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계, 매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계를 포함하는, 시스톨릭 배열(systolic array)을 이용하여 딥 러닝(deep learning) 연산을 수행하는 방법을 제공한다. In order to solve the above-described technical problem, an embodiment of the present disclosure is an input feature map such that data having the same value is repeated a predetermined number of times according to a sequential clock and input to a multiplication addition operator in a systolic array operator changing the order of the data of , mapping the data of the input feature map into a systolic array, inputting the mapped data of the input feature map and the weight value of the filter into the systolic array calculator to perform convolution operation Deep learning using a systolic array, including performing convolution and generating an output feature map by accumulating the convolution-operated output values (deep learning) Provides a way to perform operations.

예를 들어, 상기 매핑 단계는 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경할 수 있다. For example, in the mapping step, the input order of the input data may be changed so that the same two input data values of the input feature map are repeatedly input to the systolic array calculator.

예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매핑 단계는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. For example, the filter has a size of N by N (NXN), and the mapping step is such that the data of the input feature map is repeatedly input to the systolic array operator the same number of times as the size (N) of the filter. The input order of the data of the input feature map can be changed.

예를 들어, 상기 출력 특징 맵을 생성하는 단계는 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하는 단계, 및 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵과 상기 필터의 조합으로 인한 출력 특징 맵을 생성하는 단계를 포함할 수 있다. For example, the generating of the output feature map may include performing the convolution operation in consideration of a stride value of the filter and data of the input feature map overlapping in a first direction and a second direction due to the stride. The method may include selecting output values, and generating an output feature map resulting from a combination of the input feature map and the filter by cumulatively summing the selected output values.

예를 들어, 상기 방법은 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는 단계를 더 포함할 수 있다.For example, the method may further include identifying data having a value of 0 among data of the input feature map.

예를 들어, 상기 매핑 단계는 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다.For example, in the mapping step, data having a value of 0 may be grouped so that the data having a value of 0 is repeatedly input to the systolic operator.

예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매핑 단계는 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑할 수 있다. For example, the filter has a size of N by N (NXN), and in the mapping step, the 0 value is repeatedly input to the systolic array operator the same number of times as the size (N) of the filter. Data having values may be collected and grouped by the size (N) of the filter.

예를 들어, 상기 방법은 상기 0값을 갖는 데이터의 데이터의 상기 입력 특징 맵(input feature map) 상의 로(row) 및 컬럼(column) 위치를 메모리에 저장하는 단계를 더 포함하고, 상기 컨볼루션 연산을 수행하는 단계는 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)할 수 있다. For example, the method further comprises storing in a memory row and column positions of data having a value of 0 on the input feature map, and the convolution The performing of the operation may include reading the stored location information from the memory and skipping multiplication and addition operations for data having a value of 0 by referring to the read location information.

예를 들어, 상기 방법은 0값으로 식별된 데이터가 입력되는 경우, 식별된 0값 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 단계를 더 포함하고, 상기 출력 특징 맵을 생성하는 단계는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산할 수 있다. For example, the method may further include, when data identified as 0 is input, acquiring location information on the systolic array of the identified 0-value data, and generating the output feature map Output values for each region of the input feature map may be cumulatively summed based on the obtained location information of the 0-value data.

상술한 기술적 과제를 해결하기 위하여 본 개시의 일 실시예는 시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트 값의 컨볼루션 연산을 수행하는 프로세서를 포함하고, 상기 프로세서는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑하는 매퍼(mapper), 매핑된 상기 입력 특징 맵 데이터 또는 상기 필터의 웨이트 값에 대하여 컨볼루션 연산을 수행하는 복수의 곱셈 덧셈 연산기를 포함하는 시스톨릭 배열 연산기, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 누산기(adder)를 포함하는, 딥 러닝 연산을 수행하는 전자 장치(electronic device)를 제공한다. In order to solve the above technical problem, an embodiment of the present disclosure includes a processor that performs a convolution operation between data of an input feature map and a weight value of a filter using a systolic array, and the processor performs a sequential clock ( A mapper that maps the data of the input feature map into a systolic array by changing the order of the data of the input feature map so that data having the same value is repeated a predetermined number of times and input to the multiplication and addition operator according to the clock) , A systolic array operator including a plurality of multiplication and addition operators performing a convolution operation on the mapped input feature map data or the weight value of the filter, and accumulating and summing the output values obtained by the convolution operation and outputting the result. An electronic device for performing deep learning operations, including an adder for generating an output feature map, is provided.

예를 들어, 상기 매퍼는 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경할 수 있다. For example, the mapper may change the input order of the input data such that the same two input data values of the input feature map are repeatedly input to the systolic array operator.

예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매퍼는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기 내의 상기 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. For example, the filter has a size of N by N (NXN), and the mapper repeats the data of the input feature map the same number of times as the size (N) of the filter. The multiply-add operator in the systolic array operator It is possible to change the input order of data of the input feature map so that it is input to .

예를 들어, 상기 누산기는 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하고, 상기 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵의 각 영역에 대한 출력 특징 맵을 생성할 수 있다. For example, the accumulator selects the output values subjected to the convolution operation in consideration of a stride value of the filter and data of the input feature map overlapping in a first direction and a second direction due to the stride, and An output feature map for each region of the input feature map may be generated by cumulatively summing the selected output values.

예를 들어, 상기 매퍼는 상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. For example, the mapper may identify data having a value of 0 among data of the input feature map.

예를 들어, 상기 매퍼는 상기 식별된 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다. For example, the mapper may group data having a value of 0 so that the identified data having a value of 0 is repeatedly input to the systolic operator.

예를 들어, 상기 필터는 N by N (NXN) 크기를 갖고, 상기 매퍼는 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑할 수 있다. For example, the filter has a size of N by N (NXN), and the mapper sets the 0 value to the systolic array operator so that data is repeatedly input to the systolic array operator the same number of times as the size (N) of the filter. It is possible to collect and group data having as much as the size (N) of the filter.

예를 들어, 상기 전자 장치는 상기 0값을 갖는 데이터의 로(row) 및 컬럼(column) 위치를 저장하는 메모리를 더 포함하고, 상기 프로세서는 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)할 수 있다. For example, the electronic device further includes a memory for storing row and column positions of the data having a value of 0, and the processor reads the stored position information from the memory and , multiplication and addition operations may be skipped for data having a value of 0 with reference to the read location information.

예를 들어, 상기 전자 장치는 상기 매퍼에 의해 시스톨릭 배열로 매핑된 상기 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 언매퍼(unmapper)를 더 포함하고, 상기 언매퍼는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하도록 상기 누산기를 제어하는 애더 트리 제어 회로(adder-tree control circuit)를 포함할 수 있다. For example, the electronic device further includes an unmapper that obtains location information on the systolic array of data identified as a value of 0 among data of the input feature map mapped to the systolic array by the mapper. wherein the unmapper comprises an adder-tree control circuit for controlling the accumulator to cumulatively add output values for each region of the input feature map based on the acquired location information of the 0-value data. can include

상술한 기술적 과제를 해결하기 위하여, 본 개시의 일 실시예는 컴퓨터로 읽을 수 있는 기록 매체를 제공하고, 상기 기록 매체는 순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계, 매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계, 및 상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계에 관한 명령어(instruction)들을 포함할 수 있다. In order to solve the above technical problem, an embodiment of the present disclosure provides a computer-readable recording medium, wherein the recording medium repeats data having the same value a predetermined number of times according to a sequential clock. mapping the data of the input feature map into a systolic array by changing the order of the data of the input feature map so that the input feature map data is input to the multiplication and addition operator in the systolic array calculator, and the mapped data and filters of the input feature map In the step of performing a convolution operation by inputting the weight value of to the systolic array operator, and in the step of generating an output feature map by accumulating the output values obtained by the convolution operation It may contain related instructions.

본 개시는, 다음의 자세한 설명과 그에 수반되는 도면들의 결합으로 쉽게 이해될 수 있으며, 참조 번호(reference numerals)들은 구조적 구성요소(structural elements)를 의미한다.
도 1a는 인공 뉴럴 네트워크(Artificial Neural Network)를 이용한 딥 러닝 연산 방법을 도식화한 도면이고, 도 1b는 딥 러닝 연산에서 입력으로 제공되는 입력 특징 맵의 데이터와 필터를 도식화한 도면이다.
도 1c는 컨볼루션 연산을 수행하는 과정을 도식화한 도면이다.
도 2는 종래의 시스톨릭 배열(Systolic Array)을 이용하여 컨볼루션 연산을 수행하는 방법을 설명하기 위한 개념도이다.
도 3a는 본 개시의 일 실시예에 따른 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이고, 도 3b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다.
도 3c는 본 개시의 일 실시예에 따른 시스톨릭 배열 연산기를 이용하여 컨볼루션 연산을 수행하고, 연산된 결과 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성하는 방법을 도식화한 도면이다.
도 4는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법을 나타내는 흐름도이다.
도 5a는 본 개시의 일 실시예에 따른 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이고, 도 5b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터와 필터의 웨이트를 연산하는 방법을 도식화한 도면이다.
도 6은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 장치의 구성 요소를 도시한 블록도이다.
도 7a 및 도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면들이다.
도 8은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 장치의 구성 요소를 도시한 블록도이다.
도 9a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼(buffer)에 저장된 데이터를 도식화한 도면이고, 도 9b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.
도 10a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼에 저장된 데이터를 도식화한 도면이고, 도 10b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.
도 11a는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 연산 회로를 도식화한 도면이고, 도 11b는 입력 특징 맵과 필터의 컨볼루션 연산에 따라 생성된 출력 특징 맵을 도식화한 도면이다.
This disclosure may be readily understood in combination with the detailed description that follows and the accompanying drawings, wherein reference numerals denote structural elements.
1A is a diagram illustrating a deep learning operation method using an artificial neural network, and FIG. 1B is a diagram illustrating data and a filter of an input feature map provided as an input in a deep learning operation.
1C is a diagram schematically illustrating a process of performing a convolution operation.
2 is a conceptual diagram for explaining a method of performing a convolution operation using a conventional systolic array.
3A is a diagram illustrating a method of performing a deep learning-based convolution operation according to an embodiment of the present disclosure, and FIG. 3B is a diagram illustrating an input order of data of an input feature map according to an embodiment of the present disclosure. It is a schematic diagram of a method of mapping to a systolic array.
3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values according to an embodiment of the present disclosure.
4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure.
5A is a diagram illustrating a method of performing a deep learning-based convolution operation according to an embodiment of the present disclosure, and FIG. 5B is a diagram illustrating data of an input feature map and weights of a filter according to an embodiment of the present disclosure. This is a schematic diagram of how to do it.
6 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic array according to an embodiment of the present disclosure.
7A and 7B are diagrams illustrating a method of changing the input order of input feature map data and mapping them into a systolic arrangement according to an embodiment of the present disclosure.
8 is a block diagram illustrating components of an apparatus for performing a convolution operation using a systolic array according to an embodiment of the present disclosure.
9A is a diagram illustrating data stored in a buffer of a memory, which is a component of a device according to an embodiment of the present disclosure, and FIG. 9B is a diagram illustrating convolution using a systolic array according to an embodiment of the present disclosure. It is a flow diagram showing how to perform the operation.
10A is a diagram illustrating data stored in a buffer of a memory, which is a component of a device according to an embodiment of the present disclosure, and FIG. 10B performs a convolution operation using a systolic array according to an embodiment of the present disclosure. Here is a flow chart showing how to do it.
FIG. 11A is a diagram illustrating an arithmetic circuit that performs a convolution operation using a systolic array according to an embodiment of the present disclosure, and FIG. 11B is an output feature map generated according to a convolution operation between an input feature map and a filter. It is a schematic drawing of

본 명세서의 실시예들에서 사용되는 용어는 본 개시의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 실시예의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.The terms used in the embodiments of this specification have been selected from general terms that are currently widely used as much as possible while considering the functions of the present disclosure, but they may vary depending on the intention or precedent of a person skilled in the art, the emergence of new technologies, and the like. . In addition, in a specific case, there is also a term arbitrarily selected by the applicant, and in this case, the meaning will be described in detail in the description of the corresponding embodiment. Therefore, terms used in the present disclosure should be defined based on the meaning of the term and the general content of the present disclosure, not simply the name of the term.

명세서 전체에서 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다. 또한, 명세서에 기재된 "...부", "...모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다.When it is said that a certain part "includes" a certain component throughout the specification, it means that it may further include other components without excluding other components unless otherwise stated. In addition, terms such as "...unit" and "...module" described in the specification mean a unit that processes at least one function or operation, which is implemented as hardware or software or a combination of hardware and software. It can be.

아래에서는 첨부한 도면을 참고하여 본 개시의 실시예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 개시는 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다.Hereinafter, with reference to the accompanying drawings, embodiments of the present disclosure will be described in detail so that those skilled in the art can easily carry out the present disclosure. However, the present disclosure may be implemented in many different forms and is not limited to the embodiments described herein.

이하에서는 도면을 참조하여 본 개시의 실시예들을 상세하게 설명한다. Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings.

도 1a는 인공 뉴럴 네트워크(Artificial Neural Network)를 이용한 딥 러닝 연산 방법을 도식화한 도면이고, 도 1b는 딥 러닝 연산에서 입력으로 제공되는 입력 특징 맵(100)의 데이터와 필터(110-1 내지 110-n)를 도식화한 도면이다. 1A is a schematic diagram of a deep learning operation method using an artificial neural network, and FIG. 1B is data and filters 110-1 to 110 of the input feature map 100 provided as input in the deep learning operation. -n) is a schematic diagram.

딥 러닝(Deep Learning) 등을 포함하는 인공지능(AI) 알고리즘은 인공 뉴럴 네트워크(Artificial Neural Network, ANN)에 입력 데이터(10)을 입력시키고, 컨볼루션 등의 연산을 통해 출력 데이터(30)를 학습하는 것을 특징으로 한다. 인공 뉴럴 네트워크는 생물학적 뇌를 모델링한 컴퓨터 과학적 아키텍쳐(Computational Architecture)를 의미할 수 있다. 인공 뉴럴 네트워크 내에서, 뇌의 뉴런들에 해당되는 노드들은 서로 연결되어 있고, 입력 데이터를 처리하기 위하여 집합적으로 동작한다. 다양한 종류의 뉴럴 네트워크들을 예로 들면, 컨볼루션 뉴럴 네트워크(Convolutional Neural Network, CNN), 회귀 뉴럴 네트워크(Recurrent Neural Network, RNN), 딥 빌리프 네트워크(Deep Belief Network, DBN), 제한된 볼츠만 기계(Restricted Boltzman Machine, RBM) 방식 등이 있으나, 이에 제한되지 않는다. 피드-포워드(feed-forward) 뉴럴 네트워크에서, 뉴럴 네트워크의 뉴런들은 다른 뉴런들과의 연결들(links)을 갖는다. 이와 같은 연결들은 뉴럴 네트워크를 통해, 한 방향으로, 예를 들어 순방향(forward direction)으로 확장될 수 있다. Artificial intelligence (AI) algorithms including deep learning, etc. input input data 10 to an artificial neural network (ANN), and output data 30 through operations such as convolution characterized by learning. An artificial neural network may refer to a computer science architecture modeled on a biological brain. In an artificial neural network, nodes corresponding to brain neurons are connected to each other and collectively operate to process input data. Examples of various types of neural networks include Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Deep Belief Networks (DBNs), and Restricted Boltzman Machines (Restricted Boltzman Machines). Machine, RBM) method, etc., but is not limited thereto. In a feed-forward neural network, neurons in the neural network have links to other neurons. Such connections may extend through the neural network in one direction, for example in a forward direction.

도 1a를 참조하면, 인공 뉴럴 네트워크에 입력 데이터(10)가 입력되고, 하나 이상의 레이어(layer)를 포함하는 컨볼루션 뉴럴 네트워크(Convolution Neural Network, CNN)(20)를 통해 출력 데이터(30)가 출력되는 구조가 도시된다. 인공 뉴럴 네트워크는 2개 이상의 레이어를 보유한 딥 뉴럴 네트워크(Deep Neural Network)일 수 있다.Referring to FIG. 1A, input data 10 is input to an artificial neural network, and output data 30 is generated through a convolutional neural network (CNN) 20 including one or more layers. The output structure is shown. The artificial neural network may be a deep neural network having two or more layers.

컨볼루션 뉴럴 네트워크(20)는 입력 데이터(10)로부터 테두리, 선 색 등과 같은 "특징들(features)"을 추출하기 위해 이용될 수 있다. 컨볼루션 뉴럴 네트워크(20)는 복수의 레이어를 포함할 수 있다. 각각의 레이어는 데이터를 수신할 수 있고, 해당 레이어에 입력되는 데이터를 처리하여 해당 레이어에서 출력되는 데이터를 생성할 수 있다. 레이어에서 출력되는 데이터는, 컨볼루션 뉴럴 네트워크(20)에 입력된 이미지 또는 입력된 특징 맵(Feature Map)을 하나 이상의 필터(filter)의 웨이트(weight) 값과 컨볼루션 연산하여 생성한 특징 맵일 수 있다. 컨볼루션 뉴럴 네트워크(20)의 초기 레이어들은 입력으로부터 에지들 또는 그레디언트들과 같은 낮은 레벨의 특징들을 추출하도록 동작될 수 있다. 컨볼루션 뉴럴 네트워크(20)의 다음 레이어들은 이미지 내의 눈, 코 등과 같은 점진적으로 더 복잡한 특징들을 추출할 수 있다.A convolutional neural network 20 may be used to extract “features” such as borders, line colors, etc. from input data 10 . The convolutional neural network 20 may include a plurality of layers. Each layer may receive data, and may process data input to the corresponding layer to generate data output from the corresponding layer. The data output from the layer may be a feature map generated by convolving an image or a feature map input to the convolutional neural network 20 with weight values of one or more filters. there is. Initial layers of convolutional neural network 20 may be operated to extract low-level features such as edges or gradients from the input. Subsequent layers of the convolutional neural network 20 may extract progressively more complex features such as eyes, nose, etc. in the image.

도 1b를 참조하면, 인공 뉴럴 네트워크에 입력으로 제공되는 입력 특징 맵(100) 및 복수의 필터(110-1 내지 110-n)이 도시된다. 입력 특징 맵(100)은 인공 뉴럴 네트워크에 입력되는 이미지의 픽셀 값 또는 수치 데이터의 집합일 수 있으나, 이에 제한되지 않는다. 도 1b에서 입력 특징 맵(100)은 인공 뉴럴 네트워크를 통해 학습할 대상이 되는 이미지의 픽셀 값으로 정의될 수 있다. 예를 들어, 입력 특징 맵(100)은 256×256의 픽셀과 K의 깊이(depth)를 가질 수 있다. 그러나, 상기 값은 예시적인 것이고, 입력 특징 맵(100)의 픽셀 크기가 상기 예시로 한정되는 것은 아니다. Referring to FIG. 1B , an input feature map 100 provided as an input to an artificial neural network and a plurality of filters 110-1 to 110-n are shown. The input feature map 100 may be a set of pixel values or numerical data of an image input to the artificial neural network, but is not limited thereto. In FIG. 1B , the input feature map 100 may be defined as a pixel value of an image to be learned through an artificial neural network. For example, the input feature map 100 may have 256×256 pixels and a depth of K. However, the value is an example, and the pixel size of the input feature map 100 is not limited to the example.

필터(110-1 내지 110-n)은 N개로 형성될 수 있다. 복수의 필터(110-1 내지 110-n) 각각은 n by n(n×n)의 웨이트(weight) 값을 포함할 수 있다. 예를 들어, 복수의 필터(110-1 내지 110-n) 각각은 3×3의 픽셀과 K의 깊이값을 가질 수 있다. 그러나, 상기 필터의 크기는 예시적인 것이고, 복수의 필터(110-1 내지 110-n) 각각의 크기가 상기 예시로 한정되는 것은 아니다. The number of filters 110-1 to 110-n may be N. Each of the plurality of filters 110-1 to 110-n may include a weight value of n by n (n×n). For example, each of the plurality of filters 110-1 to 110-n may have 3×3 pixels and K depth values. However, the size of the filter is exemplary, and the size of each of the plurality of filters 110-1 to 110-n is not limited to the above example.

도 1c는 딥 러닝 기반에서 컨볼루션 연산을 수행하는 과정을 도식화한 도면이다. 1C is a diagram illustrating a process of performing a convolution operation based on deep learning.

도 1c를 참조하면, 인공 뉴럴 네트워크에서 컨볼루션 연산을 수행하는 과정은, 각각의 레이어에서 입력 특징 맵(100)과 필터(110)와의 곱셈 및 덧셈 연산을 하여 출력 값을 생성하고, 출력 값을 누적하여 합산함으로써, 출력 특징 맵(120)을 생성하는 과정을 의미할 수 있다. Referring to FIG. 1C, in the process of performing the convolution operation in the artificial neural network, an output value is generated by performing multiplication and addition operations between the input feature map 100 and the filter 110 in each layer, and the output value This may refer to a process of generating the output feature map 120 by accumulating and summing.

컨볼루션 연산 수행 과정은, 현재 레이어에서 입력 특징 맵(100)의 좌측 상단으로부터 우측 하단까지 일정한 크기, 즉 n×n 크기의 필터(110)를 적용하여 곱셈 및 덧셈 연산을 수행하는 과정이다. 이하에서는, 필터(110)의 크기가 3×3인 경우에 컨볼루션 연산을 수행하는 과정을 설명하기로 한다. The process of performing the convolution operation is a process of performing multiplication and addition operations by applying a filter 110 of a constant size, that is, n×n size, from the upper left corner to the lower right corner of the input feature map 100 in the current layer. Hereinafter, a process of performing a convolution operation when the size of the filter 110 is 3×3 will be described.

예를 들어, 먼저 입력 특징 맵(100)의 좌측 상단 제1 영역(101)에서 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x11 내지 x33)를 각각 필터(110)의 웨이트 값(weight)(w11 내지 w33)과 곱하는 연산을 수행한다. 이후, 곱셈 연산의 출력 값, 즉 x11*w11, x12*w12, x13*w13, x21*w21, x22*w22, x23*w23, x31*w31, x32*w32, x33*w33을 모두 누적하여 합산하면 출력 특징 맵(120)의 제1-1 출력 데이터(y11)가 생성된다. For example, first, in the first region 101 at the upper left of the input feature map 100, a total of 9 data (x 11 ) including 3 × 3, that is, 3 data in the first direction and 3 data in the second direction to x 33 ) and weight values (w 11 to w 33 ) of the filter 110 are multiplied. Afterwards, the output values of the multiplication operation, i.e. x 11 *w 11 , x 12 *w 12 , x 13 *w 13 , x 21 *w 21 , x 22 *w 22 , x 23 *w 23 , x 31 *w 31 , x 32 *w 32 , and x 33 *w 33 are accumulated and summed to generate the 1-1st output data y 11 of the output feature map 120 .

이후, 입력 특징 맵(100)의 좌측 상단의 제1 영역(101)에서 제2 영역(102)으로 데이터의 단위만큼 이동하면서 연산한다. 이 때, 컨볼루션 연산 과정에서 입력 특징 맵(100) 내의 데이터가 이동하는 개수를 스트라이드(stride)라고 하며, 스트라이드의 크기에 따라 생성되는 출력 특징 맵(120)의 크기가 결정될 수 있다. 예를 들어, 스트라이드가 1인 경우, 제2 영역(102)에 포함된 총 9개의 입력 데이터(x12 내지 x34)를 필터(110)의 웨이트 값(w11 내지 w33)과 곱하는 연산을 수행하고, 곱셈 연산의 출력 값인 x12*w11, x13*w12, x14*w13, x22*w21, x23*w22, x24*w23, x32*w31, x33*w32, x34*w33을 모두 누적하여 합산하면 출력 특징 맵(120)의 제1-2 출력 데이터(y12)가 생성된다. Thereafter, calculation is performed while moving from the first area 101 at the upper left of the input feature map 100 to the second area 102 by a unit of data. In this case, the number of data movements in the input feature map 100 during the convolution operation is called a stride, and the size of the generated output feature map 120 may be determined according to the size of the stride. For example, when the stride is 1, an operation of multiplying a total of 9 input data (x 12 to x 34 ) included in the second region 102 by weight values (w 11 to w 33 ) of the filter 110 is performed. and the output values of the multiplication operation are x 12 *w 11 , x 13 *w 12 , x 14 *w 13 , x 22 *w 21 , x 23 *w 22 , x 24 *w 23 , x 32 *w 31 , When x 33 *w 32 and x 34 *w 33 are accumulated and summed, first-second output data y 12 of the output feature map 120 is generated.

도 1c에 도시된 컨볼루션 연산을 수행하여 출력 특징 맵(120)을 생성하는 경우, 입력 특징 맵(100)의 데이터의 수와 필터(110)의 크기에 따라 곱셈 및 덧셈 연산을 수행하는 횟수가 많아지게 된다. 픽셀의 크기가 큰 이미지 파일의 경우 초당 기가(Giga) 단위의 연산을 수행해야 하므로, 연산에 소요되는 시간 및 전력량이 많아지게 되는 문제점이 있다.When generating the output feature map 120 by performing the convolution operation shown in FIG. it becomes a lot In the case of an image file having a large pixel size, an operation in units of gigabytes per second must be performed, which increases the amount of time and power required for the operation.

도 2는 종래의 시스톨릭 배열(Systolic Array)을 이용하여 컨볼루션 연산을 수행하는 방법을 설명하기 위한 개념도이다.2 is a conceptual diagram for explaining a method of performing a convolution operation using a conventional systolic array.

도 2를 참조하면, 입력 특징 맵(200)의 각 데이터는 일정한 레이턴시(latency)를 갖는 클럭(clock)에 따라 순차적으로 곱셈 덧셈 연산기(211 내지 219)에 입력되는 시스톨릭 배열로 매핑(mapping)될 수 있다. 예를 들어, 제1 클럭에는 시스톨릭 배열의 제1 행(①)의 제1-1 데이터(x11)가 제1 곱셈 덧셈 연산기(211)에 입력될 수 있다. 도 2에는 도시되지 않았지만, 제1-1 데이터(x11)는 제1 클럭에서 w11의 웨이트 값과 곱해질 수 있다. 이후 제2 클럭에서는 제1-1 데이터(x11)는 제2 곱셈 덧셈 연산기(212)에 입력되고, 제2-1 데이터(x21)는 제1 곱셈 덧셈 연산기(211)에 입력되며, 제1-2 데이터(x12)는 제4 곱셈 덧셈 연산기(214)에 입력될 수 있다. 마찬가지로, 제3 클럭에서 제1-1 데이터(x11)는 제3 곱셈 덧셈 연산기(213)에 입력되고, 제2-1 데이터(x21)는 제2 곱셈 덧셈 연산기(212)에 입력되며, 제1-2 데이터(x12)는 제5 곱셈 덧셈 연산기(215)에 입력 될 수 있다. 제3 클럭에서 제3-1 데이터(x31)는 제1 곱셈 덧셈 연산기(211)에 입력되고, 제2-2 데이터(x22)는 제4 곱셈 덧셈 연산기(214)에 입력되며, 제1-3 데이터(x13)는 제7 곱셈 덧셈 연산기(217)에 입력될 수 있다. Referring to FIG. 2, each data of the input feature map 200 is sequentially inputted to the multiplication and addition operators 211 to 219 according to a clock having a certain latency. Mapping into a systolic array It can be. For example, at the first clock, the 1-1 data (x 11 ) of the first row (①) of the systolic array may be input to the first multiplication and addition operator 211 . Although not shown in FIG. 2 , the 1-1 data (x 11 ) may be multiplied by the weight value of w 11 at the first clock. Then, at the second clock, the 1-1 data (x 11 ) is input to the second multiplication-add operator 212, and the 2-1 data (x 21 ) is input to the first multiplication-add operator 211, The 1-2 data (x 12 ) may be input to the fourth multiplication operator 214 . Similarly, at the third clock, the 1-1 data (x 11 ) is input to the 3 multiplication addition operator 213, and the 2-1 data (x 21 ) is input to the 2 multiplication addition operator 212, The 1-2 data (x 12 ) may be input to the fifth multiplication and addition operator 215 . At the third clock, the 3-1st data (x 31 ) is input to the first multiplication-adding operator 211, the 2-2nd data (x 22 ) is input to the 4th multiplication-adding operator 214, and the first The -3 data (x 13 ) may be input to the seventh multiplication and addition operator 217 .

전술한 바와 같이, 입력 데이터(200)는 순차적인 클럭에 따라 곱셈 덧셈 연산기(211 내지 219) 내의 각 곱셈 덧셈 연산기에 입력되고, 각 클럭에 따라 입력된 웨이트 값과 곱셈 및 덧셈 연산이 수행될 수 있다. 순차적으로 입력된 입력 특징 맵(200)의 각 데이터와 웨이트 값의 곱셈 및 덧셈 연산을 통해 출력된 값들을 누적 합산함에 따라 출력 특징 맵이 생성될 수 있다.As described above, the input data 200 is input to each multiplication and addition operator in the multiplication and addition operators 211 to 219 according to sequential clocks, and multiplication and addition operations are performed with the input weight value according to each clock. there is. An output feature map may be generated by cumulatively summing values output through multiplication and addition operations of respective data of the input feature map 200 input sequentially and weight values.

도 2에 도시된 시스톨릭 배열을 이용한 컨볼루션 연산은 도 1c에 도시된 컨볼루션 연산 보다 연산 속도가 더 빠를 수 있다. The convolution operation using the systolic arrangement shown in FIG. 2 may have a higher computational speed than the convolution operation shown in FIG. 1C.

도 3a는 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이다. 3A is a diagram illustrating a method of performing a deep learning-based convolution operation.

도 3a를 참조하면, 입력 특징 맵(300)의 좌측 상단으로부터 우측 하단까지 일정한 크기, 즉 3×3 크기의 필터(310)를 적용하여 곱셈 및 덧셈 연산을 수행하는 과정이 도시되어 있다. Referring to FIG. 3A , a process of performing multiplication and addition operations by applying a filter 310 of a constant size, that is, a 3×3 size, from the upper left corner to the lower right corner of the input feature map 300 is illustrated.

본 개시의 일 실시예에 따른 컨볼루션 연산은, 먼저 입력 특징 맵(300)의 좌측 상단 제1 영역(301)에서 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x11 내지 x33)를 각각 필터(310)의 웨이트 값(weight)(w11 내지 w33)과 곱하는 연산을 수행한다. 이후, 곱셈 연산의 출력 값, 즉 x11*w11, x12*w12, x13*w13, x21*w21, x22*w22, x23*w23, x31*w31, x32*w32, x33*w33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제1-1 출력 데이터(y11)가 생성된다. In the convolution operation according to an embodiment of the present disclosure, first, in the first area 301 at the top left of the input feature map 300, 3 × 3, that is, 3 data in the first direction and 3 data in the second direction An operation of multiplying a total of 9 data (x 11 to x 33 ) including the weight value (w 11 to w 33 ) of the filter 310 is performed. Afterwards, the output values of the multiplication operation, i.e. x 11 *w 11 , x 12 *w 12 , x 13 *w 13 , x 21 *w 21 , x 22 *w 22 , x 23 *w 23 , x 31 *w 31 , x 32 *w 32 , and x 33 *w 33 are accumulated and summed to generate the 1-1st output data y 11 of the output feature map 320 .

이후, 입력 특징 맵(300)의 좌측 상단의 제1 영역(301)에서 제2 영역(302)으로 1만큼 스트라이드하고, 제2 영역(302)에 포함된 총 9개의 입력 데이터(x12 내지 x34)를 필터(310)의 웨이트 값(w11 내지 w33)과 곱하는 연산을 수행하고, 곱셈 연산의 출력 값인 x12*w11, x13*w12, x14*w13, x22*w21, x23*w22, x24*w23, x32*w31, x33*w32, x34*w33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제1-2 출력 데이터(y12)가 생성된다. 스트라이드의 크기가 1인 경우, 제1 영역(301)과 제2 영역(302) 사이에서 입력 특징 맵(300)의 데이터 중 중복되어 연산에 사용되는 데이터는 x12, x13, x22, x23, x32, x33을 포함하는 총 6개의 데이터이다. Thereafter, stride by 1 from the first area 301 at the upper left of the input feature map 300 to the second area 302, and a total of 9 input data (x 12 to x 34 ) is multiplied by the weight values (w 11 to w 33 ) of the filter 310, and the output values of the multiplication operation are x 12 *w 11 , x 13 *w 12 , x 14 *w 13 , x 22 * When w 21 , x 23 *w 22 , x 24 *w 23 , x 32 *w 31 , x 33 *w 32 , and x 34 *w 33 are accumulated and summed, the 1-2 outputs of the output feature map 320 Data (y 12 ) is created. When the size of the stride is 1, overlapping data of the input feature map 300 between the first area 301 and the second area 302 and used for calculation are x 12 , x 13 , x 22 , x This is a total of 6 data including 23 , x 32 , x 33 .

스트라이드를 계속하여 제3 영역(303)에 도달한 경우, 제3 영역(303)에 포함된 총 9개의 데이터, 즉 x21 내지 x43은 필터(310)의 웨이트 값(w11 내지 w33)과 곱하는 연산이 수행되고, 곱셈 연산의 출력 값인 x21*w11, x22*w12, x23*w13, x31*w21, x32*w22, x33*w23, x41*w31, x42*w32, x43*w33을 모두 누적하여 합산하면 출력 특징 맵(320)의 제2-1 출력 데이터(y21)가 생성된다. 제3 영역(303)과 제1 영역(301) 사이에서 입력 특징 맵(300)의 데이터 중 중복되어 연산에 사용되는 데이터는 x21, x22, x23, x31, x32, x33을 포함하는 총 6개의 데이터이다. When the stride is continued to reach the third area 303, a total of 9 data included in the third area 303, that is, x21 to x43 are multiplied by the weight values (w 11 to w 33 ) of the filter 310 The operation is performed, and the output values of the multiplication operation are x 21 *w 11 , x 22 *w 12 , x 23 *w 13 , x 31 *w 21 , x 32 *w 22 , x 33 *w 23 , x 41 *w When 31 , x 42 *w 32 , and x 43 *w 33 are accumulated and summed, the 2-1st output data y 21 of the output feature map 320 is generated. Among the data of the input feature map 300 between the third area 303 and the first area 301, the overlapped data used for calculation are x 21 , x 22 , x 23 , x 31 , x 32 , x 33 A total of 6 data included.

즉, 스트라이드가 1인 경우 입력 데이터 중 특정 영역(300A)에 포함된 입력 데이터(x22, x23, x32, x33, x42, x43)는 총 3번씩 중복되어 곱셈 및 덧셈 연산에 입력되게 된다. 여기서, 중복되는 회수는 필터의 크기 및 스트라이드의 값에 따라 결정될 수 있다. 입력 특징 맵(300)의 데이터가 x11, x12, x13, x12, x13, x14, x13, x14, x15,... , 로 순차적으로 입력됨에 따라 각 클럭마다 데이터를 토글(toggle)해야 하고, 이로 인하여 전력 소비량이 늘어나게 된다.That is, when the stride is 1, the input data (x 22 , x 23 , x 32 , x 33 , x 42 , x 43 ) included in the specific area 300A among the input data are duplicated 3 times in total to perform multiplication and addition operations. will be entered Here, the number of repetitions may be determined according to the size of the filter and the value of the stride. As the data of the input feature map 300 is sequentially input as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , x 13 , x 14 , x 15 ,..., data for each clock must be toggled, which increases power consumption.

도 3b는 본 개시의 일 실시예에 따라 입력 특징 맵(300)의 데이터의 입력 순서(sequence)를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다.3B is a diagram illustrating a method of changing the input sequence of data of the input feature map 300 and mapping them into a systolic arrangement according to an embodiment of the present disclosure.

도 3b를 참조하면, 입력 특징 맵(300)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑되고, 입력 특징 맵(300)의 동일한 값을 갖는 데이터가 반복되어 시스톨릭 배열 연산기 내의 각 곱셈 덧셈 연산기(311 내지 319)에 입력되도록 입력 특징 맵(300)의 데이터의 순서를 변경될 수 있다. 예를 들어, 시스톨릭 배열로 매핑된 입력 특징 맵(300)의 제1 행(①)에서, 제1 클럭, 제2 클럭 및 제3 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x11(300-1)일 수 있다. 또한, 제1 행(①)에서, 제4 클럭, 제5 클럭 및 제6 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x12(300-2)이고, 제7 클럭, 제8 클럭 및 제9 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x13(300-3)일 수 있다. Referring to FIG. 3B, data of the input feature map 300 is mapped into a systolic array in which data is input according to sequential clocks, and data having the same value of the input feature map 300 is repeated to form a systolic array. The order of data of the input feature map 300 may be changed to be input to each of the multiplication and addition operators 311 to 319 in the Tolik array operator. For example, in the first row (①) of the input feature map 300 mapped to the systolic array, data input to the systolic array operator according to the first clock, the second clock, and the third clock are all the same x 11 (300-1). In addition, in the first row (①), data input to the systolic array calculator according to the fourth clock, fifth clock, and sixth clock are all the same x 12 (300-2), and the seventh clock and the eighth clock and data input to the systolic array operator according to the ninth clock may be the same x 13 (300-3).

마찬가지로, 시스톨릭 배열로 매핑된 입력 특징 맵(300)의 제2 행(②)에서 제2 클럭, 제3 클럭 및 제4 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x12(300-4)이고, 제3 행(③)에서 제3 클럭, 제4 클럭 및 제5 클럭에 따라 시스톨릭 배열 연산기에 입력되는 데이터는 모두 동일한 x13(300-5)일 수 있다. Similarly, data input to the systolic array operator according to the second clock, the third clock, and the fourth clock in the second row (②) of the input feature map 300 mapped to the systolic array are all the same x 12 (300 -4), and all data input to the systolic array calculator according to the third clock, fourth clock, and fifth clock in the third row (③) may be the same x 13 (300-5).

시스톨릭 배열 연산기 내의 각 곱셈 덧셈 연산기(311 내지 319) 측면에서 보면, 제1 곱셈 덧셈 연산기(311)에는 제1 클럭 내지 제3 클럭에 따라 입력 특징 맵(300)의 x11 데이터(300-1)가 반복되어 입력될 수 있다. 마찬가지로, 제4 곱셈 덧셈 연산기(314)에는 제2 클럭 내지 제4 클럭에 따라 입력 특징 맵(300)의 x12 데이터(300-4)가 반복되어 입력되고, 제7 곱셈 덧셈 연산기(317)에는 제3 클럭 내지 제5 클럭에 따라 x13 데이터(300-5)가 반복되어 입력될 수 있다. Looking at each multiplication-adding operator 311 to 319 in the systolic array operator, the first multiplication-adding operator 311 has x 11 data 300-1 of the input feature map 300 according to the first clock to the third clock. ) may be repeatedly input. Similarly, x 12 data 300-4 of the input feature map 300 is repeatedly input to the fourth multiplication operator 314 according to the second to fourth clocks, and to the seventh multiplication operator 317 According to the third to fifth clocks, x 13 data 300-5 may be repeatedly input.

도 3b에 도시된 실시예에서, 입력 특징 맵(300)은 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복적으로 시스톨릭 배열 연산기에 입력되도록 시스톨릭 배열로 매핑될 수 있다. 여기서, 기설정된 회수는 필터(310)의 크기와 동일할 수 있다. 즉, 필터의 크기가 n×n인 경우, 입력 특징 맵(300)은 동일한 값을 갖는 데이터가 n번 중복되어 반복적으로 시스톨릭 배열 연산기에 입력되도록 매핑될 수 있다. 예를 들어, 필터(310)의 크기가 3×3인 경우, 입력 특징 맵(300)의 x11 데이터(300-1), x21 데이터(300-2), x31 데이터(300-3), x12 데이터(300-4) 및 x13 데이터(300-5)는 총 3번씩 반복되어 시스톨릭 배열 연산기에 입력되도록 입력 순서(sequence)가 변경될 수 있다. In the embodiment shown in FIG. 3B , the input feature map 300 may be mapped into a systolic array such that data having the same value are repeatedly input to the systolic array operator a predetermined number of times. Here, the preset number of times may be the same as the size of the filter 310 . That is, when the size of the filter is n×n, the input feature map 300 may be mapped such that data having the same value are repeatedly input to the systolic array calculator n times. For example, when the size of the filter 310 is 3 × 3, x 11 data (300-1), x 21 data (300-2), x 31 data (300-3) of the input feature map 300 , x 12 data 300-4 and x 13 data 300-5 may be repeated three times and input to the systolic array calculator, so that the input sequence may be changed.

그러나, 입력 특징 맵(300)의 데이터가 반복되는 회수가 필터의 크기로 한정되는 것은 아니다. 일 실시예에서, 입력 특징 맵(300)의 데이터가 반복되어 시스톨릭 배열 연산기에 입력되는 회수는 2회일 수 있다. 이에 대해서는 도 5a 및 도 5b를 참조하여 설명하기로 한다.However, the number of repetitions of data of the input feature map 300 is not limited to the size of the filter. In one embodiment, the number of times the data of the input feature map 300 is repeated and inputted to the systolic array operator may be twice. This will be described with reference to FIGS. 5A and 5B.

도 3c는 본 개시의 일 실시예에 따른 시스톨릭 배열 연산기를 이용하여 컨볼루션 연산을 수행하고, 연산된 결과 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성하는 방법을 도식화한 도면이다.3C is a diagram illustrating a method of generating an output feature map by performing a convolution operation using a systolic array operator and accumulating the calculated result values according to an embodiment of the present disclosure.

도 3c를 참조하면, 시스톨릭 배열 연산기에 입력 특징 맵과 필터의 웨이트 값이 입력되고, 순차적인 클럭에 따라 입력된 특징 맵의 데이터와 필터의 웨이트 값을 곱셈 및 덧셈하는 연산이 수행되는 과정이 도시되어 있다. 예를 들어, 제1 클럭에서 제1-1 데이터(x11)와 제1-1 웨이트(w11)가 제1-1 연산기(1-1)에 의해 곱셈 연산될 수 있다. 제2 클럭에서는, 제1-1 데이터(x11)와 제1-2 웨이트(w12)가 제1-1 연산기(1-1)에 의해 곱셈 연산되고, 제1 클럭에서 연산되었던 x11*w11과 덧셈 연산될 수 있다. 마찬가지로, 제2 클럭에서 제1-1 데이터(x11)는 제2-1 웨이트(w21)과 제2-1 연산기(2-1)에 의해 곱셈 연산되고, 제1-2 데이터(x12)는 제2-2 연산기(2-2)에 의해 제2-1 웨이트(w21)와 곱셈 연산될 수 있다. 제3 클럭에서는, 제1-1 데이터(x11)와 제1-3 웨이트(w13)가 제1-1 연산기(1-1)에 의해 곱셈 연산되고, 기 연산되었던 x11*w11+x11*x12와 덧셈 연산될 수 있다. 또한, 제3 클럭에서 제1-1 데이터(x11)와 제2-2 웨이트(w22)가 제2-2 연산기(2-2)에 의해 곱셈 연산되고, 기 연산되었던 x11*w21과 덧셈 연산될 수 있다. 도 3c의 하단을 참조하면, 상기 방법으로 각 사이클(cycle)에 따라 입력 특징 맵의 각 데이터와 필터의 웨이트 값이 복수의 시스톨릭 배열 연산기에 의해 순차적으로 곱셈 및 덧셈 연산되어 출력될 수 있다. Referring to FIG. 3C, the input feature map and filter weight values are input to the systolic array calculator, and operations of multiplying and adding the input feature map data and filter weight values are performed according to sequential clocks. is shown For example, at the first clock, the 1-1 data (x 11 ) and the 1-1 weight (w 11 ) may be multiplied by the 1-1 operator 1-1. At the second clock, the 1-1 data (x 11 ) and the 1-2 weight (w 12 ) are multiplied by the 1-1 operator (1-1), and x 11 * calculated at the first clock Can be added with w 11 . Similarly, at the second clock, the 1-1 data (x 11 ) is multiplied by the 2-1 weight (w 21 ) and the 2-1 operator 2-1, and the 1-2 data (x 12 ) may be multiplied with the 2-1 weight (w 21 ) by the 2-2 operator 2-2. At the third clock, the 1-1 data (x 11 ) and the 1-3 weight (w 13 ) are multiplied by the 1-1 operator (1-1), and the pre-calculated x 11 *w 11 + Can be added to x 11 *x 12 . In addition, at the third clock, the 1-1 data (x 11 ) and the 2-2 weight (w 22 ) are multiplied by the 2-2 operator 2-2, and the pre-calculated x 11 *w 21 and can be added. Referring to the lower part of FIG. 3C , each data of the input feature map and the weight value of the filter may be sequentially multiplied and added according to each cycle by a plurality of systolic array operators and outputted according to the above method.

도 3c에 도시된 실시예에서, 필터가 입력 특징 맵 상에서 스트라이드 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 값의 조합에 기초하여 시스톨릭 배열 연산기에 의해 연산된 출력 값이 선택되고, 선택된 출력 값들이 누적 합산되어 출력 특징 맵이 생성될 수 있다. 즉, 입력 특징 맵 상에서 필터가 제1 방향(가로 방향) 및 제2 방향(세로 방향)으로 스트라이드 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 간의 조합에 기초하여 시스톨릭 배열 연산기에 의해 연산된 출력 값을 선택하고, 선택된 출력 값들을 누적 합산하면, 컨볼루션 연산을 수행한 것과 동일한 출력 특징 맵이 얻어질 수 있다. In the embodiment shown in FIG. 3C , an output value calculated by the systolic array operator is selected based on a combination of weight values of the filter and data of the input feature map that is changed as the filter is strided on the input feature map, and the selected An output feature map may be generated by cumulative summing of the output values. That is, it is calculated by a systolic array operator based on a combination between data of the input feature map and weights of the filter, which are changed as the filter is strided in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map. When selected output values are selected and the selected output values are cumulatively summed, an output feature map identical to that obtained by performing the convolution operation may be obtained.

예를 들어, 제1-1 연산기(1-1)에 의해 곱셈 연산된 x11*w11, 제1-2 연산기(1-2)에 의해 곱셈 연산된 x12*w12, 제1-3 연산기(1-3)에 곱셈 연산된 x13*w13, 제2-1 연산기(2-1)에 의해 곱셈 연산된 x21*w21, 제2-2 연산기(2-2)에 의해 곱셈 연산된 x22*w22, 제2-3 연산기(2-3)에 의해 곱셈 연산된 x23*w23, 제3-1 연산기(3-1)에 의해 곱셈 연산된 x31*w31, 제3-2 연산기(3-2)에 의해 곱셈 연산된 x32*w32, 및 제3-3 연산기(3-3)에 의해 곱셈 연산된 x33*w33을 선택적으로 누적 합산하면, 출력 특징 맵의 제1-1 출력 값(y11)이 생성될 수 있다. 마찬가지로, 제1-2 연산기(1-2)에 의해 곱셈 연산된 x12*w11, 제1-3 연산기(1-3)에 의해 곱셈 연산된 x13*w12, 제1-4 연산기(1-4)에 곱셈 연산된 x14*w13, 제2-2 연산기(2-2)에 의해 곱셈 연산된 x22*w21, 제2-3 연산기(2-3)에 의해 곱셈 연산된 x23*w22, 제2-4 연산기(2-4)에 의해 곱셈 연산된 x24*w23, 제3-2 연산기(3-2)에 의해 곱셈 연산된 x32*w31, 제3-3 연산기(3-3)에 의해 곱셈 연산된 x33*w32, 및 제3-4 연산기(3-4)에 의해 곱셈 연산된 x34*w33을 선택적으로 누적 합산하면, 출력 특징 맵의 제1-2 출력 값(y12)이 생성될 수 있다For example, x 11 *w 11 multiplied by the 1-1 operator (1-1), x 12 *w 12 multiplied by the 1-2 operator (1-2), and 1-3 x 13 *w 13 multiplied by operator 1-3, x 21 *w 21 multiplied by 2-1 operator 2-1, multiplied by 2-2 operator 2-2 x 22 *w 22 calculated, x 23 *w 23 multiplied by the 2-3 operator (2-3), x 31 *w 31 multiplied by the 3-1 operator (3-1), When x 32 *w 32 multiplied by the 3-2 operator 3-2 and x 33 *w 33 multiplied by the 3-3 operator 3-3 are selectively cumulatively summed, an output A 1-1st output value (y 11 ) of the feature map may be generated. Similarly, x 12 *w 11 multiplied by the 1-2 operator 1-2, x 13 *w 12 multiplied by the 1-3 operator 1-3, and the 1-4 operator ( 1-4) multiplication operation x 14 *w 13 , multiplication operation by the 2-2 operator (2-2) x 22 *w 21 , multiplication operation by the 2-3 operator (2-3) x 23 *w 22 , x 24 *w 23 multiplied by the 2-4 operator (2-4), x 32 *w 31 multiplied by the 3-2 operator (3-2), the third When x 33 *w 32 multiplied by the -3 operator 3-3 and x 34 *w 33 multiplied by the 3-4 operator 3-4 are selectively cumulatively summed, the output feature map A 1-2 output value (y 12 ) of may be generated.

종래의 시스톨릭 배열 연산은 중복되어 연산되는 입력 데이터를 고려하지 않고, 입력 특징 맵(300)의 데이터를 순차적으로 입력시키는 방식을 사용하였으므로, 모든 클럭에 따라 입력 데이터의 값을 토글(toggle)해야 된다. 예를 들면, 입력 특징 맵(300)의 데이터가 순차적인 클럭에 따라 x11, x12, x13, x12, x13, x14, ... , 식으로 입력되는바, 모든 클럭에서 버스 데이터를 토글해야 한다. 일반적으로 컨볼루션 뉴럴 네트워크를 이용한 딥 러닝 연산에서는 초 당 기가(giga) 단위의 데이터 연산을 수행해야 되는바, 각 클럭에 따라 버스 데이터(bus data)를 토글 해야 하는 경우 프로세서 또는 칩 내부에서 소모되는 전력량이 증가하게 된다. 제한된 전력만을 사용해야 하는 모바일 디바이스(mobile device), 애플리케이션 또는 컴퓨팅 환경에서 컨볼루션 연산을 통한 딥 러닝에 제한이 있을 수 밖에 없다. Since the conventional systolic array operation uses a method of sequentially inputting the data of the input feature map 300 without considering input data that is operated repeatedly, the value of the input data must be toggled according to all clocks. do. For example, the data of the input feature map 300 is input as x 11 , x 12 , x 13 , x 12 , x 13 , x 14 , ... , according to sequential clocks, and the bus is input at every clock. Data should be toggled. In general, in deep learning operations using convolutional neural networks, data operations in giga units per second must be performed. power will increase. In a mobile device, application, or computing environment that must use only limited power, deep learning through convolution operation is inevitably limited.

다시 도 3a를 참조하면, 입력 특징 맵(300) 상에서 필터(310)가 제1 방향(가로 방향) 및 제2 방향(세로 방향)으로 1만큼 스트라이드 됨에 따라 입력 특징 맵(300)의 데이터 중 x22, x23, x32, x33, x42, x43은 총 3번 중복되어 곱셈 연산될 수 있다. 본 개시의 실시예는, 입력 특징 맵(300)의 데이터 중 곱셈 및 덧셈 연산에 입력되어 다시 사용(reuse)되는 회수 만큼 입력 특징 맵(300)의 데이터를 중복(overlap)하여 반복적으로 시스톨릭 배열 연산기에 입력되도록 입력 특징 맵(300)의 데이터를 매핑할 수 있다. 일 실시예에서, 시스톨릭 배열 연산기에 입력되는 데이터의 반복 회수는 필터(310)의 크기에 의해 결정될 수 있다. 예를 들어, 필터(310)의 크기가 n×n인 경우, 입력 특징 맵(300)의 데이터가 n번 반복되어 시스톨릭 배열 연산기에 입력되도록 매핑될 수 있다. 예를 들어, 순차적인 클럭에 따라 시스톨릭 배열 연산기 내의 곱셈 및 덧셈 연산기에 입력되는 데이터의 순서가 x11, x11, x11, x21, x21, x21, x31, x31, x31, ... , 순서로 3번씩 반복되도록 입력 특징 맵(300)의 데이터를 매핑할 수 있다. Referring back to FIG. 3A, as the filter 310 is strided by 1 in the first direction (horizontal direction) and the second direction (vertical direction) on the input feature map 300, x of the data of the input feature map 300 22 , x 23 , x 32 , x 33 , x 42 , x 43 can be multiplied three times in total. In an embodiment of the present disclosure, the data of the input feature map 300 is overlapped by the number of times that the data of the input feature map 300 is input to multiplication and addition operations and reused, thereby repeatedly systolic arrangement Data of the input feature map 300 may be mapped to be input to the calculator. In one embodiment, the number of repetitions of data input to the systolic array operator may be determined by the size of the filter 310 . For example, when the size of the filter 310 is n×n, data of the input feature map 300 may be repeated n times and mapped to be input to a systolic array operator. For example, the order of data input to the multiplication and addition operators in the systolic array operator according to sequential clocks is x 11 , x 11 , x 11 , x 21 , x 21 , x 21 , x 31 , x 31 , x Data of the input feature map 300 may be mapped so that it is repeated three times in the order of 31 , ... , .

또한, 도 3c에 도시된 실시예를 참조하면, 매핑된 입력 특징 맵(300)의 데이터가 각 클럭에 따라 반복적으로 입력되고, 입력된 데이터와 필터의 웨이트 값을 곱셈 및 덧셈 연산하여 출력된 값들을 선택적으로 누적 합산하여 출력 특징 맵을 생성할 수 있다. In addition, referring to the embodiment shown in FIG. 3C, the data of the mapped input feature map 300 is repeatedly input according to each clock, and the output value is multiplied and added by the input data and the weight value of the filter. may optionally be cumulatively summed to generate an output feature map.

따라서, 도 3b 및 도 3c에 도시된 실시예에 따르면 입력 특징 맵(300) 중 동일한 값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되므로, 기존 방식의 컨볼루션 연산에 비하여 메모리에 액세스하는 양과 버스 데이터 토글(toggle) 양이 현저하게 줄어드는바, 프로세서 또는 칩 내부에서 소모되는 전력량을 감소시킬 수 있다. Therefore, according to the embodiments shown in FIGS. 3B and 3C, since data having the same value among the input feature maps 300 is repeatedly input to the systolic array operator, the amount of memory access and Since the amount of bus data toggle is significantly reduced, the amount of power consumed inside a processor or chip can be reduced.

도 4는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법을 나타내는 흐름도이다. 도 4에 도시된 각 단계(S410 내지 S430)는 컨볼루션 뉴럴 네트워크 기반의 딥 러닝 연산을 수행하는 프로세서(processor) 또는 칩(chip)을 포함하는 컴퓨팅 장치 또는 애플리케이션 프로세서(Application Processor, AP)를 포함하는 모바일 장치에 의해 수행될 수 있다. 이하에서는, 컴퓨팅 장치 및 모바일 장치를 포괄하는 '전자 장치'라는 용어를 사용하기로 한다.4 is a flowchart illustrating a method of performing a deep learning operation using a systolic array according to an embodiment of the present disclosure. Each step (S410 to S430) shown in FIG. 4 includes a computing device or application processor (AP) including a processor or chip that performs a deep learning operation based on a convolutional neural network. It can be performed by a mobile device that does. Hereinafter, the term 'electronic device' encompassing a computing device and a mobile device will be used.

단계 S410에서, 전자 장치는 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)한다. 전자 장치는 일정한 레이턴시(latency)를 갖는 클럭(clock)에 따라 순차적으로 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑할 수 있다. 일 실시예에서, 전자 장치는 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되는 입력 데이터가 적어도 2번 이상 반복되어 입력되도록 시스톨릭 배열 내에서의 입력 특징 맵의 데이터의 입력 순서를 변경할 수 있다. 일 실시예에서, 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되는 데이터의 반복 회수는 필터의 크기에 의해 결정될 수 있다. 예를 들어, 필터의 크기가 n×n인 경우, 전자 장치는 입력 특징 맵의 데이터가 n번 반복되어 시스톨릭 배열 연산기에 입력되도록 입력 특징 맵의 데이터를 매핑될 수 있다.In step S410, the electronic device maps data of the input feature map into a systolic array so that data having the same value is repeated a predetermined number of times and input to a multiplication and addition operator in the systolic array operator. The electronic device may map data of the input feature map into a systolic array so as to be sequentially input to the multiplication operator according to a clock having a certain latency. In an embodiment, the electronic device may change the input order of input feature map data in the systolic array so that input data input to the multiplication and addition operator in the systolic array is repeatedly input at least twice. In one embodiment, the number of repetitions of data input to the multiplication and addition operator in the systolic array operator may be determined by the size of the filter. For example, when the size of the filter is n×n, the electronic device may map data of the input feature map such that the data of the input feature map is repeated n times and input to the systolic array calculator.

단계 S420에서, 전자 장치는 매핑된 입력 특징 맵 데이터 및 필터의 웨이트 값을 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행한다. 일 실시예에서, 전자 장치는 순차적인 클럭에 따라 입력 특징 맵의 데이터가 기설정된 회수만큼 반복적으로 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력시키고, 각 클럭에 따라 필터의 웨이트 값이 곱셈 덧셈 연산기에 입력시키면서 컨볼루션 연산을 수행할 수 있다. In step S420, the electronic device performs a convolution operation by inputting the mapped input feature map data and the weight value of the filter to a systolic array calculator. In one embodiment, the electronic device repeatedly inputs the data of the input feature map to the multiplication-adding operator in the systolic array operator a predetermined number of times according to sequential clocks, and the weight value of the filter is input to the multiplication-adding operator according to each clock. Convolution operation can be performed while inputting.

단계 S430에서, 전자 장치는 컨볼루션 연산된 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성한다. 일 실시예에서, 전자 장치는 시스톨릭 배열 연산기 내의 복수의 곱셈 덧셈 연산기 각각에 의해 계산된 입력 특징 맵 데이터와 필터의 웨이트 곱을 누적하여 합산함으로써, 출력 데이터를 생성할 수 있다. 전자 장치는 입력 특징 맵 상에서 필터의 이동(stride)을 참조하여, 복수의 곱셈 덧셈 연산기에서 계산된 복수의 출력 데이터들을 선택적으로 누적 합산할 수 있다. 일 실시예에서, 전자 장치는 스트라이드의 값에 따른 입력 특징 맵의 데이터와 필터의 웨이트 간의 조합에 기초하여 복수의 출력 값들을 선택하고, 선택된 출력 값들을 누적 합산하여 출력 특징 맵을 생성할 수 있다. In step S430, the electronic device generates an output feature map by accumulating the output values obtained by the convolution operation. In an embodiment, the electronic device may generate output data by accumulating and summing input feature map data calculated by each of a plurality of multiplication and addition operators in the systolic array operator and the weight product of the filter. The electronic device may selectively cumulatively add a plurality of output data calculated by a plurality of multiplication operators by referring to a stride of the filter on the input feature map. In an embodiment, the electronic device may generate an output feature map by selecting a plurality of output values based on a combination between filter weights and data of an input feature map according to a stride value and cumulatively summing the selected output values. .

도 5a는 딥 러닝 기반의 컨볼루션 연산을 수행하는 방법을 도식화한 도면이다. 5A is a diagram illustrating a method of performing a deep learning-based convolution operation.

도 5a를 참조하면, 입력 특징 맵(500) 상에서 스트라이드 1 만큼 이동하면서 입력 특징 맵(500)의 데이터 값과 곱셈 및 덧셈 연산되는 3×3 크기의 필터(510)가 도시되어 있다.Referring to FIG. 5A , a filter 510 having a size of 3×3 is shown that multiplies and adds data values of the input feature map 500 while moving by a stride of 1 on the input feature map 500 .

도 5a에 도시된 실시예에서, 입력 특징 맵(500)의 좌측 상단 제1 영역(501) 상에 3×3, 즉 제1 방향으로 3개의 데이터와 제2 방향으로 3개의 데이터를 포함한 총 9개의 데이터(x11 내지 x33)는 각각 필터(510)의 웨이트 값(weight)(w11 내지 w33)과 곱하는 연산이 수행된다. 곱셈 연산의 출력 값, 즉 x11*w11, x12*w12, x13*w13, x21*w21, x22*w22, x23*w23, x31*w31, x32*w32, x33*w33을 모두 누적하여 합산하면 출력 특징 맵(520)의 제1-1 출력 데이터(y11)가 생성된다. In the embodiment shown in FIG. 5A, a total of 9 data including 3 data in the first direction and 3 data in the second direction is 3×3 on the first area 501 at the top left of the input feature map 500. An operation of multiplying each of the data (x 11 to x 33 ) with weight values (w 11 to w 33 ) of the filter 510 is performed. The output values of the multiplication operation, i.e. x 11 *w 11 , x 12 *w 12 , x 13 *w 13 , x 21 *w 21 , x 22 *w 22 , x 23 *w 23 , x 31 *w 31 , x When 32 *w 32 and x 33 *w 33 are accumulated and summed, the 1-1st output data y 11 of the output feature map 520 is generated.

이후, 입력 특징 맵(500)의 제1 영역(501)에서 제2 영역(502)으로 1만큼 스트라이드하고, 제2 영역(502)에 포함된 총 9개의 입력 데이터(x12 내지 x34)를 필터(510)의 웨이트 값(w11 내지 w33)과 곱하는 연산이 수행되면, 곱셈 연산의 출력 값인 x12*w11, x13*w12, x14*w13, x22*w21, x23*w22, x24*w23, x32*w31, x33*w32, x34*w33이 누적 합산되어 출력 특징 맵(520)의 제1-2 출력 데이터(y12)가 생성된다. Thereafter, a stride is performed by 1 from the first area 501 of the input feature map 500 to the second area 502, and a total of 9 input data (x 12 to x 34 ) included in the second area 502 is When an operation of multiplying with weight values (w 11 to w 33 ) of the filter 510 is performed, x 12 *w 11 , x 13 *w 12 , x 14 *w 13 , x 22 *w 21 , which are output values of the multiplication operation, x 23 *w 22 , x 24 *w 23 , x 32 *w 31 , x 33 *w 32 , x 34 *w 33 are cumulatively summed to obtain 1-2 output data (y 12 ) of the output feature map 520 is created

상기 설명한 실시예에서, 스트라이드의 크기가 1인 경우, 제1 영역(501)과 제2 영역(502) 사이에서 입력 특징 맵(500)의 데이터 중 중복되어 연산에 사용되는 데이터는 x12, x13, x22, x23, x32, x33을 포함하는 총 6개의 데이터이다. 즉, 제1 영역(501)에 관한 곱셈 및 덧셈 연산과 제2 영역(502)에 관한 곱셈 및 덧셈 연산이 순차적으로 계산되면서, 입력 특징 맵(500)의 데이터 중 x12, x13, x22, x23, x32, x33는 각각 두번씩 사용되게 된다. 여기서, '사용된다'는 의미는 프로세서 또는 칩 내부에서 입력 데이터(500)의 각 값을 클럭(clock)에 따라 순차적으로 판독(read)하는 것을 의미할 수 있다. 각 클럭에 따라 데이터의 값이 변경되는바, 프로세서 또는 칩 내부에서는 순차적인 각 클럭 마다 버스 데이터를 토글(toggle)해야 하므로, 처리량이 많고, 따라서 전력이 많이 소모될 수 있다. In the above-described embodiment, when the size of the stride is 1, among data of the input feature map 500 overlapping between the first area 501 and the second area 502, data used for calculation are x 12 , x It is a total of 6 data including 13 , x 22 , x 23 , x 32 , x 33 . That is, while multiplication and addition operations for the first area 501 and multiplication and addition operations for the second area 502 are sequentially calculated, x 12 , x 13 , x 22 of the data of the input feature map 500 , x 23 , x 32 , x 33 are each used twice. Here, the meaning of 'used' may mean that each value of the input data 500 is sequentially read according to a clock within a processor or chip. Since data values are changed according to each clock, bus data must be toggled for each sequential clock inside a processor or chip, so that a large amount of processing is required and thus, a large amount of power may be consumed.

도 5b는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트를 컨볼루션 연산하는 방법을 도식화한 도면이다.5B is a diagram illustrating a method of performing a convolution operation between data of an input feature map and weights of a filter using a systolic array according to an embodiment of the present disclosure.

도 5b를 참조하면, 입력 특징 맵(500)은 순차적인 클럭(clock)에 따라 데이터들이 시스톨릭 연산기(530)에 입력되는 시스톨릭 배열로 매핑될 수 있다. 일 실시예에서, 입력 특징 맵(500)의 데이터들은 클럭에 따라 동일한 값을 갖는 데이터가 두번씩 반복되어 시스톨릭 연산기(530) 내에 입력되도록 매핑될 수 있다. 예를 들어, 시스톨릭 배열로 매핑된 입력 특징 맵(500)의 제1 행에서 입력 데이터는 x11, x12, x12, x13, x13, x14,... , 순서로 시스톨릭 연산기(530)에 입력될 수 있다. 제1 행에서 입력 데이터 x12(500-1)는 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 제2 클럭에서 x12가 시스톨릭 연산기(530)에 입력되고, 제3 클럭에서도 x12가 시스톨릭 연산기(530)에 입력될 수 있다. 마찬가지로, 제1 행에서 입력 데이터 x13(500-2) 역시 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 제4 클럭에서 x13이 시스톨릭 연산기(530)에 입력되고, 제5 클럭에서도 x13이 시스톨릭 연산기(530)에 입력될 수 있다. Referring to FIG. 5B , the input feature map 500 may be mapped into a systolic arrangement in which data is input to the systolic operator 530 according to sequential clocks. In one embodiment, the data of the input feature map 500 may be mapped such that data having the same value are repeated twice and input into the systolic operator 530 according to a clock. For example, in the first row of the input feature map 500 mapped to a systolic array, the input data is x 11 , x 12 , x 12 , x 13 , x 13 , x 14 ,... , in order of systolic It can be input to the calculator 530. In the first row, the input data x 12 (500-1) may be repeated twice and then input to the systolic operator 530. For example, x 12 may be input to the systolic operator 530 at the second clock, and x 12 may be input to the systolic operator 530 at the third clock. Similarly, the input data x 13 (500-2) in the first row may also be repeated twice and input to the systolic operator 530. For example, x 13 may be input to the systolic operator 530 at the fourth clock, and x 13 may be input to the systolic operator 530 at the fifth clock.

시스톨릭 배열로 매핑된 입력 특징 맵(500)의 제2 행에서도 입력 데이터가 순차적인 클럭에 따라 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다. 예를 들어, 시스톨릭 배열의 제2 행에서 입력 특징 맵(500)의 데이터는 x13, x14, x14, x15, x15, x16, ... , 순서로 시스톨릭 연산기(530)에 입력될 수 있다. 제1 행과 마찬가지로, 제2 행에서도 입력 데이터 중 x14(500-3)는 두번씩 반복되어 시스톨릭 연산기(530)에 입력되고, x15(500-4)도 두번씩 반복되어 시스톨릭 연산기(530)에 입력될 수 있다.Also in the second row of the input feature map 500 mapped in the systolic array, the input data may be repeated twice according to the sequential clock and input to the systolic operator 530 . For example, the data of the input feature map 500 in the second row of the systolic array is x 13 , x 14 , x 14 , x 15 , x 15 , x 16 , ... , in order of the systolic operator 530 ) can be entered. Similar to the first row, in the second row, x 14 (500-3) of the input data is repeated twice and inputted to the systolic operator 530, and x 15 (500-4) is also repeated twice and inputted to the systolic operator 530. (530).

도 5b에 도시된 입력 특징 맵(500)의 각 데이터들은 순차적인 클럭에 따라 시스톨릭 연산기(530)에 입력되는 필터(510)와 곱셈 및 덧셈 연산될 수 있다. 필터(510)의 웨이트 값은 순차적인 클럭에 따라 두번씩 중복되어 시스톨릭 연산기(530)에 입력될 수 있다. Each data of the input feature map 500 shown in FIG. 5B may be multiplied and added with the filter 510 input to the systolic operator 530 according to sequential clocks. The weight value of the filter 510 may be input to the systolic operator 530 by overlapping twice according to sequential clocks.

도 5b에 도시된 실시예에서, 입력 특징 맵(500)은 동일한 값을 갖는 데이터가 두번씩 반복되어 시스톨릭 연산기(530)에 입력되도록 시스톨릭 배열로 매핑될 수 있다. 도 5b의 실시예에 따르면, 순차적인 클럭에 따라 시스톨릭 연산기(530)에 입력되는 데이터의 값이 두번씩 중복되는바, 종래 모든 클럭에 따라 시스톨릭 연산기(530)에 입력되는 데이터가 변경되는 경우에 비하여 버스 데이터(bus data)의 토글(toggle) 회수가 현저하게 줄어들 수 있다. 따라서, 시스톨릭 연산기(530)를 통해 곱셈 및 덧셈 연산을 수행하는 프로세서 또는 칩 내부의 전력 소모를 감소시킬 수 있다. In the embodiment shown in FIG. 5B , the input feature map 500 may be mapped in a systolic array such that data having the same value are repeated twice and input to the systolic operator 530 . According to the embodiment of FIG. 5B, values of data input to the systolic operator 530 are duplicated twice according to sequential clocks, so data input to the systolic operator 530 is changed according to all conventional clocks. Compared to the case, the number of toggles of bus data can be remarkably reduced. Accordingly, power consumption inside a processor or chip that performs multiplication and addition operations through the systolic calculator 530 can be reduced.

도 6은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 전자 장치(600)의 구성 요소를 도시한 블록도이다.6 is a block diagram illustrating components of an electronic device 600 that performs a convolution operation using a systolic array according to an embodiment of the present disclosure.

도 6을 참조하면, 전자 장치(600)는 프로세서(610)를 포함할 수 있다. 여기서, 전자 장치(600)는 컨볼루션 뉴럴 네트워크 기반의 딥 러닝 연산을 수행하는 컴퓨팅 장치 또는 모바일 장치일 수 있다. Referring to FIG. 6 , an electronic device 600 may include a processor 610 . Here, the electronic device 600 may be a computing device or a mobile device that performs a deep learning operation based on a convolutional neural network.

프로세서(610)는 곱셈 및 덧셈 연산을 수행하는 PE(Processing Element)를 포함할 수 있다. 프로세서(610)는 중앙 처리 장치(Central Processing Unit), 마이크로 프로세서(microprocessor) 및 그래픽 프로세서(Graphic Processing Unit) 중 적어도 하나로 구성될 수 있으나, 이에 제한되는 것은 아니다. 일 실시예에서, 전자 장치(600)가 스마트 폰, 태블릿 PC 등과 같은 모바일 디바이스인 경우, 프로세서(610)는 애플리케이션을 실행시키는 애플리케이션 프로세서(Application Processor, AP)일 수 있다. The processor 610 may include a processing element (PE) that performs multiplication and addition operations. The processor 610 may include at least one of a central processing unit, a microprocessor, and a graphic processing unit, but is not limited thereto. In one embodiment, when the electronic device 600 is a mobile device such as a smart phone or a tablet PC, the processor 610 may be an application processor (AP) that executes an application.

일 실시예에서, 프로세서(610)는 연산에 필요한 데이터를 읽어오고, 연산 결과를 다시 저장하기 위하여 메모리에 접근할 수 있다. 예를 들어, 프로세서(610)는 메모리로부터 데이터를 읽는 로드 명령어(Load Instruction) 및 메모리에 데이터를 저장하는 저장 명령어(Store Instruction)을 실행할 수 있다.In one embodiment, the processor 610 may access memory to read data required for calculation and to store the calculation result again. For example, the processor 610 may execute a load instruction for reading data from memory and a store instruction for storing data in memory.

프로세서(610)는 매퍼(611), 시스톨릭 연산기(612), 및 누산기(adder)(613)를 포함할 수 있다.The processor 610 may include a mapper 611 , a systolic operator 612 , and an adder 613 .

매퍼(611)는 입력 특징 맵의 데이터 또는 필터의 웨이트 값에 대하여, 순차적인 클럭에 따라 동일한 값을 갖는 데이터가 반복되어 시스톨릭 연산기(612)에 입력되도록 입력 특징 맵의 데이터 또는 필터의 웨이트 값의 입력 순서(sequence)를 변경하는 매핑(mapping)을 수행할 수 있다. 일 실시예에서, 매퍼(611)는 입력 특징 맵의 데이터가 필터의 크기(N)와 동일한 회수만큼 반복적으로 시스톨릭 연산기(611) 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 입력 순서(sequence)를 변경할 수 있다. 예를 들어, 필터의 크기가 3×3인 경우, 매퍼(611)는 곱셈 덧셈 연산기에 x11, x12, x13,..., 각각의 입력 데이터가 3번씩 반복하여 입력되도록 입력 특징 맵을 시스톨릭 배열로 매핑할 수 있다. 그러나, 이에 한정되는 것은 아니고, 매퍼(611)는 입력 특징 맵의 데이터를 2번씩 반복되어 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵을 매핑할 수 있다.The mapper 611 repeats data having the same value with respect to the data of the input feature map or the weight value of the filter according to sequential clocks and inputs the data of the input feature map or the weight value of the filter to the systolic operator 612. It is possible to perform mapping to change the input sequence of . In one embodiment, the mapper 611 performs an input order of data of the input feature map so that the data of the input feature map is repeatedly input to the multiplication-add operator in the systolic operator 611 the same number of times as the size (N) of the filter ( sequence) can be changed. For example, if the size of the filter is 3 × 3, the mapper 611 generates an input feature map so that each input data x 11 , x 12 , x 13 , ..., is repeatedly input to the multiplication-add operator three times. can be mapped to a systolic array. However, the mapper 611 is not limited thereto, and the mapper 611 may map the input feature map so that the data of the input feature map is repeated twice and input to the multiplication operator.

시스톨릭 연산기(612)는 복수의 곱셈 덧셈 연산기(Processing Elements)를 포함할 수 있다. 복수의 곱셈 덧셈 연산기 각각은 플립-플롭 회로(flip-flop)로 구성될 수 있다. 복수의 곱셈 덧셈 연산기 각각은 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 입력되는 입력 데이터와 필터의 웨이트 값을 각각 곱하고, 곱해진 값을 더하는 연산을 수행할 수 있다. The systolic operator 612 may include a plurality of multiplication and addition operators (Processing Elements). Each of the plurality of multiplication and addition operators may be configured as a flip-flop circuit. Each of the plurality of multiplication and addition operators may perform an operation of multiplying input data and a weight value of a filter according to sequential clocks having a constant latency and adding the multiplied values.

누산기(adder)(613)는 입력 특징 맵의 데이터와 필터의 웨이트 값을 곱하여 얻어진 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성할 수 있다. 누산기(613)는 필터가 입력 특징 맵 상에서 스트라이드(stride) 됨에 따라 변경되는 입력 특징 맵의 데이터와 필터의 웨이트 값의 조합에 기초하여 시스톨릭 배열 연산기(612)의 복수의 곱셈 덧셈 연산기 각각에 의해 계산된 출력 값을 선택할 수 있다. 누산기(613)는 선택한 출력 값들을 누적 합산하여 출력 특징 맵을 생성할 수 있다. The accumulator 613 may generate an output feature map by accumulating and summing output values obtained by multiplying the data of the input feature map by the weight value of the filter. The accumulator 613 calculates the value of the multiplication-add operator of the systolic array operator 612 based on a combination of the weight value of the filter and the data of the input feature map, which is changed as the filter strides on the input feature map. You can select the calculated output value. The accumulator 613 may generate an output feature map by cumulatively summing the selected output values.

도 7a 및 도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵의 데이터의 입력 순서를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면들이다.7A and 7B are diagrams illustrating a method of changing the input order of input feature map data and mapping them into a systolic arrangement according to an embodiment of the present disclosure.

도 7a를 참조하면, 입력 특징 맵(700)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑될 수 있다. 입력 특징 맵(700)은 0값을 갖는 데이터가 포함될 수 있다. 예를 들어, 입력 특징 맵(700)이 딥 러닝을 통한 학습의 대상이 되는 이미지인 경우, 검은 색의 픽셀은 픽셀 값이 0일 수 있다. 도 7a에 도시된 실시예에서, 입력 특징 맵(700)의 데이터 중 x22 및 x33은 픽셀 값이 0일 수 있다. Referring to FIG. 7A , data of the input feature map 700 may be mapped into a systolic arrangement in which data is input according to sequential clocks. The input feature map 700 may include data having a value of 0. For example, when the input feature map 700 is an image to be learned through deep learning, a pixel value of a black pixel may be 0. In the example shown in FIG. 7A , pixel values of x 22 and x 33 of the data of the input feature map 700 may be 0.

입력 특징 맵(700)의 데이터 중 픽셀 값이 0인 경우, 필터의 웨이트와 곱하는 연산을 수행하더라도, 출력 값이 0이기 때문에 연산을 수행할 필요가 없다. 따라서, 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터를 식별하고, 식별된 0 데이터의 위치를 참조하여 곱셈 및 덧셈 연산을 수행하지 않는 방식을 제로 스킵핑(zero-skipping)이라고 한다.If a pixel value of the data of the input feature map 700 is 0, even if a multiplication operation is performed with the weight of the filter, there is no need to perform the operation because the output value is 0. Therefore, a method of identifying data having a value of 0 among the data of the input feature map 700 and not performing multiplication and addition operations with reference to the position of the identified 0 data is called zero-skipping.

도 7a에 도시된 실시예에서는, 제3 클럭에서 0값을 갖는 x22가 시스톨릭 배열 연산기(710) 내의 곱셈 덧셈 연산기에 입력되고, 제5 클럭에서 0값을 갖는 x22가 곱셈 덧셈 연산기에 입력될 수 있다. 마찬가지로, 제7 클럭 및 제9 클럭에서 0값을 갖는 x33이 시스톨릭 배열 연산기(710) 내의 곱셈 덧셈 연산기에 입력될 수 있다. 시스톨릭 배열로 매핑된 입력 특징 맵(700)의 제1 행(①)에서 제4 클럭에서는 0이 아닌 값을 갖는 x12가 입력되지만, 제5 클럭에서는 0값을 갖는 x22가 시스톨릭 배열 연산기(710)에 입력된다. 이후, 제1 행(①)에서 제6 클럭에 따라 다시 0이 아닌 값을 갖는 x32가 시스톨릭 배열 연산기(710)에 입력될 수 있다. 제2 행(②)에서도 순차적인 클럭에 따라 0값을 갖는 데이터 x22 및 x33가 0이 아닌 값을 갖는 데이터들과 교대로 시스톨릭 배열 연산기에 입력된다. In the embodiment shown in FIG. 7A, x 22 having a value of 0 at the third clock is input to the multiplication-adding operator in the systolic array operator 710, and x 22 having a value of 0 at the 5th clock is input to the multiplication-adding operator can be entered. Similarly, x 33 having a value of 0 at the seventh and ninth clocks may be input to the multiplication and addition operator in the systolic array operator 710 . In the first row (①) of the input feature map 700 mapped in a systolic array, x 12 having a value other than 0 is input at the fourth clock, but x 22 having a value 0 at the fifth clock is a systolic array It is input to the calculator 710. Thereafter, x 32 having a value other than 0 may be input to the systolic array calculator 710 according to the sixth clock in the first row ①. In the second row (②), data x 22 and x 33 having a value of 0 are alternately inputted to the systolic array calculator along with data having a value other than 0 according to sequential clocks.

순차적인 클럭에 따라 0값을 갖는 데이터, 0이 아닌 값을 갖는 데이터가 교대로 입력되는 경우, 모든 클럭에 대하여 버스 데이터(bus data)의 토글(toggle)이 일어나게 되어 프로세서 또는 칩이 메모리에 액세스하는 양이 늘어나고, 따라서 전력 소모량이 많아질 수 있다. When data having a value of 0 and data having a value other than 0 are input alternately according to sequential clocks, a toggle of bus data occurs with respect to all clocks, allowing the processor or chip to access the memory. This increases the amount of power, and thus power consumption may increase.

도 7b는 본 개시의 일 실시예에 따라 입력 특징 맵(700)의 데이터의 입력 순서(sequence)를 변경하여 시스톨릭 배열로 매핑하는 방법을 도식화한 도면이다.7B is a diagram illustrating a method of changing an input sequence of data of an input feature map 700 and mapping them into a systolic arrangement according to an embodiment of the present disclosure.

도 7b를 참조하면, 입력 특징 맵(700)의 데이터들은 순차적인 클럭(clock)에 따라 데이터들이 입력되는 시스톨릭 배열로 매핑되고, 입력 특징 맵(700)의 동일한 값을 갖는 데이터가 반복되어 시스톨릭 배열 연산기(710) 내의 각 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵(700)의 데이터의 순서를 변경될 수 있다. 또한, 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터(x22 및 x33)는 반복적으로 시스톨릭 연산기(710)에 입력되도록 그룹핑(grouping)할 수 있다. 예를 들어, 0값을 갖는 데이터인 x22는 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기(710)에 입력되도록 제1 그룹(701)으로 그룹핑될 수 있다. 마찬가지로, 0값을 갖는 데이터인 x33도 x22가 반복된 회수와 동일한 회수만큼 반복되어 시스톨릭 배열 연산기(710)에 입력되도록 제2 그룹(702)으로 그룹핑될 수 있다.Referring to FIG. 7B, data of the input feature map 700 is mapped into a systolic array in which data is input according to sequential clocks, and data having the same value of the input feature map 700 is repeated to obtain a systolic array. The order of data of the input feature map 700 may be changed to be input to each multiplication and addition operator in the Tolik array operator 710. In addition, data (x 22 and x 33 ) having a value of 0 among data of the input feature map 700 may be grouped so as to be repeatedly input to the systolic operator 710 . For example, data x 22 having a value of 0 may be grouped into a first group 701 to be repeated a predetermined number of times and input to the systolic array operator 710 . Likewise, data x 33 having a value of 0 may be grouped into a second group 702 such that it is repeated the same number of times as the number of repetitions of x 22 and then input to the systolic array operator 710 .

일 실시예에서, 0값을 갖는 데이터가 반복되는 회수는 필터의 크기에 의해서 결정될 수 있다. 예를 들어, 필터의 크기가 n×n인 경우, 0값을 n번 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑될 수 있다. 도 7b에 도시된 실시예에서, 필터는 3×3의 크기를 갖는바, 0값을 갖는 데이터 x22, x33이 총 3번 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑될 수 있다.In one embodiment, the number of repetitions of data having a value of 0 may be determined by the size of the filter. For example, when the size of the filter is n×n, a value of 0 may be repeated n times and mapped to be input to the systolic operator 710. In the embodiment shown in FIG. 7B, since the filter has a size of 3×3, data x 22 and x 33 having a value of 0 may be repeated three times and mapped to be input to the systolic operator 710.

도 7a를 참조하면, 종래의 시스톨릭 배열을 이용한 컨볼루션 연산 방법은 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터가 산발적으로 흩어져 있어서, 입력 데이터에 대한 메모리 출력에서 컨볼루션 연산에 관한 누적 합산을 조합하는 것이 복잡한 구조로 되어 있었다. 그러나, 본 개시의 도 7b에 도시된 실시예에 따른 컨볼루션 연산 방법은 입력 특징 맵(700)의 데이터 중 0값을 갖는 데이터(x22, x33)가 소정의 회수만큼 반복되어 시스톨릭 연산기(710)에 입력되도록 매핑되는바, 한번에 적어도 두개 이상 복수개의 입력 데이터의 곱셈 및 덧셈 연산을 생략(skip)할 수 있어, 메모리 액세스 및 프로세서의 전력 소모를 감소시킬 수 있다. 0값을 갖는 입력 데이터의 그룹핑으로 인한 메모리 액세스의 감소 방법은 도 9a, b, 도 10a, b에서 상세하게 설명하기로 한다. Referring to FIG. 7A, in the conventional convolution operation method using a systolic array, data having a value of 0 among the data of the input feature map 700 are sporadically scattered, and thus, the memory output for the input data relates to the convolution operation. Combining the cumulative summation was a complex structure. However, in the convolution operation method according to the embodiment shown in FIG. 7B of the present disclosure, data (x 22 , x 33 ) having a value of 0 among the data of the input feature map 700 are repeated a predetermined number of times to obtain a systolic operator. 710, it is possible to skip multiplication and addition operations of at least two or more input data at a time, thereby reducing memory access and power consumption of the processor. A method of reducing memory access due to grouping of input data having a value of 0 will be described in detail with reference to FIGS. 9A and 10A and 10B.

도 8은 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 전자 장치(800)의 구성 요소를 도시한 블록도이다. 도 8에 도시된 시스톨릭 연산기(812), 및 누산기(813)는 도 6에 도시된 시스톨릭 연산기(612), 및 누산기(613) 각각과 동일한 기능 및 동작을 수행하는 구성 요소인바, 중복되는 설명은 생략한다.8 is a block diagram illustrating components of an electronic device 800 that performs a convolution operation using a systolic array according to an embodiment of the present disclosure. The systolic operator 812 and accumulator 813 shown in FIG. 8 are components that perform the same functions and operations as the systolic operator 612 and accumulator 613 shown in FIG. 6, respectively. omit explanation.

도 8을 참조하면, 전자 장치(800)는 프로세서(810) 및 언매퍼(820)를 포함할 수 있다. 일 실시예에서, 프로세서(810)는 곱셈 및 덧셈 연산을 수행하는 PE (Processing Elements)를 포함하는 중앙 처리 장치(CPU), 마이크로 프로세서(microprocessor), 그래픽 프로세서(Graphic Processing Unit), 및 애플리케이션 프로세서(AP) 중 적어도 하나로 구성될 수 있으나, 이에 제한되는 것은 아니다. Referring to FIG. 8 , an electronic device 800 may include a processor 810 and an unmapper 820. In one embodiment, the processor 810 includes a central processing unit (CPU) including Processing Elements (PEs) that perform multiplication and addition operations, a microprocessor, a graphics processing unit (Graphic Processing Unit), and an application processor ( AP), but is not limited thereto.

매퍼(811)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. 매퍼(811)는 또한, 식별된 0값을 갖는 데이터가 반복적으로 시스톨릭 연산기(812)에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)할 수 있다. The mapper 811 may identify data having a value of 0 among data of the input feature map. The mapper 811 may also group data having a value of 0 so that the identified data having a value of 0 is repeatedly input to the systolic operator 812 .

매퍼(811)는 식별된 0값을 갖는 데이터가 소정의 회수만큼 시스톨릭 연산기(812)에 입력되도록 0값의 입력 순서(sequence)를 변경할 수 있다. 상기 소정의 회수는 필터의 크기에 의해 결정될 수 있다. 일 실시예에서, 매퍼(811)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터가 필터의 크기(N)와 동일한 회수만큼 반복적으로 시스톨릭 연산기(812)에 입력되도록 입력 특징 맵의 데이터를 매핑할 수 있다. 예를 들어, 필터의 크기가 3×3인 경우, 매퍼(811)는 곱셈 덧셈 연산기에 0값을 갖는 데이터가 3번씩 반복하여 입력되도록 입력 특징 맵을 시스톨릭 배열로 매핑할 수 있다. The mapper 811 may change the input sequence of the 0 value so that data having the identified 0 value is input to the systolic operator 812 a predetermined number of times. The predetermined number of times may be determined by the size of the filter. In one embodiment, the mapper 811 maps the data of the input feature map such that data having a value of 0 among the data of the input feature map are repeatedly input to the systolic operator 812 as many times as the size (N) of the filter. can do. For example, if the size of the filter is 3×3, the mapper 811 may map the input feature map into a systolic array so that data having a value of 0 is repeatedly input to the multiplication operator three times.

시스톨릭 연산기(812)는 복수의 곱셈 덧셈 연산기(Processing Elements)를 포함할 수 있다. 시스톨릭 연산기(812) 내에 포함되는 복수의 곱셈 덧셈 연산기 각각은 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 입력되는 입력 데이터와 필터의 웨이트 값을 각각 곱하고, 곱해진 값을 더하는 연산을 수행할 수 있다. 시스톨릭 연산기(812)는 0값을 갖는 데이터가 입력되는 경우 곱셈 및 덧셈 연산을 생략(skip)할 수 있다.The systolic operator 812 may include a plurality of multiplication and addition operators (Processing Elements). Each of the plurality of multiplication and addition operators included in the systolic operator 812 multiplies the input data and the weight value of the filter according to sequential clocks having a constant latency, and performs an operation of adding the multiplied values. can The systolic operator 812 may skip multiplication and addition operations when data having a value of 0 is input.

누산기(adder)(813)는 입력 특징 맵의 데이터와 필터의 웨이트 값을 곱하여 얻어진 출력 값들을 누적 합산(accumulation)하여 출력 특징 맵을 생성할 수 있다. 누산기(813)는 언매퍼(820)의 누산기 제어부(822)의 제어를 받아, 입력 데이터 중 0값을 갖는 데이터의 위치 정보(address)를 수신하고, 이를 참조하여 출력 값을 선택적으로 누적 합산할 수 있다. An adder 813 may generate an output feature map by accumulating and summing output values obtained by multiplying the data of the input feature map by the weight value of the filter. The accumulator 813 is controlled by the accumulator control unit 822 of the unmapper 820 to receive location information (address) of data having a value of 0 among input data, and selectively accumulate and add output values by referring to this. can

언매퍼(820)는 매퍼(811)에 의해 매핑된 입력 특징 맵의 데이터 각각의 위치 정보를 저장하고, 위치 정보를 기초로 입력 특징 맵의 데이터들을 매핑 전의 배열로 언매핑(unmapping)할 수 있다. 매퍼(811)와 언매퍼(820)의 관계는 인코더(encoder)와 디코더(decoder)의 관계와 유사하다. 매퍼(811)는 입력 특징 맵의 데이터들이 시스톨릭 연산기(812)에 기설정된 회수만큼 반복되어 입력되도록 입력 순서(sequence)를 변경하는 매핑을 수행하고, 언매퍼(820)는 매핑된 입력 특징 맵을 매핑 전의 배열로 다시 복구하는 동작을 수행한다. The unmapper 820 may store location information of each data of the input feature map mapped by the mapper 811, and may unmap the data of the input feature map into an array before mapping based on the location information. . The relationship between the mapper 811 and the unmapper 820 is similar to that between an encoder and a decoder. The mapper 811 performs mapping to change the input sequence so that data of the input feature map are repeatedly input to the systolic operator 812 a predetermined number of times, and the unmapper 820 performs mapping of the mapped input feature map. Performs the operation of restoring back to the array before mapping.

언매퍼(820)는 메모리(821) 및 누산기 제어부(822)를 포함할 수 있다. The unmapper 820 may include a memory 821 and an accumulator controller 822 .

메모리(821)는 입력 특징 맵의 데이터 중 매퍼(811)에 의해 식별된 0값을 갖는 데이터들의 위치 정보를 저장하는 LUT(Look-Up table)를 저장할 수 있다. 메모리(821)는 예를 들어, DRAM(Dynamic RAM), SRAM(Static RAM), 및 SDRAM(Synchronous Dynamic RAM) 등) 중 적어도 하나로 구성될 수 있으나, 이에 한정되지 않는다. 일 실시예에서, 메모리(821)는 입력 데이터와 필터의 웨이트 값들의 곱셈 및 덧셈 연산으로 인한 출력 값들 중 필터의 크기(n×n) 내에서 누적 합산하여야 하는 데이터의 위치에 관한 정보를 저장할 수 있다. 즉, 메모리(821)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터의 로(Row) 및 컬럼(Column) 단위의 위치 정보를 저장할 수 있다. The memory 821 may store a look-up table (LUT) for storing location information of data having a value of 0 identified by the mapper 811 among data of the input feature map. The memory 821 may include at least one of, for example, dynamic RAM (DRAM), static RAM (SRAM), and synchronous dynamic RAM (SDRAM), but is not limited thereto. In one embodiment, the memory 821 may store information about the position of data to be accumulated and summed within the size (n × n) of the filter among output values resulting from multiplication and addition operations of input data and weight values of the filter. there is. That is, the memory 821 may store position information in row and column units of data having a value of 0 among data of the input feature map.

누산기 제어부(adder-tree controller)(822)는 입력 특징 맵의 데이터 중 0값을 갖는 데이터의 위치 정보를 참조하여, 출력 값들을 누적 합산함으로써 출력 특징 맵을 생성하도록 누산기(813)를 제어할 수 있다. 일 실시예에서, 누산기 제어부(822)는 메모리(821)에 저장된 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 로(Row) 및 컬럼(Column) 단위의 위치 정보를 판독(read)하여 제로 스킵(zero-skip)된 개수 정보를 참조할 수 있다. An adder-tree controller 822 may control the accumulator 813 to generate an output feature map by accumulating and summing output values with reference to location information of data having a value of 0 among data of the input feature map. there is. In one embodiment, the accumulator control unit 822 reads position information in units of rows and columns of data identified as 0 among the data of the input feature map stored in the memory 821 to obtain zero Information on the number of zero-skips may be referred to.

다른 실시예에서, 누산기 제어부(822)는 시스톨릭 연산기(812)에 입력되는 입력 특징 맵 데이터 중 0값을 갖는 데이터가 몇 사이클(cycle) 이후에 연산되는지에 관한 정보를 실시간으로 매퍼(811)로부터 수신하고, 수신된 정보를 참조하여 출력 값들을 누적 합산하도록 누산기(813)를 제어할 수 있다. 이는, 시스톨릭 배열(Systolic Array)을 이용한 컨볼루션 연산에서 0값을 갖는 데이터의 연산을 생략(skip)하는 경우, 0값 데이터가 스킵된 회수 만큼 출력 값이 상위로 시프트(shift)된다는 점에 착안한 것이다. 즉, 누산기 제어부(822)는 0값을 갖는 데이터가 곱셈 및 덧셈 연산에서 생략(skip)된 회수에 따른 출력 값들의 시프트(shift) 정보를 참조하여, 출력 값들을 누적 합산하고, 이를 통해 출력 특징 맵을 생성할 수 있다. In another embodiment, the accumulator control unit 822 transfers information on how many cycles after which data having a value of 0 among the input feature map data input to the systolic operator 812 is calculated to the mapper 811 in real time. The accumulator 813 may be received from , and the accumulator 813 may be controlled to accumulate and add output values with reference to the received information. This is due to the fact that when the operation of data having a 0 value is skipped in a convolution operation using a systolic array, the output value is shifted to the top by the number of times the 0 value data is skipped. it is based on That is, the accumulator control unit 822 refers to shift information of output values according to the number of times that data having a value of 0 is skipped in multiplication and addition operations, accumulates and sums the output values, and through this, output characteristics You can create maps.

도 9a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼(buffer)에 저장된 데이터를 도식화한 도면이고, 도 9b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.9A is a diagram illustrating data stored in a buffer of a memory, which is a component of a device according to an embodiment of the present disclosure, and FIG. 9B is a diagram illustrating convolution using a systolic array according to an embodiment of the present disclosure. It is a flow diagram showing how to perform the operation.

도 9a에서 메모리(900)에 총 4개의 버퍼(901 내지 904)가 있다고 가정하면, 제1 버퍼(901), 제3 버퍼(903), 및 제4 버퍼(904)에는 0이 아닌 입력 데이터가 저장되고, 제2 버퍼(902)에는 0값을 갖는 데이터가 저장될 수 있다. Assuming that there are a total of four buffers 901 to 904 in the memory 900 in FIG. 9A , non-zero input data is stored in the first buffer 901, the third buffer 903, and the fourth buffer 904. and data having a value of 0 may be stored in the second buffer 902 .

본 개시의 일 실시예에서, 0값을 갖는 데이터는 메모리(900)의 버퍼에 저장하지 않을 수 있다. 도 9a에 도시된 실시예에서, 0값을 갖는 데이터를 메모리(900)에 저장하지 않는다면, 종래 제3 버퍼(903)에 저장되었던 입력 데이터인 x32와 제4 버퍼(904)에 저장되었던 입력 데이터인 x33은 각각 제2 버퍼(902) 및 제3 버퍼(903)로 시프트(shift)되어 저장될 수 있다. In one embodiment of the present disclosure, data having a value of 0 may not be stored in a buffer of the memory 900 . In the embodiment shown in FIG. 9A, if data having a value of 0 is not stored in the memory 900, input data x 32 stored in the conventional third buffer 903 and input stored in the fourth buffer 904 Data x 33 may be shifted to the second buffer 902 and the third buffer 903 and stored.

도 9b를 참조하면, 단계 S910에서, 전자 장치는 입력 특징 맵의 데이터 중 0값(zero)을 갖는 데이터를 식별한다. 일 실시예에서, 프로세서 내의 매퍼는 시스톨릭 배열 연산기에 입력되는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. Referring to FIG. 9B , in step S910, the electronic device identifies data having a value of 0 (zero) among the data of the input feature map. In one embodiment, the mapper in the processor may identify data having a value of 0 among data of an input feature map input to the systolic array operator.

단계 S920에서, 전자 장치는 0값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)한다. 일 실시예에서, 매퍼는 일정한 레이턴시(latency)를 갖는 순차적인 클럭에 따라 0값을 갖는 입력 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록, 입력 특징 맵 내에서 식별된 0값을 갖는 데이터들끼리 그룹핑할 수 있다. In step S920, the electronic device groups data having a value of 0 so that the data having a value of 0 is repeatedly input to the systolic array calculator. In one embodiment, the mapper allows data having a value of 0 identified in the input feature map to be inputted repeatedly to a systolic array operator according to sequential clocks having a constant latency. can be grouped.

단계 S930에서, 전자 장치는 0값을 갖는 데이터의 로(row) 및 컬럼(column) 위치를 메모리에 저장한다. 일 실시예에서, 전자 장치는 입력 특징 맵 상에서 식별된 0값을 갖는 데이터의 로 및 컬럼 위치 정보를 저장하는 메모리를 포함할 수 있다. 일 실시예에서, 메모리는 0값을 갖는 입력 데이터의 로 및 컬럼 위치를 룩 업 테이블(LUT) 형태로 저장할 수 있다. 이때, 메모리는 0값을 갖는 입력 데이터를 버퍼에 저장하지 않을 수 있다. In step S930, the electronic device stores row and column positions of data having a value of 0 in a memory. In one embodiment, the electronic device may include a memory that stores row and column position information of data having a value of 0 identified on the input feature map. In one embodiment, the memory may store row and column positions of input data having a value of 0 in the form of a look-up table (LUT). At this time, the memory may not store input data having a value of 0 in the buffer.

단계 S940에서, 전자 장치는 저장된 위치 정보를 메모리로부터 판독(read)하고, 판독한 위치 정보를 참조하여 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)한다. In step S940, the electronic device reads the stored location information from the memory, and skips multiplication and addition operations for data having a value of 0 by referring to the read location information.

도 9a 및 도 9b에 도시된 실시예는, 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 메모리(900)의 버퍼 내에 저장하지 않고, 컨볼루션 연산 시 0값 데이터의 로(row) 및 컬럼(column) 위치 정보를 참조하게 함으로써, 메모리의 저장 공간 확보를 더 많이 확보할 수 있다. 또한, 메모리 액세스를 줄임으로써, 전자 장치 내의 프로세서 또는 칩에서 소모되는 전력량을 감소시킬 수 있다. In the embodiments shown in FIGS. 9A and 9B , data having a value of 0 among the data of the input feature map is not stored in the buffer of the memory 900, and row and column of the value 0 data are generated during convolution operation. column) location information, it is possible to secure more memory storage space. In addition, by reducing memory access, the amount of power consumed by a processor or chip in an electronic device may be reduced.

도 10a는 본 개시의 일 실시예에 따른 장치의 구성 요소인 메모리의 버퍼에 저장된 데이터를 도식화한 도면이고, 도 10b는 본 개시의 일 실시예에 따라 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 방법을 나타내는 흐름도이다.10A is a diagram illustrating data stored in a buffer of a memory, which is a component of a device according to an embodiment of the present disclosure, and FIG. 10B performs a convolution operation using a systolic array according to an embodiment of the present disclosure. Here is a flow chart showing how to do it.

도 10a를 참조하면, 메모리(1000)의 총 4개의 버퍼(1001 내지 1004) 중 제1 버퍼(1001) 내지 제3 버퍼(1003)에는 0값을 갖는 데이터가 저장되고, 제4 버퍼(1004)에는 0값을 갖는 데이터인 x33이 저장될 수 있다. 도 9a에 도시된 실시예와는 달리, 도 10a에 도시된 실시예는 0값을 갖는 데이터도 메모리(1000)의 버퍼에 저장된다. 그러나, 0값 데이터가 메모리(1000)에 저장되더라도 곱셈 및 덧셈 연산을 수행하는 경우 0값 데이터의 위치 정보를 통해 연산이 생략(skip)될 수 있다. 이에 대해서는 도 10b의 흐름도를 참조하여 설명한다.Referring to FIG. 10A , among the four buffers 1001 to 1004 of the memory 1000, data having a value of 0 is stored in the first buffer 1001 to the third buffer 1003, and the fourth buffer 1004 In , data having a value of 0, x 33 , may be stored. Unlike the embodiment shown in FIG. 9A , in the embodiment shown in FIG. 10A , data having a value of 0 is also stored in the buffer of the memory 1000 . However, even if 0-value data is stored in the memory 1000, when multiplication and addition operations are performed, the operation may be skipped through location information of the 0-value data. This will be described with reference to the flowchart of FIG. 10B.

도 10b를 참조하면, 단계 S1010에서, 전자 장치는 입력 특징 맵의 데이터 중 0값(zero)을 갖는 데이터를 식별한다. 일 실시예에서, 프로세서 내의 매퍼는 시스톨릭 배열 연산기에 입력되는 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별할 수 있다. Referring to FIG. 10B , in step S1010, the electronic device identifies data having a value of 0 (zero) among the data of the input feature map. In one embodiment, the mapper in the processor may identify data having a value of 0 among data of an input feature map input to the systolic array operator.

단계 S1020에서, 전자 장치는 0값을 갖는 데이터가 반복적으로 시스톨릭 배열 연산기에 입력되도록 0값을 갖는 데이터끼리 그룹핑(grouping)한다. In step S1020, the electronic device groups data having a value of 0 so that the data having a value of 0 is repeatedly input to the systolic array operator.

단계 S1030에서, 전자 장치는 0값 데이터가 입력됨에 따라, 시스톨릭 배열 상에서의 0값 데이터의 위치 정보를 획득한다. 일 실시예에서, 전자 장치에 포함되는 구성 요소인 언매퍼(도 8의 820 참조)는 시스톨릭 연산기에 입력되는 입력 특징 맵 데이터 중 0값 데이터가 몇 사이클(cycle) 이후에 연산되는지에 관한 정보를 실시간으로 매퍼(도 8의 811 참조)로부터 수신하고, 수신된 정보를 참조하여 출력 값들을 누적 합산하도록 누산기(도 8의 813 참조)를 제어할 수 있다. 언매퍼는 시스톨릭 연산기에 0값 데이터가 입력되는 경우 시스톨릭 배열 상에서 0값을 갖는 데이터의 위치 정보를 매퍼로부터 실시간으로 수신할 수 있다. In step S1030, the electronic device acquires location information of the 0-value data on the systolic array as the 0-value data is input. In one embodiment, the unmapper (see 820 in FIG. 8 ), which is a component included in the electronic device, is information about how many cycles after which zero-value data among input feature map data input to the systolic operator is calculated. may be received from the mapper (see 811 of FIG. 8 ) in real time, and the accumulator (see 813 of FIG. 8 ) may be controlled to accumulate and add output values with reference to the received information. When 0-value data is input to the systolic operator, the unmapper may receive location information of data having a 0 value on the systolic array in real time from the mapper.

단계 S1040에서, 전자 장치는 0값 데이터의 위치 정보에 기초하여 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하는 누산기(adder-tree)를 제어한다. 일 실시예에서, 전자 장치는 시스톨릭 배열로 매핑된 입력 특징 맵에서 식별된 0값 데이터의 위치 정보를 매퍼(도 8의 811)로부터 실시간으로 획득하고, 획득된 0값 데이터의 위치 정보에 기초하여 시스톨릭 연산기에 의해 곱셈 및 덧셈 연산된 출력 값들을 선택적으로 누적 합산하도록 누산기(도 8의 813 참조)를 제어하는 누산기 제어부(도 8의 822)를 포함할 수 있다. In step S1040, the electronic device controls an adder-tree that accumulates and sums output values for each region of the input feature map based on location information of the 0-value data. In one embodiment, the electronic device acquires location information of the 0-value data identified in the input feature map mapped in a systolic array in real time from the mapper (811 in FIG. 8 ), and based on the location information of the obtained 0-value data and an accumulator controller ( 822 of FIG. 8 ) that controls the accumulator (see 813 of FIG. 8 ) to selectively accumulate and add output values multiplied and added by the systolic operator.

도 10a 및 도 10b에 도시된 실시예는, 시스톨릭 배열(Systolic Array)을 이용한 컨볼루션 연산에서 0값을 갖는 데이터의 연산을 생략(skip)하는 방법과 관련된 것으로서, 0값 데이터가 스킵된 회수만큼 출력 값이 상위로 시프트(shift)되는 것에 착안한 방법이다. 즉, 0값 데이터가 버퍼(도 10a의 1001 내지 1003 참조)에 저장되어 있더라도 전자 장치 내의 프로세서가 메모리(1000) 내의 0값 데이터가 저장된 버퍼(1001 내지 1003)를 판독(read)하지 않는바, 곱셈 및 덧셈 연산으로 인한 컨볼루션 연산 값이 변경되게 된다. 본 개시의 실시예는, 0값 데이터로 인하여 출력 값이 변경되지 않게 하기 위하여, 시스톨릭 연산기를 통한 곱셈 및 덧셈 연산에서 0값 데이터가 입력됨에 따라 실시간으로 입력된 0값 데이터의 위치 정보를 획득하고, 획득한 0값 데이터의 위치 정보에 기초하여 출력 값을 누적 합산한다. 또한, 메모리(1000)의 버퍼(1001 내지 1003)에 0값 데이터가 저장되더라도 프로세서가 0값 데이터를 액세스하지 않는바, 메모리 액세스로 인한 전력 소모량을 줄일 수 있다. The embodiments shown in FIGS. 10A and 10B relate to a method for skipping the operation of data having a 0 value in a convolution operation using a systolic array, and the number of times 0 value data is skipped. It is a method that focuses on shifting the output value to the upper level as much as possible. That is, even if 0-value data is stored in the buffer (see 1001 to 1003 in FIG. 10A), the processor in the electronic device does not read the buffers 1001 to 1003 in which the 0-value data is stored in the memory 1000. Convolution operation values due to multiplication and addition operations are changed. In an embodiment of the present disclosure, in order to prevent an output value from being changed due to 0-value data, as 0-value data is input in multiplication and addition operations through a systolic operator, location information of input 0-value data is obtained in real time And, based on the location information of the obtained zero-value data, the output values are cumulatively summed. In addition, even if 0-value data is stored in the buffers 1001 to 1003 of the memory 1000, since the processor does not access the 0-value data, power consumption due to memory access can be reduced.

도 11a는 본 개시의 일 실시예에 따른 시스톨릭 배열을 이용하여 컨볼루션 연산을 수행하는 연산 회로를 도식화한 도면이고, 도 11b는 입력 특징 맵과 필터의 컨볼루션 연산에 따라 생성된 출력 특징 맵을 도식화한 도면이다.FIG. 11A is a diagram illustrating an arithmetic circuit that performs a convolution operation using a systolic array according to an embodiment of the present disclosure, and FIG. 11B is an output feature map generated according to a convolution operation between an input feature map and a filter. It is a schematic drawing of

도 11a를 참조하면, 시스톨릭 연산기(1110)는 다섯 개의 플립-플롭 회로(flip-flop)(1110-1 내지 1110-5), 곱셈 연산기(1120), 두개의 덧셈 연산기(1130-1, 1130-2), 및 두개의 클럭 게이트(clock gate) 회로(1140-1, 1140-2)를 포함할 수 있다. 다만, 이는 예시적인 것이고, 시스톨릭 연산기(1110)에 포함되는 플립-플롭 회로(1110-1 내지 1110-5), 덧셈 연산기(1130-1, 1130-2), 및 클럭 게이트 회로(1140-1, 1140-2)의 개수가 도 11a에 도시된 바로 한정되는 것은 아니다.Referring to FIG. 11A, the systolic operator 1110 includes five flip-flop circuits 1110-1 to 1110-5, a multiplication operator 1120, and two addition operators 1130-1 and 1130. -2), and two clock gate circuits 1140-1 and 1140-2. However, this is exemplary, and the flip-flop circuits 1110-1 to 1110-5 included in the systolic operator 1110, the addition operators 1130-1 and 1130-2, and the clock gate circuit 1140-1 , 1140-2) is not limited to that shown in FIG. 11A.

제1 클럭 게이트 회로(1140-1) 및 제2 클럭 게이트 회로(1140-2)에서는 일정한 레이턴시(latency)를 갖는 순차적인 클럭(clock)을 생성할 수 있다. 순차적인 클럭에 따라 제1 플립 플롭 회로(1110-1)에는 필터의 웨이트 값이 입력되고, 제2 플립 플롭 회로(1110-2)에는 입력 특징 맵의 데이터가 입력될 수 있다. 일 실시예에서, 필터의 웨이트 값은 순차적인 클럭에 따라 두번씩 반복되어 제1 플립 플롭 회로(1110-1)에 입력될 수 있다. 또한, 입력 특징 맵의 데이터는 순차적인 클럭에 따라 두번씩 반복되어 제2 플립 플롭 회로(1110-2)에 입력되도록 시스톨릭 배열로 매핑될 수 있다. The first clock gate circuit 1140-1 and the second clock gate circuit 1140-2 may generate sequential clocks with a constant latency. According to sequential clocks, the weight value of the filter may be input to the first flip-flop circuit 1110-1, and the data of the input feature map may be input to the second flip-flop circuit 1110-2. In one embodiment, the weight value of the filter may be repeated twice according to a sequential clock and then input to the first flip-flop circuit 1110-1. In addition, the data of the input feature map may be mapped in a systolic arrangement so that it is repeated twice according to a sequential clock and inputted to the second flip-flop circuit 1110-2.

제1 플립 플롭 회로(1110-1)에 입력된 웨이트 값과 제2 플립 플롭 회로(1110-2)에 입력된 데이터는 곱셈 연산기(1120)를 통해 곱해질 수 있다. 순차적인 클럭에 따라 곱셈 연산기(1120)에서 출력된 입력 데이터와 웨이트 값의 곱은 제1 덧셈 연산기(1130-1) 및 제2 덧셈 연산기(1130-2)로 전달된다. 이 때, 제3 플립 플롭 회로(1110-3)는 클럭 게이트 회로(1140-1, 1140-2)에 의해 2진 카운터(Binary Count) 기능을 수행할 수 있다. 즉, 제3 플립 플롭 회로(1110-3)가 하이(high)인 경우 입력 데이터와 웨이트 값의 곱이 제1 덧셈 연산기(1130-1)에 전달되고, 제3 플립 플롭 회로(1110-3)가 로우(low)인 경우 입력 데이터와 웨이트 값의 곱이 제2 덧셈 연산기(1130-2)에 전달될 수 있다. 제4 플립 플롭 회로(1110-4)는 제1 덧셈 연산기(1130-1)에 전달된 입력 데이터와 웨이트 값의 곱을 더한 값을 전달받고, 제5 플립 플롭 회로(1110-5)는 제2 덧셈 연산기(1130-2)에 전달된 입력 데이터와 웨이트 값의 곱을 더한 값을 전달받을 수 있다. 예를 들어, 제4 플립 플롭 회로(1110-4)에서는 제1 클럭에서 S11(x11*w11)를 출력하고, 제3 클럭에서 S13(x12*w12)를 출력할 수 있다. 또한, 제5 플립 플롭 회로(1110-5)에서는 제2 클럭에서 S12(x12*w11)을 출력하고, 제4 클럭에서는 S14(x13*w12)를 출력할 수 있다. 전술한 방식으로 순차적인 클럭에 따라 계산된 출력 값을 누적 합산하는 경우 출력 특징 맵의 데이터를 획득할 수 있다. The weight value input to the first flip-flop circuit 1110-1 and the data input to the second flip-flop circuit 1110-2 may be multiplied through the multiplication operator 1120. The multiplication of input data output from the multiplication operator 1120 and the weight value according to sequential clocks is transferred to the first addition operator 1130-1 and the second addition operator 1130-2. At this time, the third flip-flop circuit 1110-3 may perform a binary count function by the clock gate circuits 1140-1 and 1140-2. That is, when the third flip-flop circuit 1110-3 is high, the product of the input data and the weight value is transferred to the first adder 1130-1, and the third flip-flop circuit 1110-3 In the case of low, the product of the input data and the weight value may be transmitted to the second addition operator 1130-2. The fourth flip-flop circuit 1110-4 receives a value obtained by adding the product of the input data transmitted to the first adder 1130-1 and the weight value, and the fifth flip-flop circuit 1110-5 receives the second adder 1110-5. A value obtained by adding the product of the input data transmitted to the calculator 1130-2 and the weight value may be delivered. For example, the fourth flip-flop circuit 1110-4 may output S11 (x 11 *w 11 ) at the first clock and output S13 (x 12 *w 12 ) at the third clock. In addition, the fifth flip-flop circuit 1110-5 may output S12 (x 12 *w 11 ) at the second clock and output S14 (x 13 *w 12 ) at the fourth clock. Data of an output feature map may be obtained when output values calculated according to sequential clocks are cumulatively summed in the above-described manner.

도 11a에 도시된 실시예는 종래의 시스톨릭 배열 연산 회로에 비하여 덧셈 연산기 및 플립 플롭 회로의 조합이 하나 더 필요하다. 그러나, 본 개시의 실시예에서 늘어난 덧셈 연산기 및 플립 플롭 회로에 의해 프로세서의 연산량이 두배로 증가하지는 않는데, 이는 제3 플립 플롭 회로(1110-3)가 2진 카운트 기능을 수행하기 때문이다. The embodiment shown in FIG. 11A requires one more combination of an addition operator and a flip-flop circuit than the conventional systolic array operation circuit. However, the amount of operation of the processor is not doubled by the increased addition operator and flip-flop circuit in the embodiment of the present disclosure because the third flip-flop circuit 1110-3 performs a binary count function.

도 11b를 참조하면, 입력 특징 맵(FMap 1) 상의 제1 영역(P1)에서 입력 특징 맵(100)의 데이터 x11, x12, x13은 필터(110)의 w11, w12, w13과 각각 곱셈 연산되고, 곱한 결과 값이 누적 합산되어 출력 특징 맵(120)의 제1-1 출력 데이터(x11*w11+x12*w12+x13*w13)가 생성된다. 또한, 입력 특징 맵(FMap 1) 상의 제2 영역(P2)에서 입력 특징 맵(100)의 데이터 x12, x13, x14은 필터(110)의 w11, w12, w13과 각각 곱셈 연산되고, 곱한 결과 값이 누적 합산되어 출력 특징 맵(120)의 제1-2 출력 데이터(x12*w11+x13*w12+x14*w13)가 생성된다. 이는 도 11a에 도시된 시스톨릭 연산기(1110)에 의해 출력된 결과값과 동일하다. 즉, 도 11a에서 S11, S13, S15를 누적 합산하면, 도 11b의 제1-1 출력 데이터 x11*w11+x12*w12+x13*w13가 획득된다. 마찬가지로, 도 11a에서 S12, S14, S16를 누적 합산하면, 도 11b의 제1-2 출력 데이터 x12*w11+x13*w12+x14*w13가 획득된다.Referring to FIG. 11B , data x 11 , x 12 , x 13 of the input feature map 100 in the first area P1 on the input feature map FMap 1 are w 11 , w 12 , w of the filter 110 13 is multiplied, and the multiplied values are cumulatively summed to generate 1-1st output data (x 11 *w 11 +x 12 *w 12 +x 13 *w 13 ) of the output feature map 120 . In addition, in the second area P2 on the input feature map FMap 1, data x 12 , x 13 , and x 14 of the input feature map 100 are multiplied by w 11 , w 12 , and w 13 of the filter 110, respectively. 1-2 output data (x 12 *w 11 +x 13 *w 12 +x 14 *w 13 ) of the output feature map 120 is generated by accumulating and summing the values obtained from the operation and multiplication. This is the same as the result value output by the systolic calculator 1110 shown in FIG. 11A. That is, when S 11 , S 13 , and S 15 are cumulatively added in FIG. 11A , the 1-1 output data x 11 *w 11 +x 12 *w 12 +x 13 *w 13 of FIG. 11B is obtained. Similarly, when S 12 , S 14 , and S 16 are cumulatively added in FIG. 11A , the first-second output data x 12 *w 11 +x 13 *w 12 +x 14 *w 13 of FIG. 11B is obtained.

전술한 실시예들에 따른 전자 장치는 프로세서, 프로그램 데이터를 저장하고 실행하는 메모리, 디스크 드라이브와 같은 영구 저장부(permanent storage), 외부 장치와 통신하는 통신 포트, 터치 패널, 키(key), 버튼 등과 같은 사용자 인터페이스 장치 등을 포함할 수 있다. 소프트웨어 모듈 또는 알고리즘으로 구현되는 방법들은 상기 프로세서상에서 실행 가능한 컴퓨터가 읽을 수 있는 코드들 또는 프로그램 명령들로서 컴퓨터가 읽을 수 있는 기록 매체 상에 저장될 수 있다. 여기서 컴퓨터가 읽을 수 있는 기록 매체로 마그네틱 저장 매체(예컨대, ROM(read-only memory), RAM(random-access memory), 플로피 디스크, 하드 디스크 등) 및 광학적 판독 매체(예컨대, 시디롬(CD-ROM), 디브이디(DVD: Digital Versatile Disc)) 등이 있다. 컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템들에 분산되어, 분산 방식으로 컴퓨터가 판독 가능한 코드가 저장되고 실행될 수 있다. 매체는 컴퓨터에 의해 판독가능하며, 메모리에 저장되고, 프로세서에서 실행될 수 있다. An electronic device according to the above-described embodiments includes a processor, a memory for storing and executing program data, a permanent storage unit such as a disk drive, a communication port for communicating with an external device, a touch panel, a key, and a button. It may include user interface devices such as the like. Methods implemented as software modules or algorithms may be stored on a computer-readable recording medium as computer-readable codes or program instructions executable on the processor. Here, the computer-readable recording medium includes magnetic storage media (e.g., read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and optical reading media (e.g., CD-ROM) ), and DVD (Digital Versatile Disc). A computer-readable recording medium may be distributed among computer systems connected through a network, and computer-readable codes may be stored and executed in a distributed manner. The medium may be readable by a computer, stored in a memory, and executed by a processor.

본 개시의 실시예들은 기능적인 블록 구성들 및 다양한 처리 단계들로 나타내어질 수 있다. 이러한 기능 블록들은 특정 기능들을 실행하는 다양한 개수의 하드웨어 또는/및 소프트웨어 구성들로 구현될 수 있다. 예를 들어, 실시예는 하나 이상의 마이크로프로세서들의 제어 또는 다른 제어 장치들에 의해서 다양한 기능들을 실행할 수 있는, 메모리, 프로세싱, 로직(logic), 룩 업 테이블(look-up table) 등과 같은 직접 회로 구성들을 채용할 수 있다. 구성 요소들이 소프트웨어 프로그래밍 또는 소프트웨어 요소들로 실행될 수 있는 것과 유사하게, 본 실시 예는 데이터 구조, 프로세스들, 루틴들 또는 다른 프로그래밍 구성들의 조합으로 구현되는 다양한 알고리즘을 포함하여, C, C++, 자바(Java), 어셈블러(assembler) 등과 같은 프로그래밍 또는 스크립팅 언어로 구현될 수 있다. 기능적인 측면들은 하나 이상의 프로세서들에서 실행되는 알고리즘으로 구현될 수 있다. 또한, 본 실시 예는 전자적인 환경 설정, 신호 처리, 및/또는 데이터 처리 등을 위하여 종래 기술을 채용할 수 있다. "매커니즘", "요소", "수단", "구성"과 같은 용어는 넓게 사용될 수 있으며, 기계적이고 물리적인 구성들로서 한정되는 것은 아니다. 상기 용어는 프로세서 등과 연계하여 소프트웨어의 일련의 처리들(routines)의 의미를 포함할 수 있다.Embodiments of the present disclosure may be presented as functional block structures and various processing steps. These functional blocks may be implemented with any number of hardware or/and software components that perform specific functions. For example, embodiments may include integrated circuit configurations such as memory, processing, logic, look-up tables, etc., that may execute various functions by means of the control of one or more microprocessors or other control devices. can employ them. Similar to components that can be implemented as software programming or software elements, the present embodiments include data structures, processes, routines, or various algorithms implemented as combinations of other programming constructs, such as C, C++, Java ( It can be implemented in a programming or scripting language such as Java), assembler, or the like. Functional aspects may be implemented in an algorithm running on one or more processors. In addition, this embodiment may employ conventional techniques for electronic environment setting, signal processing, and/or data processing. Terms such as "mechanism", "element", "means" and "composition" may be used broadly and are not limited to mechanical and physical components. The term may include a meaning of a series of software routines in connection with a processor or the like.

Claims (19)

시스톨릭 배열(systolic array)을 이용하여 딥 러닝(deep learning) 연산을 수행하는 방법에 있어서,
순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 시스톨릭 배열 연산기 내의 곱셈 덧셈 연산기에 입력되도록 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑(mapping)하는 단계;
매핑된 상기 입력 특징 맵의 데이터 및 필터의 웨이트 값을 상기 시스톨릭 배열 연산기에 입력시켜 컨볼루션 연산(convolution)을 수행하는 단계; 및
상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 단계;
를 포함하는, 방법.
In the method of performing a deep learning operation using a systolic array,
The order of data of the input feature map is changed so that data having the same value is repeated a predetermined number of times according to a sequential clock and inputted to the multiplication and addition operator in the systolic array operator. mapping to an array;
performing a convolution operation by inputting the mapped data of the input feature map and weight values of the filter into the systolic array calculator; and
generating an output feature map by accumulating the output values obtained by the convolution operation;
Including, method.
제1 항에 있어서,
상기 매핑 단계는, 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경하는, 방법.
According to claim 1,
In the mapping step, the input order of the input data is changed so that the same two input data values of the input feature map are repeated and input to the systolic array operator.
제1 항에 있어서,
상기 필터는 N by N (NXN) 크기를 갖고,
상기 매핑 단계는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경하는, 방법.
According to claim 1,
The filter has a size of N by N (NXN),
Wherein the mapping step changes the input order of the data of the input feature map so that the data of the input feature map is repeatedly input to the systolic array calculator a number of times equal to the size (N) of the filter.
제1 항에 있어서,
상기 출력 특징 맵을 생성하는 단계는,
상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하는 단계; 및
선택된 출력값들을 누적 합산하여 상기 입력 특징 맵과 상기 필터의 조합으로 인한 출력 특징 맵을 생성하는 단계;
를 포함하는, 방법.
According to claim 1,
Generating the output feature map comprises:
selecting output values obtained by the convolution operation in consideration of a stride value of the filter and data of the input feature map overlapping in a first direction and a second direction due to the stride; and
generating an output feature map resulting from a combination of the input feature map and the filter by cumulatively summing the selected output values;
Including, method.
제1 항에 있어서,
상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는 단계; 를 더 포함하는, 방법.
According to claim 1,
identifying data having a value of 0 among data of the input feature map; Further comprising a method.
◈청구항 6은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 6 was abandoned when the registration fee was paid.◈ 제5 항에 있어서,
상기 매핑 단계는, 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)하는, 방법.
According to claim 5,
In the mapping step, the data having a value of 0 are grouped so that the data having a value of 0 is repeatedly input to the systolic array calculator.
◈청구항 7은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 7 was abandoned when the registration fee was paid.◈ 제5 항에 있어서,
상기 필터는 N by N (NXN) 크기를 갖고,
상기 매핑 단계는, 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑하는, 방법.
According to claim 5,
The filter has a size of N by N (NXN),
In the mapping step, the data having a value of 0 is collected by the size (N) of the filter and grouped so that the data having the value of 0 is repeatedly input to the systolic array operator the same number of times as the size (N) of the filter. , Way.
◈청구항 8은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 8 was abandoned when the registration fee was paid.◈ 제5 항에 있어서,
상기 0값을 갖는 데이터의 상기 입력 특징 맵(input feature map) 상의 로(row) 및 컬럼(column) 위치를 메모리에 저장하는 단계; 를 더 포함하고,
상기 컨볼루션 연산을 수행하는 단계는, 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)하는, 방법.
According to claim 5,
storing row and column positions of the data having a value of 0 on the input feature map in a memory; Including more,
The performing of the convolution operation may include reading the stored location information from the memory and skipping multiplication and addition operations for data having a value of 0 by referring to the read location information. Way.
◈청구항 9은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 9 was abandoned when the registration fee was paid.◈ 제5 항에 있어서,
상기 0값을 갖는 데이터가 식별된 경우, 0값 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 단계; 를 더 포함하고,
상기 출력 특징 맵을 생성하는 단계는, 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하는, 방법.
According to claim 5,
obtaining location information on the systolic array of the zero-value data when the data having the zero-value is identified; Including more,
In the generating of the output feature map, output values for each region of the input feature map are cumulatively summed based on the acquired location information of the 0-value data.
딥 러닝 연산을 수행하는 전자 장치(electronic device)에 있어서,
시스톨릭 배열을 이용하여 입력 특징 맵의 데이터와 필터의 웨이트 값의 컨볼루션 연산을 수행하는 프로세서를 포함하고,
상기 프로세서는,
순차적인 클럭(clock)에 따라 동일한 값을 갖는 데이터가 기설정된 회수만큼 반복되어 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 순서를 변경하여 상기 입력 특징 맵의 데이터를 시스톨릭 배열로 매핑하는 매퍼(mapper);
매핑된 상기 입력 특징 맵 데이터 또는 상기 필터의 웨이트 값에 대하여 컨볼루션 연산을 수행하는 복수의 곱셈 덧셈 연산기를 포함하는 시스톨릭 배열 연산기; 및
상기 컨볼루션 연산된 출력값들을 누적 합산(accumulation)하여 출력 특징 맵(output feature map)을 생성하는 누산기(adder);
를 포함하는, 전자 장치.
In an electronic device that performs deep learning calculations,
A processor performing a convolution operation between data of an input feature map and a weight value of a filter using a systolic array;
the processor,
Mapping the data of the input feature map into a systolic array by changing the order of data of the input feature map so that data having the same value is repeated a predetermined number of times according to a sequential clock and input to the multiplication and addition operator mapper;
a systolic array operator including a plurality of multiplication and addition operators performing a convolution operation on the mapped input feature map data or the weight value of the filter; and
an adder generating an output feature map by accumulating and summing the convolutional output values;
Including, electronic device.
제10 항에 있어서,
상기 매퍼는, 상기 입력 특징 맵의 동일한 두 개의 입력 데이터 값이 반복되어 상기 시스톨릭 배열 연산기에 입력되도록 상기 입력 데이터의 입력 순서를 변경하는, 전자 장치.
According to claim 10,
The mapper changes an input order of the input data such that two identical input data values of the input feature map are repeated and input to the systolic array operator.
제10 항에 있어서,
상기 필터는 N by N (NXN) 크기를 갖고,
상기 매퍼는 상기 입력 특징 맵의 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기 내의 상기 곱셈 덧셈 연산기에 입력되도록 상기 입력 특징 맵의 데이터의 입력 순서를 변경하는, 전자 장치.
According to claim 10,
The filter has a size of N by N (NXN),
The mapper changes the input order of the data of the input feature map so that the data of the input feature map is repeatedly input to the multiplication operator in the systolic array operator as many times as the size (N) of the filter. Device.
제10 항에 있어서,
상기 누산기는, 상기 필터의 스트라이드(stride) 값 및 상기 스트라이드로 인하여 제1 방향 및 제2 방향으로 중복되는 상기 입력 특징 맵의 데이터를 고려하여 상기 컨볼루션 연산된 출력값들을 선택하고, 상기 선택된 출력값들을 누적 합산하여 상기 입력 특징 맵의 각 영역에 대한 출력 특징 맵을 생성하는, 전자 장치.
According to claim 10,
The accumulator selects the output values subjected to the convolution operation in consideration of a stride value of the filter and data of the input feature map overlapping in a first direction and a second direction due to the stride, and selects the selected output values An electronic device generating an output feature map for each region of the input feature map by cumulative summation.
제10 항에 있어서,
상기 매퍼는, 상기 입력 특징 맵의 데이터 중 0값을 갖는 데이터를 식별하는, 전자 장치.
According to claim 10,
The mapper identifies data having a value of 0 among the data of the input feature map.
◈청구항 15은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 15 was abandoned when the registration fee was paid.◈ 제14 항에 있어서,
상기 매퍼는, 상기 식별된 0값을 갖는 데이터가 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터끼리 그룹핑(grouping)하는, 전자 장치.
According to claim 14,
The mapper groups data having a value of 0 so that the identified data having a value of 0 is repeatedly input to the systolic array calculator.
◈청구항 16은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 16 was abandoned when the registration fee was paid.◈ 제14 항에 있어서,
상기 필터는 N by N (NXN) 크기를 갖고,
상기 매퍼는, 상기 0값을 데이터가 상기 필터의 크기(N)와 동일한 횟수만큼 반복적으로 상기 시스톨릭 배열 연산기에 입력되도록 상기 0값을 갖는 데이터를 상기 필터의 크기(N) 만큼 모아서 그룹핑하는, 전자 장치.
According to claim 14,
The filter has a size of N by N (NXN),
The mapper collects and groups the data having a value of 0 by the size (N) of the filter so that the data having the value of 0 is repeatedly input to the systolic array operator the same number of times as the size (N) of the filter. electronic device.
◈청구항 17은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 17 was abandoned when the registration fee was paid.◈ 제14 항에 있어서,
상기 0값을 갖는 데이터의 로(row) 및 컬럼(column) 위치를 저장하는 메모리; 를 더 포함하고,
상기 프로세서는, 상기 저장된 위치 정보를 상기 메모리로부터 판독(read)하고, 판독된 위치 정보를 참조하여 상기 0값을 갖는 데이터에 대해서는 곱셈 및 덧셈 연산을 스킵(skip)하는, 전자 장치.
According to claim 14,
a memory for storing row and column positions of the data having a value of 0; Including more,
The electronic device of claim 1 , wherein the processor reads the stored location information from the memory and skips multiplication and addition operations for data having a value of 0 by referring to the read location information.
◈청구항 18은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 18 was abandoned when the registration fee was paid.◈ 제10 항에 있어서,
상기 매퍼에 의해 시스톨릭 배열로 매핑된 상기 입력 특징 맵의 데이터 중 0값으로 식별된 데이터의 상기 시스톨릭 배열 상에서의 위치 정보를 획득하는 언매퍼(unmapper); 를 더 포함하고,
상기 언매퍼는 획득한 상기 0값 데이터의 위치 정보에 기초하여 상기 입력 특징 맵의 각 영역에 대한 출력값들을 누적 합산하도록 상기 누산기를 제어하는 애더 트리 제어 회로(adder-tree control circuit)를 포함하는, 전자 장치.
According to claim 10,
an unmapper for obtaining location information on the systolic array of data identified as a value of 0 among data of the input feature map mapped to the systolic array by the mapper; Including more,
The unmapper includes an adder-tree control circuit for controlling the accumulator to accumulate and sum output values for each region of the input feature map based on the obtained location information of the 0-value data. electronic device.
◈청구항 19은(는) 설정등록료 납부시 포기되었습니다.◈◈Claim 19 was abandoned when the registration fee was paid.◈ 제1 항의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium recording a program for executing the method of claim 1 on a computer.
KR1020180020015A 2018-02-20 2018-02-20 Method and apparatus for operating deep learning by using the systolic array KR102487535B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020180020015A KR102487535B1 (en) 2018-02-20 2018-02-20 Method and apparatus for operating deep learning by using the systolic array
PCT/KR2019/002029 WO2019164237A1 (en) 2018-02-20 2019-02-20 Method and device for performing deep learning calculation by using systolic array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180020015A KR102487535B1 (en) 2018-02-20 2018-02-20 Method and apparatus for operating deep learning by using the systolic array

Publications (2)

Publication Number Publication Date
KR20190099931A KR20190099931A (en) 2019-08-28
KR102487535B1 true KR102487535B1 (en) 2023-01-12

Family

ID=67687842

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180020015A KR102487535B1 (en) 2018-02-20 2018-02-20 Method and apparatus for operating deep learning by using the systolic array

Country Status (2)

Country Link
KR (1) KR102487535B1 (en)
WO (1) WO2019164237A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826710B (en) * 2019-10-18 2021-04-23 南京大学 Hardware acceleration implementation method of RNN forward propagation model based on transverse pulse array
CN112784973A (en) * 2019-11-04 2021-05-11 北京希姆计算科技有限公司 Convolution operation circuit, device and method
CN111008697B (en) * 2019-11-06 2022-08-09 北京中科胜芯科技有限公司 Convolutional neural network accelerator implementation architecture
KR102272518B1 (en) * 2020-03-13 2021-07-05 인천대학교 산학협력단 Systolic Arrays Apparatus
KR20220028899A (en) 2020-08-31 2022-03-08 삼성전자주식회사 Accelerator, method for operating the same, and electronic device including the same
KR102594484B1 (en) * 2021-01-12 2023-10-27 성균관대학교산학협력단 Method and device for operating depthwise convolution by using the systolic array
KR102561205B1 (en) * 2021-04-16 2023-07-28 포항공과대학교 산학협력단 Mobilenet hardware accelator with distributed sram architecture and channel stationary data flow desigh method thereof
KR102582419B1 (en) * 2021-08-04 2023-09-26 한국과학기술원 Method for performing convolutional neural network operation by using in-memory computing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100670766B1 (en) * 2004-01-24 2007-01-17 학교법인 포항공과대학교 Device for blind source separation and hardware apparatus having plurality of the same coupled in parallel configuration
US8479133B2 (en) * 2009-01-27 2013-07-02 Xilinx, Inc. Method of and circuit for implementing a filter in an integrated circuit
KR102276339B1 (en) * 2014-12-09 2021-07-12 삼성전자주식회사 Apparatus and method for training convolutional neural network for approximation of convolutional neural network
US10083395B2 (en) * 2015-05-21 2018-09-25 Google Llc Batch processing in a neural network processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Xuechao Wei et al.,‘Automated Systolic Array Architecture Synthesis for High Throughput CNN Inference on FPGAs’, 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC), 1-6pages (2017.06.22)

Also Published As

Publication number Publication date
KR20190099931A (en) 2019-08-28
WO2019164237A1 (en) 2019-08-29

Similar Documents

Publication Publication Date Title
KR102487535B1 (en) Method and apparatus for operating deep learning by using the systolic array
US20190347553A1 (en) Training neural networks using mixed precision computations
WO2019099305A1 (en) Meta-learning for multi-task learning for neural networks
CN111295675B (en) Apparatus and method for processing convolution operations using kernels
EP3855367A1 (en) Operation accelerator, processing method, and related device
CN107944545B (en) Computing method and computing device applied to neural network
KR20170007151A (en) Method and apparatus for executing artificial neural networks
CN107766292B (en) Neural network processing method and processing system
EP3528181B1 (en) Processing method of neural network and apparatus using the processing method
CN111401557B (en) Agent decision making method, AI model training method, server and medium
US11113361B2 (en) Electronic apparatus and control method thereof
JP2021507345A (en) Fusion of sparse kernels to approximate the complete kernel of convolutional neural networks
KR20190140841A (en) Neural network hardware acceleration with stochastic adaptive resource allocation
KR20200095300A (en) Method and apparatus for processing convolution operation of neural network
CN111742333A (en) Method and apparatus for performing deep neural network learning
KR20190041388A (en) Electronic apparatus and control method thereof
US11568303B2 (en) Electronic apparatus and control method thereof
US20230342626A1 (en) Model processing method and related apparatus
JP7435602B2 (en) Computing equipment and computing systems
WO2020197510A1 (en) A system for mapping a neural network architecture onto a computing core and a method of mapping a neural network architecture onto a computing core
CN114120045B (en) Target detection method and device based on multi-gate control hybrid expert model
CN114723024A (en) Linear programming-based neural network mapping method for storage and calculation integrated chip
Piorkowski Unraveling Data Science, Artificial Intelligence, and Autonomy
JP2021005242A (en) Information processing device, information processing program, and information processing method
Jin et al. Neural architecture search based on dual attention mechanism for image classification

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right