Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
K Nearest Neighbourhood on GPU
Search
Ciel
July 24, 2014
Research
0
40
K Nearest Neighbourhood on GPU
K Nearest Neighbourhood using inverted list on GPU
Ciel
July 24, 2014
Tweet
Share
More Decks by Ciel
See All by Ciel
LLVM IR & Optimisation Techniques
imwithye
0
150
Other Decks in Research
See All in Research
地理空間情報と自然言語処理:「地球の歩き方旅行記データセット」の高付加価値化を通じて
hiroki13
1
240
大規模言語モデルを用いたニュースデータのセンチメント判定モデルの開発および実体経済センチメントインデックスの構成
nomamist
1
180
小ねぎ調製位置検出のためのインスタンスセグメンテーション
takuto_andtt
0
120
Weekly AI Agents News! 1月号 アーカイブ
masatoto
1
270
rtrec@dbem6
myui
6
750
研究テーマのデザインと研究遂行の方法論
hisashiishihara
5
1.1k
VAGeo: View-specific Attention for Cross-View Object Geo-Localization
satai
3
220
[輪講] Transformer Layers as Painters
nk35jk
4
760
CARMUI-NET:自動運転車遠隔監視のためのバーチャル都市プラットフォームにおける通信品質変動機能の開発と評価 / UBI85
yumulab
0
190
ラムダ計算の拡張に基づく 音楽プログラミング言語mimium とそのVMの実装
tomoyanonymous
0
450
EarthMarker: A Visual Prompting Multimodal Large Language Model for Remote Sensing
satai
3
190
NeurIPS 2024 参加報告 & 論文紹介 (SACPO, Ctrl-G)
reisato12345
0
420
Featured
See All Featured
Bash Introduction
62gerente
612
210k
How STYLIGHT went responsive
nonsquared
100
5.5k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Code Review Best Practice
trishagee
67
18k
Making the Leap to Tech Lead
cromwellryan
133
9.3k
The Cult of Friendly URLs
andyhume
78
6.3k
Building Adaptive Systems
keathley
41
2.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Transcript
Genie-and- Lamp-GPU Yiwei Gong K Nearest Neighbourhood using inverted list
on GPU
K Nearest Neighbourhood Fundamental Operator in Data Mining Classification 0
5 10 15 20 0 3 6 9 12 Regression Collaborative Filtering You may like * Apple * Google * Amazon
SELECT SEX M AGE 18 SALARY 2900 Sex Age Salary
… M 20 3000 … F 17 3600 … M 18 4000 … F 19 2900 … K Nearest Neighbourhood A running example
SELECT SEX M AGE 18 SALARY 2900 K Nearest Neighbourhood
Sex Age Salary … M 20 3000 … F 17 3600 … M 18 4000 … F 19 2900 … A running example
DIM + VALUE SEX+M SEX+F AGE+18 AGE+19 … 2 0
3 1 2 Invert list: row_id SELECT SEX M AGE 18 SALARY 2900 3 How do we store the inverted list table on GPU?
DIM + VALUE Inverted List … … AGE+17 1 AGE+18
2, 3 AGE+19 4 AGE+20 9, 10 AGE+21 11 … … Row ID Count AGG … … … 1 0 0 2 0 0 3 0 0 4 0 0 … … … SELECT AGE 18±1 Step 1: Matching & Aggregation
DIM + VALUE Inverted List … … AGE+17 1 AGE+18
2, 3 AGE+19 4 AGE+20 9, 10 AGE+21 11 … … Row ID Count AGG … … … 1 0 0 2 1 1*0.5 3 1 1*0.5 4 0 0 … … … SELECT AGE 18±1 Step 1: Matching & Aggregation
DIM + VALUE Inverted List … … AGE+17 1 AGE+18
2, 3 AGE+19 4 AGE+20 9, 10 AGE+21 11 … … Row ID Count AGG … … … 1 1 1*0.5 2 1 1*0.5 3 1 1*0.5 4 1 1*0.5 … … … SELECT AGE 18±1 Step 1: Matching & Aggregation
DIM + VALUE Inverted List … … SALARY+2500 NULL SALARY+3000
0, 3 SALARY+3500 1 SALARY+4000 2 SALARY+4500 4,5 … … SELECT SALARY 2900±1000 Row ID Count AGG … … … 1 1 0.5 2 1 0.5 3 1 0.5 4 1 0.5 … … … Step 1: Matching & Aggregation
DIM + VALUE Inverted List … … SALARY+2500 NULL SALARY+3000
0, 3 SALARY+3500 1 SALARY+4000 2 SALARY+4500 4,5 … … Row ID Count AGG … … … 1 1 0.5 2 1 0.5 3 2 1*0.3+0.5 4 1 0.5 … … … SELECT SALARY 2900±1000 Step 1: Matching & Aggregation
Block 1 Block 2 Block 2 SEX AGE SALARY GPU
Parallel Matching
Row ID Count AGG … … … 1 1 0.5
2 1 0.5 3 2 0.8 4 1 0.5 … … … K Selection What is the fast K Selection algorithm? Step 2: K Selection
R_id R_id R_id R_id R_id R_id R_id D+V1 D+V2 D+V3
invert_list_idx invert_list_table end_index First approach to store the inverted list table on GPU GPU
Host Device Map Main Memory ! KEY GPU Memory !
VALUE
dimension + value1 dimension + value2 Invert_list_idx Invert_list_table
None
Mapping C P U ! M E M O R
Y
Mapping C P U ! M E M O R
Y
Mapping C P U ! M E M O R
Y MAP(KEY, INDEX) device_vector
Mapping C P U ! M E M O R
Y raw_pointer get(key) map(key, value) freeze() ratio()
Bucket Top K Selection Algorithm 2 4 1 5 2
1 K = 10 First 7 results Bucket_Num = (Value - MIN) / (MAX - MIN) * Number_Of_Buckets
Bucket Top K Selection Algorithm Accept Multi Queries K =
2 K = 5 K = 6 K = 3
#define NAME “YIWEI GONG” #define UNIVERSITY “NTU” #define EMAIL “
[email protected]
”
#define BLOG “http://ciel.im” #define ME “A stupid programmer” THANK YOU
Block 1 Block 2 Block 3 Block 4 Block 5
Block 6 GPU Thread 1 Thread 2 Thread 3 Thread 4 Thread 5 Thread 6 Block