Back to blog

Patterns behind Chaos: Forecasting Data Movement for Efficient Large-Scale MoE LLM Inference

针对大规模 MoE LLM 推理中数据移动瓶颈的首次全面 profiling 分析,提取六大系统级洞察并在未来晶圆级 GPU 架构上验证

Patterns behind Chaos: Forecasting Data Movement for Efficient Large-Scale MoE LLM Inference

一、论文概述

项目内容
标题Patterns behind Chaos: Forecasting Data Movement for Efficient Large-Scale MoE LLM Inference
作者Zhongkai Yu, Yue Guan, Zihao Yu, Chenyang Zhou, Zhengding Hu, Shuyi Pei, Yangwook Kang, Yufei Ding, Po-An Tsai
机构PRISM Center (SRC JUMP 2.0), UC Berkeley / Intel / NEC Research
论文arXiv:2510.05497
代码— (未开源)
发布2025-10-07
Profiling Traces公开可用(24,000+ requests)

核心贡献:

  1. 首次对大规模 MoE 模型(200B-1000B)进行数据移动为中心的全面 profiling,覆盖 DeepSeek V3、Llama4-128E、Qwen3-235B 三个 SOTA 模型,超过 24,000 个请求
  2. 从时间和空间两个维度提炼出六大系统级洞察(Insight 1-6),揭示看似随机的 expert selection 背后的可预测模式
  3. 以未来 GPU 架构设计为案例研究,基于 Insight 3 设计 task allocation algorithm,基于 Insight 1-2 构建 data-driven predictor,在晶圆级 GPU 上实现最高 6.6× 平均加速
  4. 在现有 GPU 系统上,基于洞察设计的 prefill-aware expert placement 算法实现最高 1.25× MoE 计算加速
  5. 公开 profiling traces,为后续 MoE 系统研究提供基础数据

二、核心思想

问题定义

大规模 MoE LLM(如 DeepSeek V3 671B/256 experts、Kimi K2 1000B/384 experts)的随机 expert selection 机制引入了巨大的数据移动开销,在多单元 LLM serving 系统中成为主导延迟因素。即使服务 Mixtral 8×7B 这样的小模型,在 2-4 GPU 小系统上数据移动已占端到端时间的 50% 以上。而 DeepSeek V3 有 32× 更多专家和 15× 更多参数,需要更大的系统(多节点、32+ GPU),数据移动更加频繁和昂贵。

如果数据移动完全不可预测,将在多单元系统部署中面临重大挑战:

  • 时间维度:专家组合爆炸使 prefetch、cache、replicate 变得不可能。DeepSeek V3 有 C2568=4,426,165,368C_{256}^{8} = 4,426,165,368 种专家选择组合
  • 空间维度:专家激活不平衡导致部分 compute unit 过载而其他 unit 空闲

解决方案概述

本文采用 model-focused 而非传统的 system-centric 方法:从模型本身的行为模式出发,提取与具体平台无关的系统级洞察,然后应用于不同架构的优化设计。

Profiling 方法论: 将 expert selection 行为分为两个基本视角(Fig. 1):

  • Temporal relations(时间关系):捕捉依赖时间的 expert selection 模式,支持单单元策略(prefetch、cache、data migration)
  • Spatial relations(空间关系):反映 expert selection 在系统上的分布和不平衡性,支持多单元策略(expert placement、workload distribution)

六大系统洞察

洞察编号名称对应观察说明
Insight 1Prefill-data-driven predictionOb3利用 prefill 阶段的 expert selection trace 预测 decode 阶段的专家选择
Insight 2Cross-hierarchy memory managementOb1, Ob2Token 和 Layer 级的 temporal locality 可用于多级内存管理
Insight 3Expert-placement-aware workload distributionOb4, Ob5考虑 expert 物理放置的 workload 分配,最小化 D2D traffic
Insight 4Popular expert decentralizationOb4复制/去中心化常用专家以平衡工作负载
Insight 5Expert-pair separationOb5分离经常 co-activated 的 expert pair 以最大化并行度
Insight 6Workload-aware serving systemOb4利用 workload 信息(任务类型、语言)在 serving 前进行 expert migration

三、技术架构

Profiling 方法论框架

Profiling 方法论

Temporal 分析的三个时间尺度:

  1. Layer-level:相邻模型层之间的 expert selection 关系
  2. Token-level:同一模型层中相邻 token 之间的 expert selection 关系
  3. Stage-level:prefill 阶段和 decode 阶段之间的关系

Spatial 分析的两种关系:

  1. Single-expert activation imbalance:单个 expert 的激活不均衡性
  2. Expert-pair co-activation affinity:expert pair 的 co-activation 亲和度

关键观察与洞察映射

Temporal Relation — Layer-Level (Ob1 → Insight 2)

Layer-level 相关性

发现:

  • 相邻层之间存在明显的 expert selection 相关性(heatmaps 中的白色斑点)
  • 相关性模式因层而异(layer 3-4 与 layer 30-31 不同),且模型间也不同
  • Qwen3 的热图明显更亮,表明其跨层相关性比 Deepseek 更强
  • 存在一致的明亮竖线,表明某些专家被频繁选择,与上一层的选择无关(popular experts)

量化结果(Fig. 2c):

  • Top 20% 的 expert pairs 占所有激活的:Deepseek 45%、Qwen 68%、Llama4 80%
  • Llama4 效应最强(interleaved architecture,传统 FFN 层插入 MoE 层之间)

Temporal Relation — Token-Level (Ob2 → Insight 2)

Token-level 相关性

发现:

  • 同一模型层中相邻 token 的 expert selection 也存在显著相关性
  • 但相关性弱于 layer-level(热图颜色较暗)
  • 这种 token-level locality 可用于 LLC prefetch 策略

Temporal Relation — Stage-Level (Ob3 → Insight 1)

Prefill/Decode 一致性

发现:

  • Prefill 和 decode 阶段的 expert activation patterns 高度一致
  • 在 prefill 阶段被频繁选择的专家在 decode 阶段也更可能被选择
  • Insight 1:利用 prefill 阶段的 expert selection trace 预测 decode 阶段的专家选择

Spatial Relation — Single-Expert Activation (Ob4 → Insight 4)

Single-expert 空间分布

发现:

  • Expert 激活分布高度不均匀(Fig. 5a)
  • 专家选择存在强烈的 skewness(Fig. 5b)
  • Insight 4:复制 popular experts 到多个 compute unit 以平衡负载

Spatial Relation — Expert-Pair Co-activation (Ob5 → Insight 5)

Co-activation 概率

发现:

  • 某些 expert pairs 经常同时被激活(co-activation heatmap 中的高亮区域)
  • Deepseek 和 Qwen 都显示出显著的 co-activation 模式
  • Insight 5:将 frequently co-activated expert pairs 分配到不同的 compute unit 以最大化并行度

Case Study: 未来 GPU 架构设计

Wafer-scale GPU 架构

未来 GPU 趋势:

  • 从 multi-chiplet 向 wafer-scale 演进
  • TSMC SoW:最多 24 compute dies + 96 HBM dies,面积 >200,000 mm²
  • Tesla Dojo:5×5 2D mesh,每 chiplet 1000 TFLOPS FP8, 512 GB HBM
  • 核心瓶颈:远程数据访问需要多 hop,同时远程 HBM 访问造成带宽竞争

两大挑战:

  1. Simplistic Task Allocation:传统 command processor 平等对待所有 SM,忽略物理位置和数据放置,产生大量 D2D traffic
  2. Inadequate Local HBM Management:将所有 HBM die 视为统一内存空间,不区分 local/remote HBM 访问速度差异

架构设计

Task allocation 算法与数据驱动预测器

策略 1:Expert-placement-aware Task Allocation(基于 Insight 3)

  • 设计智能 task allocation algorithm + 多 level data-placement-aware command processor
  • 考虑 expert 放置和 selection skewness,动态分配任务以最小化 D2D traffic

策略 2:Data-driven Predictor with Hardware-managed HBM(基于 Insight 1-2)

  • Local HBM cache 远程 die 中频繁访问的 experts
  • 轻量级预测器分析 selection patterns,预缓存预测的 experts

核心算法:Task Allocation Algorithm

输入:

  • expert_reqs_dict:每个 expert 的请求数
  • expert_die_map:动态 expert 分布信息(Expert Distribution Table)

输出: allo_plan(分配计划)

算法流程(Algorithm 1):

  1. 初始化每个 die 的工作负载 load_per_die
  2. 遍历所有 experts,对每个 expert:
    • 生成 candidate die list(包含存储该 expert 权重的 die 及其相邻 die)
    • 按工作负载排序,限制候选数量为 max_split_num
  3. 以 50 个请求为 block 粒度分配(平衡效率与精度)
  4. 对每个 block,使用 cost model 选择最优 die(考虑 DRAM 访问、计算、D2D 通信)
  5. 合并分配到同一 die 的 blocks,生成最终分配计划

Cost Model 考虑:

  • DRAM 访问延迟(local vs remote)
  • 计算资源可用性
  • Die-to-die 通信开销

数据驱动预测器

基于 Insight 1(prefill-decode consistency)和 Insight 2(cross-hierarchy locality):

  • 分析 prefill 阶段的 expert selection trace
  • 预测 decode 阶段可能需要的 experts
  • 硬件管理的 HBM 自动缓存预测的 experts 到 local DRAM

四、核心创新

创新点说明理论/实验依据
首次大规模 MoE profiling覆盖 200B-1000B 四个 SOTA MoE 模型,24,000+ 请求Sec. 3:全面的 temporal + spatial 分析
Temporal + Spatial 分类框架提出统一的 expert selection 行为分类方法论Fig. 1:分类框架总览
六大系统洞察从 profiling 中提取的 model-agnostic 设计原则Ob1-Ob5:六个实证观察
Task Allocation Algorithm基于 expert placement 感知的启发式分配算法Alg. 1:块粒度分配策略
Data-driven Predictor基于 prefill trace 的 decode 阶段 expert 预测Fig. 2-4:temporal correlation 量化
公开 profiling traces首次公开大规模 MoE expert selection 追踪数据附录链接

五、代码实现分析

模拟器: 自定义 Python-based multi-chiplet GPU simulator

  • 由于缺乏合适的现有工具(Gem5/gpgpusm/mgpuSim 太慢,ASTRI-sim 不支持 MoE serving)
  • 以 expert slice 粒度模拟 MoE 模型(每个 expert 包含两个 slices)
  • 建模关键组件:LLC、HBM、Compute Units、D2D links
  • 支持可配置的 die 数量、placement 和 connectivity

评估配置:

拓扑X-dieY-dieDRAM BWD2D BWHBMCompute Power
Tesla Dojo552 TB/s1.5 TB/s256 GB1000 TFLOPS (FP8)
TSMC SoW832 TB/s1.5 TB/s256 GB1000 TFLOPS (FP8)

基线配置:

  • Base:等量分配 experts 到各 die,忽略 expert placement
  • Allo Only:仅使用 task allocation 策略
  • Pred Only:仅使用 data-driven predictor
  • Allo+Pred:两者结合

评估数据集: MMLU、MMLU Pro、ChineseSimpleQA、LiveCodeBench

Note: 代码未开源,但 profiling traces 公开可用。

六、实验结果

Throughput 结果(Fig. 9)

跨模型比较:

  • Allo+Pred 在 DeepSeek V3 上实现 6.3× 吞吐提升,在 Qwen3 上实现 4.5× 提升
  • DeepSeek 改进更大因其专家数更多(256 vs 128)且 expert selection 模式更复杂

跨架构比较:

  • Allo+Pred 在 Tesla Dojo 上实现 4.5× 提升,在 TSMC SoW 上实现 6.1× 提升
  • TSMC 改进更大因其矩形布局使 die 间距更远,增加 inter-unit 通信

配置比较:

  • Pred Only 平均提升 40% 性能
  • 在 Qwen 上效果更显著(68% vs Deepseek 14%):Qwen expert selection 更可预测 + 专家 size 更小可缓存更多

Hop Reduction 结果(Fig. 10)

策略Hop 减少比例
Pred Only减少 14%-78%
Allo Only减少 7.2× - 10.8×
Allo+Pred减少 >100×

关键发现:

  • Allo+Pred 将 hop count 降低 100× 以上,但性能仅提升 2.7×-7.7×
  • 这表明 hop count 不再是性能瓶颈——task allocation 成功将 computation 放在靠近相关 data 的位置
  • 瓶颈从 D2D traffic 转移到 workload balancing across dies

DRAM Access Breakdown(Fig. 11)

  • Baseline 中大部分 reads 来自 remote dies,产生高 inter-unit traffic
  • Allo+Pred 将大部分 remote DRAM reads 转换为 local DRAM reads
  • 相比 Pred Only,Allo+Pred 通过分配到 local dies 进一步减少 remote reads
  • 相比 Allo Only,Allo+Pred 通过缓存 popular experts 到 local HBM 进一步减少 remote reads

整体加速总结

场景加速比说明
Wafer-scale GPU(平均)6.6×四个 200B-1000B 模型平均
DeepSeek V3 (Dojo)6.3×256 experts, 复杂 selection 模式
Qwen3 (TSMC)6.1×128 experts, 矩形布局
现有 GPU 系统1.25×prefill-aware expert placement
Prefill-aware expert placement1.25×MoE 计算加速

七、相关工作

MoE 模型行为研究

  • Mixtral report:展示 expert selection 的 temporal locality(repetitive assignment 百分比)
  • OLMoE report:展示 co-activation pattern 和 expert domain specialization
  • SGLang blog:展示 DeepSeekV3 的 expert distribution statistics 和 prefill-decode similarity
  • 本文区别:首次对多个 200B+ 模型进行全面 profiling,提出 data-movement-centric 方法论

MoE 推理数据移动优化

  • Lina:利用 expert selection skewness 动态调度资源
  • LYNX:动态减少 active experts
  • Pre-gate MoE:使用 pre-gating function 缓解 expert selection 的动态性
  • Sida:构建 offline hash function 预测 expert usage
  • MoE-Lightning:利用 CPU-GPU pipeline 和 paged weights
  • 本文区别:data-driven profiling 为基础,适用于当前和未来任意规模的系统

晶圆级与 Chiplet 架构

  • TSMC CoWoS、Samsung X-Cube、Intel EMIB 等先进封装技术
  • ASTRI-sim:支持 multi-GPU 系统但面向训练而非 MoE serving

八、总结

核心贡献

  1. 首次大规模 MoE profiling:对 DeepSeek V3、Llama4-128E、Qwen3-235B 三个 SOTA 模型进行数据移动为中心的 profiling,覆盖 24,000+ 请求
  2. 六大系统洞察:从 temporal(layer-level、token-level、stage-level)和 spatial(single-expert imbalance、expert-pair co-activation)两个维度提炼 model-agnostic 设计原则
  3. Task Allocation Algorithm:基于 expert placement 感知的启发式分配,块粒度搜索近似解
  4. Data-driven Predictor:利用 prefill trace 预测 decode 阶段的 expert selection
  5. 公开 profiling traces:为社区提供大规模 MoE expert selection 追踪数据

技术影响

  • 超越案例研究:洞察适用于 diverse future systems:multi-GPU clusters、CXL-based memory disaggregation、Flash-based multi-hierarchy systems 等
  • 剩余洞察潜力:Insight 2 可指导 LLC prefetch 策略;Insight 4-5 可优化 initial expert placement;Insight 6 可结合 task 信息进一步优化

局限性

  1. Case study 仅验证了部分洞察(Insight 1-3),Insight 4-6 尚未充分验证
  2. 仅在模拟器上评估,无真实硬件验证
  3. 未涉及 prefill stage 的优化(focus 在 decode stage 的 MoE layer)
  4. 代码未开源

九、参考资源

  • arXiv: 2510.05497
  • Profiling traces: 公开可用
  • 相关论文: Comet, MegaScale-Infer, Duplex, MoE-Lightning, LYNX, ASTRI-sim
  • 架构参考: TSMC SoW, Tesla Dojo, Samsung I-Cube

附图索引

编号文件名说明
Figure 1figure-1-Figure_1_Inference_process_and_categorization.pngMoE 推理流程和 profiling 分类方法
Figure 2figure-2-Figure_2_Layer-level_temporal_correlation_heatmaps.jpegLayer-level 时间相关性热力图
Figure 3figure-3-Figure_3_Token-level_temporal_correlation_heatmaps.jpegToken-level 时间相关性热力图
Figure 4figure-4-Figure_4_Expert_activation_patterns_prefill_decode.jpegPrefill/Decode 阶段 expert 激活模式对比
Figure 5figure-5-Figure_5_Single_expert_spatial_relation_analysis.jpeg单专家空间关系分析(Llama4 layer 7)
Figure 6figure-6-Figure_6_Coactivation_probability_heatmap.jpegExpert pair co-activation 概率热力图
Figure 7figure-7-Figure_7_Wafer_scale_GPU_architecture.pngWafer-scale 多 chiplet GPU 架构和 SoW 技术结构
Figure 8figure-8-Figure_8_Task_allocation_algorithm_and_predictor.pngTask allocation 算法和数据驱动预测器
Figure 9figure-9-Throughput_of_MoE_layers.pngMoE layer throughput 对比(缩放至 baseline)
Figure 10figure-10-Hop_number_reduction_ratio.pngHop 数量减少比例
Figure 11figure-11-DRAM_access_breakdown.pngDRAM 访问分解(Qwen on TSMC, batch=4096)
Table 1论文中 Table 1SOTA MoE LLM 概览(参数、专家数、稀疏率)
Table 2论文中 Table 2硬件配置(Dojo vs TSMC SoW)