SlideShare a Scribd company logo
1 of 49
Download to read offline
Binarized CNN on FPGA로
GPU와 맞짱을 뜨다
Prof. Nakahara Hiaki (Tokyo Tech.)
번역 : 김홍배
2
내용
• 딥러닝 기술의 HW화
• FPGA란 ?
• CNN의 최적화 방법
• Binarized CNN
• 고위합성(HLS)을 사용한 Binarized CNN의 구현
• Binarized CNN의 성능평가
• 마무리
딥러닝 기술의 HW화
응용사례 : K-Glass
11https://www.youtube.com/watch?v=fzQpSORKYr8
딥러닝의 임베딩화
• 크라우드의 문제
• 네트웍 지연
• 보안
• 학습은 온라인,
실제 적용만을 실행
하는 것으로
• 검토사항
• 계산능력
• 배터리
• 냉각능력
5
6
FPGA란?
FPGA?
• Field(현장에서)
• Programmable
(프로그래밍이 가능한)
• Gate(논리게이트의)
• Array(집합체)
14
Accelerated in PCI instead of
GPU Accelerator (Altera)
It's smaller than
your fingertips!
(Lattice)
Speed up for raspai
(Xilinx)
iPhone7에도!!
FPGA의 기본적인 구조
SB SB SB SB
SB SB SB SB
SB SB SB SB
SB SB SB SB
LUT LUT LUT
LUT LUT LUT
LUT LUT LUT
IO IO IO IO IO IO
IO IO IO IO IO IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
Look-Up
Table (LUT)
I/O Block
Channels
Switch Blocks
15
LUT를 사용한 논리게이트의 구현
x0 x1 x2 y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
x0 x1 x2 y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
LUT의 출력을 바꿔씀으로서 다양한 논리게이트를 구현
9
Channel과 Switch Block
LUT
모두 트랜
지스터 스위치
10
Programmable=메모리 바꿔쓰기
SB SB SB SB
SB SB SB SB
SB SB SB SB
SB SB SB SB
LUT LUT LUT
LUT LUT LUT
LUT LUT LUT
IO IO IO IO IO IO
IO IO IO IO IO IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
IO
11
FPGA 대상= 논리회로
module hoge(
input a, b, c;
output d
);
assign d = (a & b) | c;
endmodule
Xilinx社
Altera社
실현코자하는 논리회로
를 HW기술언어로 기술
(Verilog HDL/ VHDL)
12
FPGA업체가 제공하는
CAD Tool로 Bit stream
으로 합성
FPGA에 Bit stream을
보내 회로가 구현 !
13
Convolutional Neural
Network(CNN)의 최적화 방법
14
CNN의 최적화 방법
• Pruning
• Weight Sharing
• Quantization
• Binarized/Ternarized
Pruning
• Connection과 Neuron을 잘라냄
• 최근에는 잘라낸 후 다시 붙여서 정확도 up
• 재학습을 통하여 인식정도 Keep
• 압축률: LeNet-5→12x, AlexNet→9x, VGG16→13x
Pruning후
재학습의
효과
Han et al. “Learning both Weights and Connections for Efficient Neural Networks,” NIPS15
15
Weight Sharing
43
S. Han et al., “Deep Compression: Compressing Deep Neural Networks With Pruning, Trained Quantization
and HUFFMAN Coding,” ICLR2016.
Quantization
• 양자화 bit수를 줄여서 면적과 대역에 이득
• 인식정도에 영향이 큰 곳은 크게
• Single precision floating point number를 8 또는 4 bit
로 줄여도(VGG16), 인식률은 0.4% 저하
J. Qiu et al., “Going Deeper with Embedded FPGA
Platform for Convolutional Neural Network,” ISFP
GA2016.
17
18
Binarized CNN을
FPGA로 구현
FPGA와 타 디바이스의 비교
• FPGA의 이점
• 바꿔쓰기 가능(알고리즘 변경에 대응)→ASIC에 비해 이점
• 전력성능효율이 우수→CPU, GPU에 비해 이점
• FPGA의 단점
• CPU에 비해 → 비쌈
• GPU에 비해 → 일반적으로 느리고 개발기간이 길다.
• ASIC에 비해 →비쌈, 전력효율 낮음
Binarized CNN의 도입 →고속화・메모리 줄이고
(=비용절감・저전력)
19
임베딩(HW)에 적합한 CNN︖
AlexNet VGG GoogLeNet ResNet
Year 2012 2014 2014 2015
#Layers 8 19 22 152
Accuracy 16.4% 7.3% 6.7% 3.57%
Inception (NinN) ‐‐‐ ‐‐‐ ✔ ‐‐‐
Kernel Size 11,5,3 3 7,1,3,5 7,1,3,5
FC Size 4096,4096,
1000
4096,4096,
1000
1000 1000
Normalization Local
Response
‐‐‐ Local
Response
Batch
3.5%의 인식률 개선을 위하여, 다른 kernel size, 대량의 layer수를
사용할 필요가 ?
→ VGG를 선택 47
CNN의 HW 구현
W1
W2
W3
W4
X
X’
가중치 유지
출력을 유지
(Ping-pong 메모리)
X X’ X X’ X
48
MAC 전개 & pipe line
• 각 layer를 다음과 같이 나누어 실행, 각 layer에
pipe line처리
FPGA구현에 있어서 Bottle-neck
• VGG의 프로파일 해석
• Convolution layer
→ MAC의 부족
• Pool 결합층
→ 메모리 부족
J. Qiu et al., “Going Deeper with Embedded FPGA Platform for Convolutional Neural Network,”
ISFPGA2016. 49
Binarized 뉴럴넷
• 두값(-1/+1)의 곱
• 곱하기를 XNOR 게이트로  같은 값이면 1,
아니면 0
x1 x2 Y
‐1 ‐1 1
‐1 +1 ‐1
+1 ‐1 ‐1
+1 +1 1
x1 x2 Y
0 0 1
0 1 0
1 0 0
1 1 1
23
24
Low-precision CNN 관련논문
• Binary Connected [NIPS, Dec., 2015]
• Binarized Neural Networks [arXiv, Mar., 2016]
• Ternary-Net [arXiv, May, 2016]
→ Intel이 ResNet을 구현. 인식정확도 2% 저하로
GPU (Titan X)과 동일한 성능[ISFPGA, Feb., 2017]
• Local Binary CNNs [Aug., 2016]
• XNOR-Net [ECCV, Oct., 2016]
XNOR에 의한 Binarized CNN
fsgn(Y)
Y
z
x2
w0(Bias)
w1
x1
w2
wn
xn
...
25
Binarized CNN의 효과
fsgn(Y)
Y
z
x2
w0(Bias)
w1
x1
w2
wn
xn
...
곱셈기를 XNOR로 대체→회로면적을 줄임
4〜8 bit를 binarized로 바꾸기 →메모리대역을 압축 53
27
Binarized on FPGA가 트렌드
• FPT2016 (12월)
• E. Nurvitadhi (Intel) et al., “Accelerating Binarized Neural
Networks: Comparison of FPGA, CPU, GPU, and ASIC”
• H. Nakahara (東⼯⼤), “A Memory-Based Realization of a
Binarized Deep Convolutional Neural Network”
• ISFPGA2017
• Ritchie Zhao et al., “Accelerating Binarized Convolutional Neural
Networks with Software-Programmable FPGAs”
• Y. Umuroglu (Xilinx) et al., FINN: A Framework for Fast,
Scalable Binarized Neural Network Inference
• H. Nakahara, H. Yonekawa (東⼯⼤), et al. “A Batch Nor
malization Free Binarized Convolutional Deep Neural N
etwork on an FPGA”
• Y. Li et al., “A 7.663-TOPS 8.2-W Energy-efficient FPGA
Accelerator for Binary Convolutional Neural Networks,”
• G. Lemieux, “TinBiNN: Tiny Binarized Neural Network Overlay
in Less Than 5,000 4-LUTs,”
Binarized에 의한 메모리 감소량@VGG11
19383
float int8 Binary
10
6
4850
338
14
float int8 Binary
18Kb BRAM DSP48E Block
7743
5586
4064
float int8 Binary
FF (Flip Flop)
14006
7690
float int8 Binary
LUT (Look‐Up Table)
11503
Bottle neck
28
메모리 감소→ 전력효율 향상
• 메모리와 계산기의 거리 ∝ 전력
→FPGA의 on-chip 메모리에 수용이 가능하면 전력효율↑
E. Joel et al., “Tutorial on Hardware Architectures for Deep Neural Networks,” MICRO‐49, 2016.58
Binarized CNN의 전략
메모리 감소 → on-chip화
• FPGA의 on-chip 메모리
• BRAM (Block RAM) → 수백〜1000개 정도
• Distributed RAM (LUT) → 수만〜10만개 정도
→ 개별 용량은 작지만(64bit), 개수를 많게 해서 광대역화
cf. Jetson TX1(GPU) LPDDR4, 25.6GB/s
1만 LUT@100MHz → 125GB/s
고위합성에서는 #pragma HLS unroll를 입력해서
(factor=N (N은 정수)으로 조정도 가능)
59
LUT
LUT
LUT LUT
LUT
LUT
LUT LUT
LUT
LUT
LUT LUT
인식정확도 저하에 대하여
• Batch Normalization을 도입
0
20
40
60
80
100
Classificationerror(%)
1 80 160 200
# of epochs
0
20
40
60
80
100
Classificationerror(%)
1 80
# of epochs
160 200
단순히 binarized한 경우
제안방법
(a) float32 bit precision CNN (b) Binarized CNN
약 6%의 차이(VGG‐16를 사용)
H. Nakahara et al., “A memory‐based binarized convolutional deep neural network,”
FPT2016, pp285‐288, 2016.
31
Binarized CNN Batch Normalization이
효과적인 이유
Y
fsgn(Y)
‐1
+1
XXXXXXOOOOOO
0
Y
fsgn(Y)
‐1
+1
XXXXXXOOOOOO
0
+1
‐1
scaling(y)에 의한
폭 2로 정규화
shift(þ)에 의한
‐1〜+1로 제한
32
33
고위합성을 사용한
Binarized CNN의 구현
실제 구현시…
63
module hoge(
input a, b, c;
output d
);
assign d = (a & b) | c;
endmodule
실현하고자하는 논리회로를
하드웨어 기술언어로
대량의 HDL로 쓰기
(Verilog HDL / VHDL)
Y = X.dot(W)+B
학습한 딥 뉴럴네트웍의 행렬연산을
간단하게 1줄로
기술량∝설계시간
Y = X.dot(W)+B
Python: 1줄
C/C++: 10줄
35
Verilog-HDL: 66줄
High-Level Synthesis
(HLS)
• C/C++로 설계→소규모 업체에서도
HW를 설계 가능
• Binarized Neural Net을 1개월만에
제작
짧은 개발기간(Turn around time, TAT)이란
FPGA의 장점을 이끌어냄
36
HLS의 flow
(종래에는 이러한 작업을 모두 사람 손으로 수행)
Input Behavioral Spec. Dataflow Scheduling
Data‐path generation
Controller (FSM) Generation
Mapping to resources
(Binding)
37
Deep Convolutional
Neural Network의 HLS 임베딩
• 의존성이 없는 7 중 loop의 최적화
 HLS에서도 쉽게 최적화
...
...
120 nodes
10 nodes
5x5
16 F. maps 16 F.maps
10x10
6 F. maps
14x14
6 Feature maps
28x28
Gray scale
image
32x32
5x5
2x2
5x5
2x2 5x5
1 2 1
2 4 2
1 2 1
①
②
③
④
⑥
⑦
⑤
67
HLS에 의한 자동 합성
행렬연산 라이브러리의 중심
을 C/C++로 작성
하지만 HDL보다는 추상적
Y=0;
for(i=0; i < m; i++){ f
or( j = 0; j < n; j++){
Y += X[i][j]*W[j][i];
}
}
FPGA업체의
HLS tool이 HDL
을 작성
↓
기존의 방법
으로 FPGA로 구현
자동합성
DNN을 기존 frame work
로 설계 (학습은 GPU로)
학습 된 CNN을
이진화로 변환
(개발중)
68
指⽰⼦による性能向上(1)
• オリジナルのループ→逐次実⾏
• #pragma HLS unroll → 演算器展開
• #pragma HLS pipeline → パイプライン化
for ( int i = 0; i < N; i++){
op_Read;
op_MAC;
op_Write;
}
for ( int i = 0; i < N; i++){
#pragma HLS pipeline
op_Read;
op_MAC;
op_Write;
}
for ( int i = 0; i < N; i++){
#pragma HLS unroll 3
op_Read;
op_MAC;
op_Write;
}
RD MAC WR RD MAC WR
RD MAC WR
RD MAC WR
RD MAC WR
RD MAC WR R
D MAC WR R
D MAC WR
スループット: 3サイクル レイ
テンシ: 3サイクル 演算量:
1/3 データ/サイクル
スループット: 3サイクル レ
イテンシ: 3サイクル 演算
量: 1 データ/サイクル
スループット: 1サイクル レ
イテンシ: 3サイクル 演算
量: 1 データ/サイクル
69
指⽰⼦による性能向上(2)
• #pragma HLS unroll → 演算器展開
• #pragma HLS pipeline → パイプライン化
Int X[100];
#pragma HLS array partition
for ( int i = 0; i < N; i++){
#pragma HLS pipeline
op_Read;
op_MAC;
op_Write;
}
Int X[100];
#pragma HLS array partition
for ( int i = 0; i < N; i++){
#pragma HLS unroll 3
op_Read;
op_MAC;
op_Write;
}
RD MAC WR R
D MAC WR R
D MAC WR
スループット: 3サイクル レ
イテンシ: 3サイクル 演算
量: 1 データ/サイクル
スループット: 1サイクル レ
イテンシ: 3サイクル 演算
量: 1 データ/サイクル
70
Mem Mem
Mem Mem
Mem Mem
RD MAC WR
RD MAC WR
RD MAC WR
RD MAC WR
Mem Mem
Mem Mem
CNNにおける適切な指⽰⼦
• 外部メモリと内部メモリでループを分割
• 内部メモリ︓展開した演算器をパイプライン化
ISFPGA2015, pp. 161‐170, 2015.
RAM
RAM
RAM
C. Zhang et al., “Optimizing FPGA‐based Accelerator Design for Deep Convolutional Neural Networks,”
++
++
+
…
…
パイプライン
レジスタ
71
指⽰⼦の効果
46.3
11.810.6
2.2 1.5 3.6 1.9 2.1 4.4
28.1
No pragma Unroll Unroll+Pipeline
リソース利⽤率 (%)
BRAM18K DSP48E
87.1
FF LUT
90.4
0.16
0.48
119.57
0.10
1.00
10.00
100.00
1000.00
No pragma Unroll Unroll+Pipeline
FPS (Frames per second)
• リソース利⽤率と性能はトレードオフ
• 内部メモリを削減すれば更に性能向上可能
72FPGAのリソース量∝推定のスピード
44
Binarized CNN의 평가
평가환경
• FPGA: Digilent사 Nexys4 Video보드
• Xilinx사 Artix-7 FPGA탑재 XC7A200T-1SBG484C
• LUT수: 129000
• 18Kb BRAM수: 730
• DSP48E수: 740
• 512Mb DDR3 Memory
• MicroBlaze 내장
• CNN설계: Chainer 1.20.0
• VGG16을 Cifar10으로 학습
• GeForce Titan X
45
GPU, CPU와의 비교
Platform
Device Artix 7Quad‐core ARM
Cortex‐A57
1.9 GHz
0.2
7
0.03
256‐core
Maxwell GPU
998 MHz
116.9
17
6.87
Clock Freq.
FPS
Power [W] Efficie
ncy [FPS/W] Accu
racy [%] 92.35
100 MHz
119.5
3
39.83
87.45
NVidia Jetson TX1
46
Digilent Nexys4 Video
인식정도에 대하여
• 알고리즘과 데이터로 커버 가능
Joseph Redmon, Ali Farhadi, “YOLO9000: Better, Faster, Stronger,”
• 이진화 VGG16 를 사용해서 ImageNet의
서브셋을 학습→3일에 90.3% 인식 정확도
47
48
결론
49
결론
• HW용 CNN의 트렌드를 소개
• 기술은 정신없이 발전 중
• 올해에도 중요한 발표가 있을 가능성이 매우 높음
• Binarized CNN의 소개
• 연산기를 XOR 게이트, 메모리를 내부 메모리로 구현
• FPGA에서도 고성능이면서 저전력화를 달성
• HLS에 의해 단기간에 설계
• Deep learning framework과의 연대로
소규모 업체에서도 고성능 HW 개발 가능
• FPGA의 리소스량∝성능, 하지만 전력・비용과의 trade-off
• GPU, CPU와의 비교
• GPU보다 고속이며, 인식정도는 5% 정도 낮음, 전력효율은 5.5배
• 인식정도 저하는 학습기법을 통해 커버가능

More Related Content

What's hot

스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)포프 김
 
研究者のための Python による FPGA 入門
研究者のための Python による FPGA 入門研究者のための Python による FPGA 入門
研究者のための Python による FPGA 入門ryos36
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명홍배 김
 
MLデザインパターン入門_Embeddings
MLデザインパターン入門_EmbeddingsMLデザインパターン入門_Embeddings
MLデザインパターン入門_EmbeddingsMasakazu Shinoda
 
Advancements in-tiled-rendering
Advancements in-tiled-renderingAdvancements in-tiled-rendering
Advancements in-tiled-renderingmistercteam
 
[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement LearningKiho Suh
 
Understanding cnn
Understanding cnnUnderstanding cnn
Understanding cnnRucha Gole
 
1.単純パーセプトロンと学習アルゴリズム
1.単純パーセプトロンと学習アルゴリズム1.単純パーセプトロンと学習アルゴリズム
1.単純パーセプトロンと学習アルゴリズム浩気 西山
 
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)Lee Seungeun
 
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기NAVER Engineering
 
[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networks[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networksDeep Learning JP
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
 
Semantic Segmentation Methods using Deep Learning
Semantic Segmentation Methods using Deep LearningSemantic Segmentation Methods using Deep Learning
Semantic Segmentation Methods using Deep LearningSungjoon Choi
 
高位合成でDeep learning
高位合成でDeep learning高位合成でDeep learning
高位合成でDeep learningMori Labo.
 
[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)Donghyeon Kim
 
08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드noerror
 
PWNの超入門 大和セキュリティ神戸 2018-03-25
PWNの超入門 大和セキュリティ神戸 2018-03-25PWNの超入門 大和セキュリティ神戸 2018-03-25
PWNの超入門 大和セキュリティ神戸 2018-03-25Isaac Mathis
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUJiansong Chen
 
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモ
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモDNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモ
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモShinya Takamaeda-Y
 

What's hot (20)

스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
 
研究者のための Python による FPGA 入門
研究者のための Python による FPGA 入門研究者のための Python による FPGA 入門
研究者のための Python による FPGA 入門
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명
 
Relic's FX System
Relic's FX SystemRelic's FX System
Relic's FX System
 
MLデザインパターン入門_Embeddings
MLデザインパターン入門_EmbeddingsMLデザインパターン入門_Embeddings
MLデザインパターン入門_Embeddings
 
Advancements in-tiled-rendering
Advancements in-tiled-renderingAdvancements in-tiled-rendering
Advancements in-tiled-rendering
 
[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning
 
Understanding cnn
Understanding cnnUnderstanding cnn
Understanding cnn
 
1.単純パーセプトロンと学習アルゴリズム
1.単純パーセプトロンと学習アルゴリズム1.単純パーセプトロンと学習アルゴリズム
1.単純パーセプトロンと学習アルゴリズム
 
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
CNN 초보자가 만드는 초보자 가이드 (VGG 약간 포함)
 
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
1시간만에 GAN(Generative Adversarial Network) 완전 정복하기
 
[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networks[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networks
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
 
Semantic Segmentation Methods using Deep Learning
Semantic Segmentation Methods using Deep LearningSemantic Segmentation Methods using Deep Learning
Semantic Segmentation Methods using Deep Learning
 
高位合成でDeep learning
高位合成でDeep learning高位合成でDeep learning
高位合成でDeep learning
 
[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)[기초개념] Graph Convolutional Network (GCN)
[기초개념] Graph Convolutional Network (GCN)
 
08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드08_게임 물리 프로그래밍 가이드
08_게임 물리 프로그래밍 가이드
 
PWNの超入門 大和セキュリティ神戸 2018-03-25
PWNの超入門 大和セキュリティ神戸 2018-03-25PWNの超入門 大和セキュリティ神戸 2018-03-25
PWNの超入門 大和セキュリティ神戸 2018-03-25
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPU
 
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモ
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモDNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモ
DNNのモデル特化ハードウェアを生成するオープンソースコンパイラNNgenのデモ
 

Viewers also liked

A neural image caption generator
A neural image caption generatorA neural image caption generator
A neural image caption generator홍배 김
 
MNIST for ML beginners
MNIST for ML beginnersMNIST for ML beginners
MNIST for ML beginners홍배 김
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder홍배 김
 
Learning to remember rare events
Learning to remember rare eventsLearning to remember rare events
Learning to remember rare events홍배 김
 
Meta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural NetworksMeta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural Networks홍배 김
 
Learning by association
Learning by associationLearning by association
Learning by association홍배 김
 
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...홍배 김
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE홍배 김
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert홍배 김
 
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...홍배 김
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)홍배 김
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation홍배 김
 
머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)홍배 김
 
딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향홍배 김
 
Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization홍배 김
 

Viewers also liked (15)

A neural image caption generator
A neural image caption generatorA neural image caption generator
A neural image caption generator
 
MNIST for ML beginners
MNIST for ML beginnersMNIST for ML beginners
MNIST for ML beginners
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder
 
Learning to remember rare events
Learning to remember rare eventsLearning to remember rare events
Learning to remember rare events
 
Meta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural NetworksMeta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural Networks
 
Learning by association
Learning by associationLearning by association
Learning by association
 
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
 
머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
 
딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향
 
Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization
 

Similar to Binarized CNN on FPGA

Ibm과 nvidia가 제안하는 딥러닝 플랫폼
Ibm과 nvidia가 제안하는 딥러닝 플랫폼Ibm과 nvidia가 제안하는 딥러닝 플랫폼
Ibm과 nvidia가 제안하는 딥러닝 플랫폼ibmrep
 
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)khuhacker
 
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...hoondong kim
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLDKim Junghoon
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_sparkNAVER D2
 
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례(Joe), Sanghun Kim
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks ISang Jun Lee
 
"Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re..."Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re...LEE HOSEONG
 
병렬프로그래밍과 Cuda
병렬프로그래밍과 Cuda병렬프로그래밍과 Cuda
병렬프로그래밍과 CudaSeok-joon Yun
 
Cloud based NGS framework
Cloud based NGS frameworkCloud based NGS framework
Cloud based NGS frameworkHyungyong Kim
 
Spark_Overview_qna
Spark_Overview_qnaSpark_Overview_qna
Spark_Overview_qna현철 박
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Networkagdatalab
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderLee Seungeun
 
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트OpenStack Korea Community
 
Pivot3 overview
Pivot3 overviewPivot3 overview
Pivot3 overviewCDIT-HCI
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pubJaewook. Kang
 
[232] 수퍼컴퓨팅과 데이터 어낼리틱스
[232] 수퍼컴퓨팅과 데이터 어낼리틱스[232] 수퍼컴퓨팅과 데이터 어낼리틱스
[232] 수퍼컴퓨팅과 데이터 어낼리틱스NAVER D2
 
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)BoanLabDKU
 
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전Sukwoo Lee
 

Similar to Binarized CNN on FPGA (20)

Ibm과 nvidia가 제안하는 딥러닝 플랫폼
Ibm과 nvidia가 제안하는 딥러닝 플랫폼Ibm과 nvidia가 제안하는 딥러닝 플랫폼
Ibm과 nvidia가 제안하는 딥러닝 플랫폼
 
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)
2015 제2회 동아리 해커 세미나 - 병렬컴퓨팅 소개 (16기 김정현)
 
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD
 
Processor
ProcessorProcessor
Processor
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark
 
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례
[IBM 김상훈] AI 최적화 플랫폼 IBM AC922 소개와 활용 사례
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks I
 
"Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re..."Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re...
 
병렬프로그래밍과 Cuda
병렬프로그래밍과 Cuda병렬프로그래밍과 Cuda
병렬프로그래밍과 Cuda
 
Cloud based NGS framework
Cloud based NGS frameworkCloud based NGS framework
Cloud based NGS framework
 
Spark_Overview_qna
Spark_Overview_qnaSpark_Overview_qna
Spark_Overview_qna
 
Deep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural NetworkDeep Learning & Convolutional Neural Network
Deep Learning & Convolutional Neural Network
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
 
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트
[OpenStack Days Korea 2016] Track3 - 방송제작용 UHD 스트로지 구성 및 테스트
 
Pivot3 overview
Pivot3 overviewPivot3 overview
Pivot3 overview
 
[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub[Tf2017] day4 jwkang_pub
[Tf2017] day4 jwkang_pub
 
[232] 수퍼컴퓨팅과 데이터 어낼리틱스
[232] 수퍼컴퓨팅과 데이터 어낼리틱스[232] 수퍼컴퓨팅과 데이터 어낼리틱스
[232] 수퍼컴퓨팅과 데이터 어낼리틱스
 
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)
테슬라 도조 프로젝트 (What is Tesla's Dojo Supercomputer?)
 
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전
진화하는 컴퓨터 하드웨어와 게임 개발 기술의 발전
 

More from 홍배 김

Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...홍배 김
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing홍배 김
 
Lecture Summary : Camera Projection
Lecture Summary : Camera Projection Lecture Summary : Camera Projection
Lecture Summary : Camera Projection 홍배 김
 
Learning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robotsLearning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robots홍배 김
 
Robotics of Quadruped Robot
Robotics of Quadruped RobotRobotics of Quadruped Robot
Robotics of Quadruped Robot홍배 김
 
Basics of Robotics
Basics of RoboticsBasics of Robotics
Basics of Robotics홍배 김
 
Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명홍배 김
 
Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용홍배 김
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier홍배 김
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN홍배 김
 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function홍배 김
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain홍배 김
 
Anomaly Detection and Localization Using GAN and One-Class Classifier
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier홍배 김
 
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...홍배 김
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance홍배 김
 
Anomaly Detection with GANs
Anomaly Detection with GANsAnomaly Detection with GANs
Anomaly Detection with GANs홍배 김
 

More from 홍배 김 (16)

Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing
 
Lecture Summary : Camera Projection
Lecture Summary : Camera Projection Lecture Summary : Camera Projection
Lecture Summary : Camera Projection
 
Learning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robotsLearning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robots
 
Robotics of Quadruped Robot
Robotics of Quadruped RobotRobotics of Quadruped Robot
Robotics of Quadruped Robot
 
Basics of Robotics
Basics of RoboticsBasics of Robotics
Basics of Robotics
 
Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명
 
Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용Convolutional neural networks 이론과 응용
Convolutional neural networks 이론과 응용
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN
 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain
 
Anomaly Detection and Localization Using GAN and One-Class Classifier
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier
 
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance
 
Anomaly Detection with GANs
Anomaly Detection with GANsAnomaly Detection with GANs
Anomaly Detection with GANs
 

Binarized CNN on FPGA

  • 1. Binarized CNN on FPGA로 GPU와 맞짱을 뜨다 Prof. Nakahara Hiaki (Tokyo Tech.) 번역 : 김홍배
  • 2. 2 내용 • 딥러닝 기술의 HW화 • FPGA란 ? • CNN의 최적화 방법 • Binarized CNN • 고위합성(HLS)을 사용한 Binarized CNN의 구현 • Binarized CNN의 성능평가 • 마무리
  • 5. 딥러닝의 임베딩화 • 크라우드의 문제 • 네트웍 지연 • 보안 • 학습은 온라인, 실제 적용만을 실행 하는 것으로 • 검토사항 • 계산능력 • 배터리 • 냉각능력 5
  • 7. FPGA? • Field(현장에서) • Programmable (프로그래밍이 가능한) • Gate(논리게이트의) • Array(집합체) 14 Accelerated in PCI instead of GPU Accelerator (Altera) It's smaller than your fingertips! (Lattice) Speed up for raspai (Xilinx) iPhone7에도!!
  • 8. FPGA의 기본적인 구조 SB SB SB SB SB SB SB SB SB SB SB SB SB SB SB SB LUT LUT LUT LUT LUT LUT LUT LUT LUT IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO Look-Up Table (LUT) I/O Block Channels Switch Blocks 15
  • 9. LUT를 사용한 논리게이트의 구현 x0 x1 x2 y 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 x0 x1 x2 y 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 LUT의 출력을 바꿔씀으로서 다양한 논리게이트를 구현 9
  • 10. Channel과 Switch Block LUT 모두 트랜 지스터 스위치 10
  • 11. Programmable=메모리 바꿔쓰기 SB SB SB SB SB SB SB SB SB SB SB SB SB SB SB SB LUT LUT LUT LUT LUT LUT LUT LUT LUT IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO IO 11
  • 12. FPGA 대상= 논리회로 module hoge( input a, b, c; output d ); assign d = (a & b) | c; endmodule Xilinx社 Altera社 실현코자하는 논리회로 를 HW기술언어로 기술 (Verilog HDL/ VHDL) 12 FPGA업체가 제공하는 CAD Tool로 Bit stream 으로 합성 FPGA에 Bit stream을 보내 회로가 구현 !
  • 14. 14 CNN의 최적화 방법 • Pruning • Weight Sharing • Quantization • Binarized/Ternarized
  • 15. Pruning • Connection과 Neuron을 잘라냄 • 최근에는 잘라낸 후 다시 붙여서 정확도 up • 재학습을 통하여 인식정도 Keep • 압축률: LeNet-5→12x, AlexNet→9x, VGG16→13x Pruning후 재학습의 효과 Han et al. “Learning both Weights and Connections for Efficient Neural Networks,” NIPS15 15
  • 16. Weight Sharing 43 S. Han et al., “Deep Compression: Compressing Deep Neural Networks With Pruning, Trained Quantization and HUFFMAN Coding,” ICLR2016.
  • 17. Quantization • 양자화 bit수를 줄여서 면적과 대역에 이득 • 인식정도에 영향이 큰 곳은 크게 • Single precision floating point number를 8 또는 4 bit 로 줄여도(VGG16), 인식률은 0.4% 저하 J. Qiu et al., “Going Deeper with Embedded FPGA Platform for Convolutional Neural Network,” ISFP GA2016. 17
  • 19. FPGA와 타 디바이스의 비교 • FPGA의 이점 • 바꿔쓰기 가능(알고리즘 변경에 대응)→ASIC에 비해 이점 • 전력성능효율이 우수→CPU, GPU에 비해 이점 • FPGA의 단점 • CPU에 비해 → 비쌈 • GPU에 비해 → 일반적으로 느리고 개발기간이 길다. • ASIC에 비해 →비쌈, 전력효율 낮음 Binarized CNN의 도입 →고속화・메모리 줄이고 (=비용절감・저전력) 19
  • 20. 임베딩(HW)에 적합한 CNN︖ AlexNet VGG GoogLeNet ResNet Year 2012 2014 2014 2015 #Layers 8 19 22 152 Accuracy 16.4% 7.3% 6.7% 3.57% Inception (NinN) ‐‐‐ ‐‐‐ ✔ ‐‐‐ Kernel Size 11,5,3 3 7,1,3,5 7,1,3,5 FC Size 4096,4096, 1000 4096,4096, 1000 1000 1000 Normalization Local Response ‐‐‐ Local Response Batch 3.5%의 인식률 개선을 위하여, 다른 kernel size, 대량의 layer수를 사용할 필요가 ? → VGG를 선택 47
  • 21. CNN의 HW 구현 W1 W2 W3 W4 X X’ 가중치 유지 출력을 유지 (Ping-pong 메모리) X X’ X X’ X 48 MAC 전개 & pipe line • 각 layer를 다음과 같이 나누어 실행, 각 layer에 pipe line처리
  • 22. FPGA구현에 있어서 Bottle-neck • VGG의 프로파일 해석 • Convolution layer → MAC의 부족 • Pool 결합층 → 메모리 부족 J. Qiu et al., “Going Deeper with Embedded FPGA Platform for Convolutional Neural Network,” ISFPGA2016. 49
  • 23. Binarized 뉴럴넷 • 두값(-1/+1)의 곱 • 곱하기를 XNOR 게이트로  같은 값이면 1, 아니면 0 x1 x2 Y ‐1 ‐1 1 ‐1 +1 ‐1 +1 ‐1 ‐1 +1 +1 1 x1 x2 Y 0 0 1 0 1 0 1 0 0 1 1 1 23
  • 24. 24 Low-precision CNN 관련논문 • Binary Connected [NIPS, Dec., 2015] • Binarized Neural Networks [arXiv, Mar., 2016] • Ternary-Net [arXiv, May, 2016] → Intel이 ResNet을 구현. 인식정확도 2% 저하로 GPU (Titan X)과 동일한 성능[ISFPGA, Feb., 2017] • Local Binary CNNs [Aug., 2016] • XNOR-Net [ECCV, Oct., 2016]
  • 25. XNOR에 의한 Binarized CNN fsgn(Y) Y z x2 w0(Bias) w1 x1 w2 wn xn ... 25
  • 26. Binarized CNN의 효과 fsgn(Y) Y z x2 w0(Bias) w1 x1 w2 wn xn ... 곱셈기를 XNOR로 대체→회로면적을 줄임 4〜8 bit를 binarized로 바꾸기 →메모리대역을 압축 53
  • 27. 27 Binarized on FPGA가 트렌드 • FPT2016 (12월) • E. Nurvitadhi (Intel) et al., “Accelerating Binarized Neural Networks: Comparison of FPGA, CPU, GPU, and ASIC” • H. Nakahara (東⼯⼤), “A Memory-Based Realization of a Binarized Deep Convolutional Neural Network” • ISFPGA2017 • Ritchie Zhao et al., “Accelerating Binarized Convolutional Neural Networks with Software-Programmable FPGAs” • Y. Umuroglu (Xilinx) et al., FINN: A Framework for Fast, Scalable Binarized Neural Network Inference • H. Nakahara, H. Yonekawa (東⼯⼤), et al. “A Batch Nor malization Free Binarized Convolutional Deep Neural N etwork on an FPGA” • Y. Li et al., “A 7.663-TOPS 8.2-W Energy-efficient FPGA Accelerator for Binary Convolutional Neural Networks,” • G. Lemieux, “TinBiNN: Tiny Binarized Neural Network Overlay in Less Than 5,000 4-LUTs,”
  • 28. Binarized에 의한 메모리 감소량@VGG11 19383 float int8 Binary 10 6 4850 338 14 float int8 Binary 18Kb BRAM DSP48E Block 7743 5586 4064 float int8 Binary FF (Flip Flop) 14006 7690 float int8 Binary LUT (Look‐Up Table) 11503 Bottle neck 28
  • 29. 메모리 감소→ 전력효율 향상 • 메모리와 계산기의 거리 ∝ 전력 →FPGA의 on-chip 메모리에 수용이 가능하면 전력효율↑ E. Joel et al., “Tutorial on Hardware Architectures for Deep Neural Networks,” MICRO‐49, 2016.58 Binarized CNN의 전략
  • 30. 메모리 감소 → on-chip화 • FPGA의 on-chip 메모리 • BRAM (Block RAM) → 수백〜1000개 정도 • Distributed RAM (LUT) → 수만〜10만개 정도 → 개별 용량은 작지만(64bit), 개수를 많게 해서 광대역화 cf. Jetson TX1(GPU) LPDDR4, 25.6GB/s 1만 LUT@100MHz → 125GB/s 고위합성에서는 #pragma HLS unroll를 입력해서 (factor=N (N은 정수)으로 조정도 가능) 59 LUT LUT LUT LUT LUT LUT LUT LUT LUT LUT LUT LUT
  • 31. 인식정확도 저하에 대하여 • Batch Normalization을 도입 0 20 40 60 80 100 Classificationerror(%) 1 80 160 200 # of epochs 0 20 40 60 80 100 Classificationerror(%) 1 80 # of epochs 160 200 단순히 binarized한 경우 제안방법 (a) float32 bit precision CNN (b) Binarized CNN 약 6%의 차이(VGG‐16를 사용) H. Nakahara et al., “A memory‐based binarized convolutional deep neural network,” FPT2016, pp285‐288, 2016. 31
  • 32. Binarized CNN Batch Normalization이 효과적인 이유 Y fsgn(Y) ‐1 +1 XXXXXXOOOOOO 0 Y fsgn(Y) ‐1 +1 XXXXXXOOOOOO 0 +1 ‐1 scaling(y)에 의한 폭 2로 정규화 shift(þ)에 의한 ‐1〜+1로 제한 32
  • 34. 실제 구현시… 63 module hoge( input a, b, c; output d ); assign d = (a & b) | c; endmodule 실현하고자하는 논리회로를 하드웨어 기술언어로 대량의 HDL로 쓰기 (Verilog HDL / VHDL) Y = X.dot(W)+B 학습한 딥 뉴럴네트웍의 행렬연산을 간단하게 1줄로
  • 35. 기술량∝설계시간 Y = X.dot(W)+B Python: 1줄 C/C++: 10줄 35 Verilog-HDL: 66줄
  • 36. High-Level Synthesis (HLS) • C/C++로 설계→소규모 업체에서도 HW를 설계 가능 • Binarized Neural Net을 1개월만에 제작 짧은 개발기간(Turn around time, TAT)이란 FPGA의 장점을 이끌어냄 36
  • 37. HLS의 flow (종래에는 이러한 작업을 모두 사람 손으로 수행) Input Behavioral Spec. Dataflow Scheduling Data‐path generation Controller (FSM) Generation Mapping to resources (Binding) 37
  • 38. Deep Convolutional Neural Network의 HLS 임베딩 • 의존성이 없는 7 중 loop의 최적화  HLS에서도 쉽게 최적화 ... ... 120 nodes 10 nodes 5x5 16 F. maps 16 F.maps 10x10 6 F. maps 14x14 6 Feature maps 28x28 Gray scale image 32x32 5x5 2x2 5x5 2x2 5x5 1 2 1 2 4 2 1 2 1 ① ② ③ ④ ⑥ ⑦ ⑤ 67
  • 39. HLS에 의한 자동 합성 행렬연산 라이브러리의 중심 을 C/C++로 작성 하지만 HDL보다는 추상적 Y=0; for(i=0; i < m; i++){ f or( j = 0; j < n; j++){ Y += X[i][j]*W[j][i]; } } FPGA업체의 HLS tool이 HDL 을 작성 ↓ 기존의 방법 으로 FPGA로 구현 자동합성 DNN을 기존 frame work 로 설계 (학습은 GPU로) 학습 된 CNN을 이진화로 변환 (개발중) 68
  • 40. 指⽰⼦による性能向上(1) • オリジナルのループ→逐次実⾏ • #pragma HLS unroll → 演算器展開 • #pragma HLS pipeline → パイプライン化 for ( int i = 0; i < N; i++){ op_Read; op_MAC; op_Write; } for ( int i = 0; i < N; i++){ #pragma HLS pipeline op_Read; op_MAC; op_Write; } for ( int i = 0; i < N; i++){ #pragma HLS unroll 3 op_Read; op_MAC; op_Write; } RD MAC WR RD MAC WR RD MAC WR RD MAC WR RD MAC WR RD MAC WR R D MAC WR R D MAC WR スループット: 3サイクル レイ テンシ: 3サイクル 演算量: 1/3 データ/サイクル スループット: 3サイクル レ イテンシ: 3サイクル 演算 量: 1 データ/サイクル スループット: 1サイクル レ イテンシ: 3サイクル 演算 量: 1 データ/サイクル 69
  • 41. 指⽰⼦による性能向上(2) • #pragma HLS unroll → 演算器展開 • #pragma HLS pipeline → パイプライン化 Int X[100]; #pragma HLS array partition for ( int i = 0; i < N; i++){ #pragma HLS pipeline op_Read; op_MAC; op_Write; } Int X[100]; #pragma HLS array partition for ( int i = 0; i < N; i++){ #pragma HLS unroll 3 op_Read; op_MAC; op_Write; } RD MAC WR R D MAC WR R D MAC WR スループット: 3サイクル レ イテンシ: 3サイクル 演算 量: 1 データ/サイクル スループット: 1サイクル レ イテンシ: 3サイクル 演算 量: 1 データ/サイクル 70 Mem Mem Mem Mem Mem Mem RD MAC WR RD MAC WR RD MAC WR RD MAC WR Mem Mem Mem Mem
  • 42. CNNにおける適切な指⽰⼦ • 外部メモリと内部メモリでループを分割 • 内部メモリ︓展開した演算器をパイプライン化 ISFPGA2015, pp. 161‐170, 2015. RAM RAM RAM C. Zhang et al., “Optimizing FPGA‐based Accelerator Design for Deep Convolutional Neural Networks,” ++ ++ + … … パイプライン レジスタ 71
  • 43. 指⽰⼦の効果 46.3 11.810.6 2.2 1.5 3.6 1.9 2.1 4.4 28.1 No pragma Unroll Unroll+Pipeline リソース利⽤率 (%) BRAM18K DSP48E 87.1 FF LUT 90.4 0.16 0.48 119.57 0.10 1.00 10.00 100.00 1000.00 No pragma Unroll Unroll+Pipeline FPS (Frames per second) • リソース利⽤率と性能はトレードオフ • 内部メモリを削減すれば更に性能向上可能 72FPGAのリソース量∝推定のスピード
  • 45. 평가환경 • FPGA: Digilent사 Nexys4 Video보드 • Xilinx사 Artix-7 FPGA탑재 XC7A200T-1SBG484C • LUT수: 129000 • 18Kb BRAM수: 730 • DSP48E수: 740 • 512Mb DDR3 Memory • MicroBlaze 내장 • CNN설계: Chainer 1.20.0 • VGG16을 Cifar10으로 학습 • GeForce Titan X 45
  • 46. GPU, CPU와의 비교 Platform Device Artix 7Quad‐core ARM Cortex‐A57 1.9 GHz 0.2 7 0.03 256‐core Maxwell GPU 998 MHz 116.9 17 6.87 Clock Freq. FPS Power [W] Efficie ncy [FPS/W] Accu racy [%] 92.35 100 MHz 119.5 3 39.83 87.45 NVidia Jetson TX1 46 Digilent Nexys4 Video
  • 47. 인식정도에 대하여 • 알고리즘과 데이터로 커버 가능 Joseph Redmon, Ali Farhadi, “YOLO9000: Better, Faster, Stronger,” • 이진화 VGG16 를 사용해서 ImageNet의 서브셋을 학습→3일에 90.3% 인식 정확도 47
  • 49. 49 결론 • HW용 CNN의 트렌드를 소개 • 기술은 정신없이 발전 중 • 올해에도 중요한 발표가 있을 가능성이 매우 높음 • Binarized CNN의 소개 • 연산기를 XOR 게이트, 메모리를 내부 메모리로 구현 • FPGA에서도 고성능이면서 저전력화를 달성 • HLS에 의해 단기간에 설계 • Deep learning framework과의 연대로 소규모 업체에서도 고성능 HW 개발 가능 • FPGA의 리소스량∝성능, 하지만 전력・비용과의 trade-off • GPU, CPU와의 비교 • GPU보다 고속이며, 인식정도는 5% 정도 낮음, 전력효율은 5.5배 • 인식정도 저하는 학습기법을 통해 커버가능