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
学習型データ構造:機械学習を内包する新しいデータ構造の設計と解析
matsui_528
5
2.3k
Stealing LUKS Keys via TPM and UUID Spoofing in 10 Minutes - BSides 2025
anykeyshik
0
170
Unsupervised Domain Adaptation Architecture Search with Self-Training for Land Cover Mapping
satai
3
460
J-RAGBench: 日本語RAGにおける Generator評価ベンチマークの構築
koki_itai
0
1.1k
製造業主導型経済からサービス経済化における中間層形成メカニズムのパラダイムシフト
yamotty
0
390
LLM-Assisted Semantic Guidance for Sparsely Annotated Remote Sensing Object Detection
satai
3
230
Tiaccoon: Unified Access Control with Multiple Transports in Container Networks
hiroyaonoe
0
240
長期・短期メモリを活用したエージェントの個別最適化
isidaitc
0
360
Language Models Are Implicitly Continuous
eumesy
PRO
0
360
Satellites Reveal Mobility: A Commuting Origin-destination Flow Generator for Global Cities
satai
3
280
Community Driveプロジェクト(CDPJ)の中間報告
smartfukushilab1
0
110
まずはここから:Overleaf共同執筆・CopilotでAIコーディング入門・Codespacesで独立環境
matsui_528
3
960
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
44k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
39
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
37
Rails Girls Zürich Keynote
gr2m
95
14k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
The Invisible Side of Design
smashingmag
302
51k
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 •やれば動くし速くなる