+++ Treffen Sie uns auf der SCCON in Berlin, 13.–15. Oktober +++ Erleben Sie Kolibri, unser neues souveränes Modell, live im Einsatz für den öffentlichen Sektor +++ Halle 26A, Stand 126 +++

Aleph Alpha
Roofline-Diagramm zur Veranschaulichung der Inferenz-Performance
Research

Eric Schreiber

Inferenzgeschwindigkeit von Grund auf verstehen

Einleitung

Validation CHEETAH

Was macht schnelle Inferenz aus?

Roofline Model
Prefill vs Decode Time Share

Prefill

Prefill Compute Scaling

Vorsicht mit durchschnittlichen TTFT-Zahlen

TTFT‾Strategie 1=BB×B×tprefill=B×tprefill,TTFT‾Strategie 2=1B×∑i=1Bi×tprefill=1B×B(B+1)2×tprefill=B+12×tprefill.\begin{aligned} \overline{TTFT}_\text{Strategie 1} &= \frac{B}{B} \times B \times t_\mathit{prefill} = B \times t_\mathit{prefill}, \\ \overline{TTFT}_\text{Strategie 2} &= \frac{1}{B} \times \sum_{i=1}^B i\times t_\mathit{prefill} = \frac{1}{B}\times \frac{B(B+1)}{2} \times t_\mathit{prefill} = \frac{B+1}{2} \times t_\mathit{prefill}. \end{aligned}

Decode

tdecode≈Gewichte+KV-CacheSpeicherbandbreitet_{\mathit{decode}} \approx \frac{\text{Gewichte} + \text{KV-Cache}}{\text{Speicherbandbreite}}
Decode Memory Loading
Batch Amortisation
Four Decode Regimes

Kleine Batch-Größe, kurze Sequenzlänge

Große Batch-Größe, kurze Sequenzlänge

Kleine Batch-Größe, lange Sequenzlänge

Große Batch-Größe, lange Sequenzlänge

Decode Bottleneck Heatmap

Was ändert sich bei MoE-Modellen?

Expected Unique Routed Experts

Prefill oder Decode: Wofür optimieren?

Anhang: CHEETAH

Was CHEETAH modelliert

tmem,c=DcWmem ηmem,c,tcompute,c=FcWcompute ηcompute,c,tbottleneck,c=max⁡(tmem,c, tcompute,c)t_{\text{mem},c} = \frac{D_c}{W_{\text{mem}}}\,\eta_{\text{mem},c}, \qquad t_{\text{compute},c} = \frac{F_c}{W_{\text{compute}}}\,\eta_{\text{compute},c}, \qquad t_{\text{bottleneck},c} = \max(t_{\text{mem},c},\, t_{\text{compute},c})
tcomm=α⋅VWcomm ηcommt_{\text{comm}} = \frac{\alpha \cdot V}{W_{\text{comm}}}\,\eta_{\text{comm}}
Algorithmus All-Reduce All-Gather
Ring2(n−1)/n2(n-1)/n(n−1)/n(n-1)/n
Tree2log⁡2n2\log_2 n—
Butterflylog⁡2n\log_2 n—
tcomm=α⋅V⋅ηcomm⋅max⁡(nnodes−1nnodes⋅1Winter,1nnodes⋅1Wintra).t_{\text{comm}} = \alpha \cdot V \cdot \eta_{\text{comm}} \cdot \max\left( \frac{n_{\text{nodes}}-1}{n_{\text{nodes}}} \cdot \frac{1}{W_{\text{inter}}}, \frac{1}{n_{\text{nodes}}} \cdot \frac{1}{W_{\text{intra}}} \right).
tlayer={max⁡(tbottleneck,tcomm)U¨berlappen der Kommunikationtbottleneck+tcommsonst.t_{\text{layer}} = \begin{cases} \max(t_{\text{bottleneck}}, t_{\text{comm}}) & \text{Überlappen der Kommunikation}\\ t_{\text{bottleneck}} + t_{\text{comm}} & \text{sonst} \end{cases}.
ttotal=∑ℓ=1Ltlayer,ℓ+L τlayer+τglobal+τbatch⋅B.t_{\text{total}} = \sum_{\ell=1}^{L} t_{\text{layer},\ell} + L\,\tau_{\text{layer}} + \tau_{\text{global}} + \tau_{\text{batch}}\cdot B.
Bmax=MGPU−MModelS⋅Mper-seq,B_{\text{max}} = \frac{M_{\text{GPU}} - M_{\text{Model}}}{S \cdot M_{\text{per-seq}}},

Einschränkungen und Annahmen

Validierung

CHEETAH compared to measured baselines on DeepSeek v3

Danksagungen

Fußnoten

Weitere Blogbeiträge