AI Skills AI技能 3h ago Updated 1h ago 更新于 1小时前 46

How Much Does a Local LLM Actually Cost to Run? I Measured Every Watt on Apple Silicon 本地大语言模型实际运行成本是多少?我在苹果硅上测量了每一瓦特

Cost per token is driven by throughput and power draw, not parameter count. Larger mixture-of-experts (MoE) models can be cheaper and faster to run than smaller dense models due to reduced data movement per token. The 27B dense model is the most expensive to run despite being mid-sized, because it activates all parameters per token, maximizing memory bandwidth usage and power consumption. MoE models activate only a subset of parameters per token, reducing bytes-per-token and improving efficiency 在Apple Silicon硬件上,大模型(如120B MoE)每token成本显著低于中等规模密集模型(如27B Dense),参数数量并非决定推理成本的核心因素。 模型推理成本由“功耗”与“吞吐量”共同决定,而非参数量;MoE架构通过稀疏激活大幅降低每token数据读取量,从而提升效率并降低成本。 使用TokenWatt工具结合墙插实测校准,实现了高精度、可复现的本地LLM能耗与成本评估,误差控制在±4.5%以内。 统一内存架构下,大模型因更优的内存带宽利用率和量化优势,反而在小模型之上实现更低单位成本,颠覆传统认知。 该研究为本地部署策略提供实证依据:优先选择MoE+低比特量化组合,而非

65
Hot 热度
70
Quality 质量
60
Impact 影响力

Analysis 深度分析

TL;DR

  • Cost per token is driven by throughput and power draw, not parameter count.
  • Larger mixture-of-experts (MoE) models can be cheaper and faster to run than smaller dense models due to reduced data movement per token.
  • The 27B dense model is the most expensive to run despite being mid-sized, because it activates all parameters per token, maximizing memory bandwidth usage and power consumption.
  • MoE models activate only a subset of parameters per token, reducing bytes-per-token and improving efficiency.
  • Quantization further lowers cost by shrinking the footprint of weights in memory.

Why It Matters

This analysis challenges the assumption that larger models are inherently more expensive to run locally. For AI practitioners deploying LLMs on consumer hardware, selecting models based solely on parameter count can lead to suboptimal choices. Understanding how architecture (dense vs. MoE), quantization, and memory bandwidth interact with energy cost enables smarter deployment decisions that balance performance, cost, and scalability.

Technical Details

  • Measurement tool: TokenWatt, an OpenAI-compatible proxy for Apple Silicon that measures marginal energy cost via Apple’s IOReport interface, calibrated against a wall-metered Shelly Plug US Gen4 (±2.6% to ±4.5% error).
  • Hardware: M3 Ultra Mac Studio with 96 GB unified memory (no discrete GPU), running sustained generation loops at three durations (120s, 360s, 720s), three passes each, with 15-minute idle baselines between runs.
  • Models tested: Qwen3.5-4B (dense, 8-bit), Qwen3.6-35B-A3B (MoE, 3B experts, ~4–6 bit), Qwen3-Coder-Next (~80B MoE, 3B experts, ~4–6 bit), gpt-oss-120b (120B MoE, 5B experts, ~4–6 bit), Qwen3.6-27B (dense, 8-bit).
  • Key metric: Cost per million output tokens calculated as (power draw in watts × electricity rate $0.31/kWh) / (tokens per second), normalized to per-million-token basis.
  • Throughput bottleneck: Single-stream decode speed limited by memory bandwidth — dense models stream all weights per token; MoE models route only active experts, drastically reducing data movement.

Industry Insight

When deploying local LLMs on shared-memory or bandwidth-constrained systems like Apple Silicon, prioritize mixture-of-experts architectures over dense ones even if they have higher total parameter counts — they often deliver lower cost per token and higher throughput. Quantization should be applied aggressively where acceptable, as it compounds efficiency gains in both memory footprint and power. Developers and enterprises should benchmark real-world energy costs using calibrated tools rather than relying on theoretical FLOPs or parameter counts when evaluating inference economics.

TL;DR

  • 在Apple Silicon硬件上,大模型(如120B MoE)每token成本显著低于中等规模密集模型(如27B Dense),参数数量并非决定推理成本的核心因素。
  • 模型推理成本由“功耗”与“吞吐量”共同决定,而非参数量;MoE架构通过稀疏激活大幅降低每token数据读取量,从而提升效率并降低成本。
  • 使用TokenWatt工具结合墙插实测校准,实现了高精度、可复现的本地LLM能耗与成本评估,误差控制在±4.5%以内。
  • 统一内存架构下,大模型因更优的内存带宽利用率和量化优势,反而在小模型之上实现更低单位成本,颠覆传统认知。
  • 该研究为本地部署策略提供实证依据:优先选择MoE+低比特量化组合,而非盲目追求小模型或高密度结构。

为什么值得看

本文通过严谨的实地测量与工具创新,揭示了本地运行大语言模型时成本结构的反直觉规律——更大的MoE模型比中等密集模型更便宜高效,这对开发者优化资源分配、选择合适模型架构具有直接指导意义。同时其开源测量方法TokenWatt为行业提供了标准化、可信的成本评估范式,推动本地AI落地从“估算走向精确”。

技术解析

  • 作者开发TokenWatt工具作为OpenAI兼容代理,基于Apple IOReport接口采集SoC级功耗数据,并通过Shelly Plug US Gen4进行墙插校准,确保测量误差在±2.6%-4.5%之间,具备高度可复现性。
  • 测试平台为配备96GB统一内存的M3 Ultra Mac Studio,无独立GPU,所有模型均驻留内存中,模拟真实本地推理环境。
  • 五款模型涵盖从4B到120B参数范围,包括密集型(Qwen3.5-4B, Qwen3.6-27B)和混合型专家架构(Qwen3.6-35B-A3B, Qwen3-Coder-Next, gpt-oss-120B),采用不同量化精度(4-8 bit)。
  • 持续生成测试设定三种时长(120/360/720秒),三轮重复,中间插入15分钟空闲基线,以消除冷启动干扰,获取稳定吞吐量与功耗数据。
  • 成本计算公式:$/1M tokens = (瓦特 × 时间 / 3600) × 电价 / (tok/s × 时间) × 1e6,其中电价为$0.31/kWh,结果反映边际成本而非总开销。

行业启示

  • 本地部署应优先考虑MoE架构配合低比特量化方案,即使参数量更大,也能凭借稀疏激活机制获得更低单位成本与更高吞吐,打破“越小越省”的固有思维。
  • 建立标准化的本地LLM能耗评估体系至关重要,TokenWatt所代表的“软件代理+硬件校准”模式可被广泛复制,帮助团队做出更具经济性的选型决策。
  • 随着Apple Silicon等统一内存平台普及,内存带宽将成为制约密集模型性能的关键瓶颈,未来模型设计需向稀疏化、模块化演进,以适配新型硬件特性。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Inference 推理 Open Source 开源 Chip 芯片