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
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
po3rin
September 11, 2026
Programming
4.7k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
リポジトリ
https://github.com/po3rin/gocon2026-simd-search
po3rin
September 11, 2026
More Decks by po3rin
See All by po3rin
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
540
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
2.4k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
1.6k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
540
嗚呼、当時の本番環境の状態で AI Agentを再評価したいなぁ...
po3rin
0
630
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
7
2.4k
自作LLM Native GORM Pluginで実現する AI Agentバックテスト基盤構築
po3rin
2
1.2k
麻雀点数計算問題生成タスクから学ぶ Single Agentの限界と Agentic Workflowの底力
po3rin
5
3.3k
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
1.3k
Other Decks in Programming
See All in Programming
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
1
490
AWSに止められる覚悟してますか?
morizo_1984
2
480
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.6k
Security issues being discussed on Web Platforms
petamoriken
0
1.3k
JRuby: Past, Present, and Future
headius
0
210
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
320
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
140
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
720
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
220
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
So, you think you're a good person
axbom
PRO
2
2.2k
Fireside Chat
paigeccino
43
4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Transcript
Go × SIMDで高速化するベクトル検索 ルーフラインモデルでSIMDが効く境界を探れ! Hiromu Nakamura (@po3rin)
Hiromu Nakamura Hiromu Nakamura AI-UX/MLOps TechLead AI/MLOps Engineer. Interested in
Information Retrieval Nagoya Univ ~ Graduate School of Science M3, Inc. AI・ML Team MLOps & Data Engineering po3rin LayerX Inc. AI-UX/MLOps TechLead
1 Accelerating Vector Search with Go and SIMD ワークショップ用Repository https://github.com/po3rin/gocon2026-simd-search
GitHub CodeSpaces だけ先に起動させておきましょう (立ち上げに少し時間がかかるため)。
Accelerating Vector Search with Go and SIMD 1. Introduction
2 Accelerating Vector Search with Go and SIMD Go ×
SIMD ワークショップへようこそ!!!
3 Accelerating Vector Search with Go and SIMD お題: 10万件のベクトル検索を高速化してください
4 Accelerating Vector Search with Go and SIMD ベクトル検索 (1)
5 Accelerating Vector Search with Go and SIMD ベクトル検索 (2)
6 Accelerating Vector Search with Go and SIMD これをGoに入ったSIMDで高速化するぞ!!
Accelerating Vector Search with Go and SIMD 2. What is
SIMD ?
Accelerating Vector Search with Go and SIMD 7 SIMDって何? (1)
内積を普通に書くとこうなります。 fl 1命令で oat32 を1個。これをスカラ処理と呼びます。
8 Accelerating Vector Search with Go and SIMD SIMDって何? (2)
SIMD(Single Instruction, Multiple Data)は、 1 命令で複数のデータを まとめて処理する CPU の機能。 fl 256bit のレジスタには oat32 が 8 個入ります。
9 Accelerating Vector Search with Go and SIMD Go 1.27
の SIMD パッケージ (1) GOEXPERIMENT=simd を付けると simd/archsimd が使えます(実験的機能)。 アセンブリも cgo も書かず、メソッド呼び出しがほぼそのまま 1 つの CPU 命令になりま す。FMA(Fused Multiply-Add)1 命令で 8 要素ぶんが片付きます。
Accelerating Vector Search with Go and SIMD archsimd で覚えることは 3
つ ① 型がデータの形 Float32x8 = oat32 を 8 レーン = 256bit。型を選ぶことが、使う命令幅 とレーン数を選ぶことになる ② メソッド = 1 命令 MulAdd → VFMADD、DotProductPairs → VPMADDWD ③ 実行時にガード 未対応 CPU で呼ぶと SIGILL で落ちる。archsimd.X86.AVX2() などのガー ドで確認してから使う (左が Go のメソッド名、右はコンパイルされて出てくる x86 の機械語の命令名) 対応は amd64、arm64、WebAssembly。 fl 10
11 Accelerating Vector Search with Go and SIMD ポータブルな simd
パッケージ 1.27 で入った simd パッケージは型名からレーン数が消えます (Float32x8 -> Float32s) レーン数は実行時に CPU が決めます。
Accelerating Vector Search with Go and SIMD 3. Accelerating Vector
Search with Go and SIMD
12 Accelerating Vector Search with Go and SIMD SIMD を使えば速くなるとは限らない
😭
13 Accelerating Vector Search with Go and SIMD 例えば、、、メモリ帯域の上限
14 Accelerating Vector Search with Go and SIMD やみくもに SIMD
を足しても、効かないことのほうが多い。 何で詰まっているかを測ることが重要 そのための道具がルーフラインモデル🚗
15 Accelerating Vector Search with Go and SIMD ルーフラインモデル (1)
ルーフ(上の線)がマシンが出せる速度の限界。左がメモリ帯域で決まる斜線、右が演算ピークで決まる水平線。 ルーフはマシンによって決まる。ルーフの計算方法はワークショップに記載。
Accelerating Vector Search with Go and SIMD 16 内積のスカラ全探索はルーフラインモデルでどこか? ベースライン
2.15 GFLOP/s は、メモリ帯域から決まる上限(約 10)にすら届いていない。 算術強度 … メモリから 1 バイト運ぶごとに何回計算するか * 計算:掛け算 1 回 + 足し算 1 回 = 2 op * 運ぶ量:DRAM から運ぶ要素は oat32 なので 4 byte fl fl fl fl 算術強度 = 2 op ÷ 4 byte = 0.5 op/byte
17 Accelerating Vector Search with Go and SIMD SIMDにしてもメモリ律速で止まる!! 全探索は
35.7 ms → 7.9 ms(4.5x)。速くなったがまだ上があるぞ。
18 Accelerating Vector Search with Go and SIMD 演算律速のエリアへ動かす ワークショップでは右上を目指していく!!
Accelerating Vector Search with Go and SIMD 4. Workshop
19 Accelerating Vector Search with Go and SIMD SIMDを動かしてみよう!ルーフラインモデルで高速化してみよう docs/workshop/setup.md
の手順で Codespaces を起動して 教材を動かしてみましょう!!
Accelerating Vector Search with Go and SIMD 4. まとめ
20 Accelerating Vector Search with Go and SIMD 今日学んだこと *
Go + SIMD の使い方。 * ルーフラインモデルの使い方 * (検索の世界の入り口)
21 Accelerating Vector Search with Go and SIMD 「SIMD ってやつを使ってるのに速くならない😭」と諦めず、
計測してボトルネックを突破していく、 そうやって SIMD と仲良くしていきましょう。
Go × SIMDで高速化するベクトル検索 ルーフラインモデルでSIMDが効く境界を探れ! Hiromu Nakamura (@po3rin)