Parallelism
Issue Date: 2025-05-16 Sequence Parallelism: Long Sequence Training from System Perspective, Li+, ACL'23 Comment
入力系列をチャンクに分割して、デバイスごとに担当するチャンクを決めることで原理上無限の長さの系列を扱えるようにした並列化手法。系列をデバイス間で横断する場合attention scoreをどのように計算するかが課題になるが、そのためにRing Self attentionと呼ばれるアルゴリズムを提案している模様。また、MLPブロックとMulti Head Attentonブロックの計算も、BatchSize * Sequence Lengthの大きさが、それぞれ32*Hidden Size, 16*Attention Head size *
# of Attention Headよりも大きくなった場合に、Tensor Parallelismよりもメモリ効率が良くなるらしい。 Data Parallel, Pipeline Parallel, Tensor Parallel、全てに互換性があるとのこと(併用可能) そのほかの並列化の解説については ``` 関連(量子化関連研究): すごいメモだ…勉強になります</p>
- 大規模モデルを支える分散並列学習のしくみ Part1
</strong>
を参照のこと。
#Article
#Tutorial
#Metrics
#NLP
#LanguageModel
#LLMServing
#MoE(Mixture-of-Experts)
#SoftwareEngineering
#Selected Papers/Blogs
#Inference
#Batch
Issue Date: 2025-07-21
LLM推論に関する技術メモ, iwashi.co, 2025.07
Comment
メモリ (GB) = P × (Q ÷ 8) × (1 + オーバーヘッド)
- P:パラメータ数(単位は10億)
- Q:ビット精度(例:16、32)、8で割ることでビットをバイトに変換
- オーバーヘッド(%):推論中の追加メモリまたは一時的な使用量(例:KVキャッシュ、アクティベーションバッファ、オプティマイザの状態)
```
↑これ、忘れがちなのでメモ…
- [Paper Note] AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration, Ji Lin+, MLSys'24
- SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models, Guangxuan Xiao+, ICML'23
- GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers, Elias Frantar+, N/A, ICLR'23
</div>