Measured with synchronized CUDA events on call #2 (post-warmup, zero profiler overhead). Hover any segment for exact ms and share.
Layers 0, 1, 38, 39 are MM-Dense (~67.8 ms/layer); Layers 2–37 are Multi-Head LatentMoE (~108.5 ms/layer). Notice how uniform every layer is.
torch.profiler Rank 0)Actual GPU device kernels executing during one full 40-layer Preview forward pass.
Real microsecond GPU kernel spans extracted directly from trace_preview_call_rank0.json.gz. Switch between Layer 0 (MM-Dense, ~68 ms) and Layer 2 (MoE, ~109 ms) and zoom in/out.
Captured live on Rank 0 (3 local heads × 256 experts = 768 experts/layer, S_total = 121,008 tokens, top_k = 6). Mean = 2,836 tokens/expert.
gmm): zero cross-chip imbalance.d_expert=1280 via TP or use dynamic load-balanced placement.
Directly grounded in our measured 4×GB200 profile (4,181 ms/step, 121,008 tokens) and session-070b2470 v6e architecture.
| MAGI-2 Component | GB200 Measured | Share | TPU v6e Replacement (JAX / Pallas) | Risk & Key Insight |
|---|---|---|---|---|
| FlashAttention + Sink N=60,504 × 2 CFG, H=24, D=128 |
1,926.0 ms | 46.1% | Pallas Splash / Ring Attention + 4-line exact LSE sink rescale (logaddexp(lse, sink)) |
#1 Priority. 74% of total FLOPs! At v6e-16/32/64, Ring Attention over 8-chip X-axis cuts per-chip N to 7,563. |
| Triton Multi-Head MoE 12 heads × 256 exp, 256→1280→256, SwiGLU7 |
1,008.0 ms | 24.1% | Pallas Megablox gmm (ragged grouped matmul) + fused SwiGLU7 epilogue |
#2 Priority. 256 & 1280=5×256 align 100% with v6e 256×256 MXU. Mind CV=2.08 hot-expert skew if sharding inside a head! |
| Attn QKV / Gate / Out + 3D RoPE | 369.1 ms | 8.8% | Standard XLA jnp.einsum / dot_general + fused RoPE |
Trivial for XLA; fuses cleanly into BF16 MXU ops. |
| mHC (4-stream Sinkhorn-Knopp) + RMSNorm | 310.1 ms | 7.4% | Pure JAX fused XLA kernel (4×4 Sinkhorn unrolled in VPU registers) | Currently 310 ms in eager+Triton; XLA fusion on TPU VPU will shrink this significantly. |
| Shared + Modality Experts + 4 Dense MM | 279.0 ms | 6.7% | Standard XLA dense BF16 GEMMs | Low risk; zero dynamic shapes. |
| MoE Router + Top-6 + Global Sort | 161.8 ms | 3.9% | XLA jax.lax.top_k + radix/ragged bucket sort for gmm |
aten::topk alone was 135.5 ms on GPU — watch TPU VPU top-k + argsort cost on 121k×256! |
| CP Ulysses All-to-All | 91.8 ms | 2.2% | XLA static lax.all_to_all on ICI X-axis (or Ring Attention overlap) |
Tiny overhead (2.2%). Ring Attention on 2D Torus overlaps ICI comm with compute. |
| EP Head-Parallel All-to-All | 35.5 ms | 0.85% | XLA static lax.all_to_all ([S, H, 256] → [S·EP, H/EP, 256]) |
Validated! 100% static shape, <1% runtime, zero capacity-factor padding waste. |
| Refiner 3D Block-Window Attention 1080p: 120×68×64 latents, 5 steps |
N/A (needs flex-attn) | — | Pallas Block-Sparse Splash Attention (static 3D grid window mask) | Do NOT fall back to Python loop! On TPU, Splash Attention natively takes a static block mask (block_t/h/w_radius=2). |