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
1.2k
TFHEのための多項式乗算入門
nindanaoto
February 08, 2020
Tweet
Share
More Decks by nindanaoto
See All by nindanaoto
準同型暗号による バーチャルセキュアプラットフォーム の開発/Development of Virtual Secure Platform
nindanaoto
3
2k
準同型暗号による バーチャルセキュアプラットフォーム の開発
nindanaoto
1
350
Other Decks in Research
See All in Research
Combining Deep Learning and Street View Imagery to Map Smallholder Crop Types
satai
3
370
Sat2City:3D City Generation from A Single Satellite Image with Cascaded Latent Diffusion
satai
4
440
Nullspace MPC
mizuhoaoki
1
560
高畑鬼界ヶ島と重文・称名寺本薬師如来像の来歴を追って/kikaigashima
kochizufan
0
110
Panopticon: Advancing Any-Sensor Foundation Models for Earth Observation
satai
3
510
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
120
AIスパコン「さくらONE」の オブザーバビリティ / Observability for AI Supercomputer SAKURAONE
yuukit
2
1.1k
長期・短期メモリを活用したエージェントの個別最適化
isidaitc
0
370
生成AI による論文執筆サポート・ワークショップ ─ サーベイ/リサーチクエスチョン編 / Workshop on AI-Assisted Paper Writing Support: Survey/Research Question Edition
ks91
PRO
0
130
第二言語習得研究における 明示的・暗示的知識の再検討:この分類は何に役に立つか,何に役に立たないか
tam07pb915
0
570
ロボット学習における大規模検索技術の展開と応用
denkiwakame
1
180
POI: Proof of Identity
katsyoshi
0
120
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
83
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
110
New Earth Scene 8
popppiees
0
1.3k
The Curse of the Amulet
leimatthew05
0
5.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
2.8k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
130
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
0
970
Embracing the Ebb and Flow
colly
88
4.9k
Six Lessons from altMBA
skipperchong
29
4.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
590
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
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 •やれば動くし速くなる