Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CUDAでヒストグラム計算を書いてcupyにmergeしてもらった
Search
Ishita Takeshi
May 24, 2018
Programming
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CUDAでヒストグラム計算を書いてcupyにmergeしてもらった
Ishita Takeshi
May 24, 2018
More Decks by Ishita Takeshi
See All by Ishita Takeshi
Sparse Bundle Adjustment
ishitatakeshi
1
1.3k
3D rotation representation and its implementation
ishitatakeshi
0
400
Other Decks in Programming
See All in Programming
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.5k
Webの地図
yosuke_furukawa
PRO
6
5k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
510
setup-vp GitLab対応の裏側
naokihaba
0
140
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
100
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
App Intentsのビルドプロセスを支える技術
kntkymt
0
480
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
770
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
190
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
4
320
AWSに止められる覚悟してますか?
morizo_1984
2
490
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Raft: Consensus for Rubyists
vanstee
142
7.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Building AI with AI
inesmontani
PRO
1
1.3k
How to build a perfect <img>
jonoalderson
1
6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.2k
Transcript
CUDAでヒストグラム計算を書いて cupyにmergeしてもらった
石田 岳志 (@sonicair) 東京高専 専攻科 2年 (B4) • qiita.com/IshitaTakeshi •
日経ソフトウエア 2017年8月号 • 特許6306770 日経ソフトウエア 2017年8月号 日経BP社
やったこと PCANet (Chan et al. 2014) を実装した → CUDAでヒストグラム計算を書いた →
CuPyにpull requestを送った → mergeしてもらった
動機:PCANetの実装 • フィルタの重みをPCAで計算できるCNN • (論文によると) PCAなので学習が速い Chan, Tsung-Han, et al.
"PCANet: A simple deep learning baseline for image classification?." IEEE Transactions on Image Processing 24.12 (2015): 5017-5032.
None
CUDAで書こう!
Poolingが重い → CUDAで書こう! cupy.ElementwiseKernel • 並列処理をCUDAで直接書ける
戦略: 並列化してそれぞれ二分探索 2 0 1 2 3 4 5 6
-0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 -0.5 = bins[0] <= 2 <= bins[6] =
5.5 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 0 1 2 3 4 5 6 -0.5
0.5 1.5 2.5 3.5 4.5 5.5 3 = (0 + 6) / 2 bins[3] = 2.5
戦略: 並列化してそれぞれ二分探索 3 = (0 + 6) / 2 bins[3]
= 2.5 >= 2 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 1 = (0 + 3) / 2 bins[1]
= 0.5 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 1 = (0 + 3) / 2 bins[1]
= 0.5 <= 2 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 2 = (1 + 3) / 2 bins[2]
= 1.5 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 2 = (1 + 3) / 2 bins[2]
= 1.5 <= 2 0 1 2 3 4 5 6 -0.5 0.5 1.5 2.5 3.5 4.5 5.5
戦略: 並列化してそれぞれ二分探索 0 1 2 3 4 5 6 -0.5
0.5 1.5 2.5 3.5 4.5 5.5 2 -> 2
https://github.com/cupy/cupy/pull/298
https://github.com/cupy/cupy/pull/298
PFNの方々にご協力いただきました @unnonouno さん @okuta さん ありがとうございました
評価 GPU TITAN X (Pascal) CPU Intel Core i7-6700 Binの数,サンプル数
を 24~216 の範囲で 変化させて実行時間を調査
None
結果