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
TFHEのための多項式乗算入門
Search
nindanaoto
February 08, 2020
Research
2
840
TFHEのための多項式乗算入門
nindanaoto
February 08, 2020
Tweet
Share
More Decks by nindanaoto
See All by nindanaoto
準同型暗号による バーチャルセキュアプラットフォーム の開発/Development of Virtual Secure Platform
nindanaoto
3
1.7k
準同型暗号による バーチャルセキュアプラットフォーム の開発
nindanaoto
1
280
Other Decks in Research
See All in Research
一人称視点映像解析の基礎と応用(CVIMチュートリアル)
takumayagi
0
800
医療分野におけるLLMの現状と応用可能性について
kento1109
5
550
[第55回 NLPコロキウム] コンピュータビジョン分野での評価設計と分析の研究について
otani_mayu
0
130
SSII2024 [OS1] 画像認識におけるモデル・データの共進化
ssii
PRO
0
380
ICLR2024 LLMエージェントの研究動向
masatoto
13
9.1k
第28回 著者ゼミ:Identification of drug responsible glycogene signature in liver carcinoma from meta-analysis using RNA-seq data
ktatsuya
2
200
論文紹介 AST: Audio Spectrogram Transformer
kazu07
0
190
20240719_第2回熊本の交通を語る会
trafficbrain
0
180
WikipediaやYouTubeにおける論文参照 / joss2024
corgies
1
210
「人間にAIはどのように辿り着けばよいのか?ー 系統的汎化からの第一歩 ー」@第22回 Language and Robotics研究会
maguro27
0
410
単語埋め込みを用いた日本語オノマトペにおける有声・無声子音の対立による音象徴の分析
shunnosukemotomura
0
390
自動運転・AIシステムの問題を賢く探す・賢く直す / Smart Search & Repair Techniques for Automated Driving Systems and AI Systems
ishikawafyu
0
140
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1026
450k
Side Projects
sachag
451
42k
Building an army of robots
kneath
301
42k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Typedesign – Prime Four
hannesfritz
37
2.2k
Fireside Chat
paigeccino
25
2.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
25
6.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
35
6.3k
Web Components: a chance to create the future
zenorocha
307
41k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
18
1.2k
Transcript
TFHEのための 多項式乗算入門 松岡 航太郎 @nimdanaoto
自己紹介 •京都大学工学部 電気電子工学科3回生 •理論担当
なぜ多項式乗算? •TFHEにおいて最も重い処理 •数学的に様々な最適化が可能 •アーキテクチャにも強く依存
多項式乗算 •今回は整数係数多項式に限る • 3 + 1 ∗ 2 + 3
= 62 + 11 + 3 •31 ∗ 23 = 713
筆算 •(2) 3 + 1 × 2 + 3 9
+ 3 62 + 2 62 + 11 + 3
フーリエ変換による高速化 •フーリエ変換の畳み込み定理 ∗ = ℱ−1(ℱ ⋅ ℱ ) •FFT(高速フーリエ変換) (
)
= =0 −1 () = =0 −1 −
2 −1 () = 1 =0 −1 ()() 2 = 0,1, … − 1
−1 ⋅ = 1 =0 −1 =0 −1
=0 −1 − 2 =0 −1 − 2 2 = =0 −1 =0 − + =+1 −1 −+ ∵ =0 −1 − 2 = ቊ ≡ 0 0 ℎ
もっと頭のいい解決法 •負巡回もあれば並列に •2N一つではなくN二つ •虚数部にもデータを詰めたい
None
TFHEが独自FFTを使う理由 (しかもアセンブラ) •FFTWは複素数の配列 •メモリアクセス局所性は有利 •実数と虚数部を別に •並び替えなくてよい
倍精度の限界 •log2 ( |∞ |∞ ) < 53 •収まるように設計する必要
GPUの場合は? •倍精度演算機は一般に貧弱 •単精度の32分の1とか •INT32は単精度と同等
NTT(数論変換) •ある法P(素数)の下で考える •原始N乗根が存在する •211−1 = 1024 ≡ 1 11 •これは円周群に同型
どんなPが良い? •cuFHEでは = 264 − 232 + 1 •剰余がとりやすい •7−1
≡ 1 •7 5 192 (−1) ≡ 2
最後に •(多項式)乗算は奥が深い • ≤数万ならToom-Cook •やれば動くし速くなる