<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>M5 on </title>
    <link>/tags/m5/</link>
    <description>Recent content in M5 on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 19 Apr 2026 02:00:00 +0800</lastBuildDate><atom:link href="/tags/m5/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Apple M5 上 omlx &#43; Gemma4-26B 性能调优实录</title>
      <link>/posts/omlx-gemma4-m5-optimization/</link>
      <pubDate>Sun, 19 Apr 2026 02:00:00 +0800</pubDate>
      
      <guid>/posts/omlx-gemma4-m5-optimization/</guid>
      <description>实验结果 (M5 / 32GB RAM) 测试模型：Gemma4-26B-A4B-it-nvfp4（4-bit 量化，激活权重 ~3.85GB）。
场景 基线 调优后 提升 瓶颈分析 短文本生成 (256 tok) 38.18 tok/s 39.75 tok/s +4.1% 带宽瓶颈：已达硬件理论极限 长文本重复查询 (11k tok) 14.59s 2.27s +540% IO 瓶颈：Hot Cache 消除磁盘加载 瓶颈逻辑：为什么我把 39.7 tok/s 当作接近上限的参考值？ Decode 阶段性能由内存带宽决定：每生成一个 token，都要把激活权重从内存完整读一遍。
MoE 激活：Gemma4-26B-A4B 单步仅激活 4B 专家参数，约 3.85 GB（nvfp4 量化后）。 硬件带宽：M5 标准版 153 GB/s。 理论上限：153 GB/s ÷ 3.85 GB ≈ 39.7 tok/s 这次实测到 39.75 tok/s，已经很接近按带宽估出来的上限。至少在这组测试条件下，软件层面的调参看起来不太容易明显越过这条线。
优化策略 (针对 32GB 机型) 1. 内存硬锁定 sudo sysctl iogpu.</description>
    </item>
    
  </channel>
</rss>
