<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mac studio M5 ultra 256G - glm 5.3 flash 初嘗試]]></title><description><![CDATA[<p dir="auto">機器到手後嘗試安裝了一下GLM 5.3 flash, 本次使用 oMLX main 原始碼與原生 Metal 核心配方，模型 ID <code>GLM-5.3-Flash-oQ4e-mtp</code>，context 262144，常態併發 4 路。8 路額外測試已完成，現已恢復 4 路。主要是模型權重較大, 需要多併發就需要限制上下文, 不過記憶體看來還有餘裕, 以後需要可以再調整.</p>
<h2>環境與版本</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>項目</th>
<th>實際結果</th>
</tr>
</thead>
<tbody>
<tr>
<td>硬體／系統</td>
<td>Mac Studio Mac17,15、M5 Ultra、256 GB Unified Memory、macOS 27.0.1</td>
</tr>
<tr>
<td>磁碟</td>
<td>安裝前約 1.8 TiB 可用；完成後 1.5 TiB 可用</td>
</tr>
<tr>
<td>oMLX 原始碼／commit</td>
<td><code>~/omlx-glm-src</code>；base <code>a4048eef24b41d885d593742e32a290f3bdb2300</code>，recipe patch <code>d6c33e309876454e43a3e6a5ce497934d00a4496</code>，upstream #4086 patch／實際 HEAD <code>85ef9488063c28e3b770b95153f7fee7384e7035</code></td>
</tr>
<tr>
<td>oMLX／MLX／mlx-lm</td>
<td><code>0.7.0rc1</code>／<code>0.32.2</code>／<code>0.31.4.dev132+g94cdcae13</code>；五項原生核心 bonsai、decode_fast、glm_moe_dsa、minimax_m3、qwen35_prefill 均可載入</td>
</tr>
<tr>
<td>建置工具</td>
<td>Python 3.12.15、Xcode 27.1 (27A9275)、CLT 27.0、Metal Toolchain 27A266a、Apple metal 32023.921、CMake 4.4.4</td>
</tr>
<tr>
<td>oQ4e backbone</td>
<td><code>~/models/src/dfp-GLM-5.3-Flash-oQ4e-mtp</code>，revision <code>728cc0d92aef48d64bd2a7ebfaefec6aeff5921b</code>；34 個 shard，181,607,491,134 bytes，與索引一致</td>
</tr>
<tr>
<td>MTP donor</td>
<td><code>~/models/src/vontra-mtp</code>，revision <code>76add2a341a1cd90ad0e86bb69839ea9c35827c6</code>；layer 45 共 2,641 個 tensors</td>
</tr>
<tr>
<td>官方模板</td>
<td><code>~/models/src/zai-template</code>，revision <code>eb9eb208eb0d988989d07a6a12d0fdeb5f52574a</code>；與輸出模板逐位元組一致</td>
</tr>
<tr>
<td>最終模型</td>
<td><code>~/models/mlx/GLM-5.3-Flash-oQ4e-mtp</code>；<code>~/models/mlx</code> 指向 <code>~/models.noindex/mlx</code>；graft shard 4,183,682,557 bytes，索引共 5,639 鍵</td>
</tr>
</tbody>
</table>
<p dir="auto"><code>runtime/model_settings.json</code> 設定 MTP enabled、fixed depth 2、max context 262144；<code>scripts/serve-local.sh</code> 啟用 Prompt Lookup、HC GEMV、232 GB memory guard。設定隔離於本專案 <code>runtime/</code>。API <code>/v1/models</code> 回報 <code>max_model_len=262144</code>；最終重啟後 Chat Completions 回覆 <code>OK</code>，模型載入 32.09 秒。Prompt Lookup 專項複製測試 32/32 行正確；伺服器記錄 drafted 280、accepted 278（99.3%）。MTP 日誌顯示 nextn layer 已綁定。</p>
<h2>Metal wired-memory 設定</h2>
<p dir="auto">本機 Unified Memory 為 256 GB。<code>iogpu.wired_limit_mb</code> 參數存在，<strong>原值 <code>0</code></strong>；已執行 <code>sudo sysctl -w iogpu.wired_limit_mb=245760</code>，調整後回讀及最終再讀均為 <strong><code>245760</code> MB（240 GiB）</strong>。模型成功分配 Metal 記憶體並完成全部測試。**還原命令：<code>sudo sysctl -w iogpu.wired_limit_mb=0</code>。**未設定開機自動套用，未修改 SIP、Swap 或其他系統參數。oMLX 提示其內部 static ceiling 254 GB 高於系統 Metal cap 240 GB；實測配置最高 192.343 GiB，服務另有 232 GB memory guard。</p>
<h2>Benchmark</h2>
<p dir="auto">2026-10-22 實測。TTFT、Prefill、Decode 取自 OpenAI streaming <code>usage</code>；TTFT 單位秒，速率 tokens/s。長 Context 在開頭埋隨機碼、末尾提問，三項回憶皆正確。短輸出只有 6–8 tokens，Decode 值僅供參考。原始逐請求結果：<code>runtime/benchmarks/results-4.jsonl</code>、<code>results-8.jsonl</code>；約每 2 秒監控：<code>memory-4.csv</code>、<code>memory-8.csv</code>。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">Context 目標</th>
<th style="text-align:right">實際 prompt tokens</th>
<th style="text-align:right">Prefix cache tokens</th>
<th style="text-align:right">TTFT</th>
<th style="text-align:right">Prefill</th>
<th style="text-align:right">Decode</th>
<th>回憶</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">32K</td>
<td style="text-align:right">31,618</td>
<td style="text-align:right">0</td>
<td style="text-align:right">18.73</td>
<td style="text-align:right">1,688.32</td>
<td style="text-align:right">40.22</td>
<td>通過</td>
</tr>
<tr>
<td style="text-align:right">128K</td>
<td style="text-align:right">129,926</td>
<td style="text-align:right">0</td>
<td style="text-align:right">68.24</td>
<td style="text-align:right">1,903.85</td>
<td style="text-align:right">29.81</td>
<td>通過</td>
</tr>
<tr>
<td style="text-align:right">256K</td>
<td style="text-align:right">260,998</td>
<td style="text-align:right">163,840</td>
<td style="text-align:right">146.26</td>
<td style="text-align:right">664.27</td>
<td style="text-align:right">40.59</td>
<td>通過</td>
</tr>
</tbody>
</table>
<p dir="auto">256K 命中前次 prefix cache；664.27 tokens/s 是 oMLX 對未快取部分的回報，不能直接與前兩列的未快取 Prefill 比較。三項實際 prompt 均低於 262144 上限。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:right">同時請求數</th>
<th style="text-align:right">TTFT 範圍（秒）</th>
<th style="text-align:right">Prefill 範圍（tokens/s）</th>
<th style="text-align:right">Decode 範圍（tokens/s）</th>
<th style="text-align:right">各串流 Decode 速率合計（tokens/s）</th>
<th>結果</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">1</td>
<td style="text-align:right">0.23</td>
<td style="text-align:right">134.86</td>
<td style="text-align:right">86.71</td>
<td style="text-align:right">86.71</td>
<td>1/1 正常結束</td>
</tr>
<tr>
<td style="text-align:right">2</td>
<td style="text-align:right">0.08–0.33</td>
<td style="text-align:right">24.27–93.46</td>
<td style="text-align:right">34.98–35.93</td>
<td style="text-align:right">70.91</td>
<td>2/2 正常結束</td>
</tr>
<tr>
<td style="text-align:right">4</td>
<td style="text-align:right">0.21–1.04</td>
<td style="text-align:right">1.92–145.26</td>
<td style="text-align:right">18.92–27.61</td>
<td style="text-align:right">100.40</td>
<td>4/4 正常結束</td>
</tr>
<tr>
<td style="text-align:right">8（暖機後）</td>
<td style="text-align:right">0.10–0.79</td>
<td style="text-align:right">2.55–19.78</td>
<td style="text-align:right">13.82–16.41</td>
<td style="text-align:right">123.42</td>
<td>8/8 正常結束</td>
</tr>
</tbody>
</table>
<p dir="auto">短 prompt 每路僅 31 tokens，多數命中 prefix cache，因此併發 Prefill 值主要供記錄。8 路首次冷載入測試也 8/8 正常，模型載入約 31.1 秒，合計 Decode 118.45 tokens/s；表中採暖機後數據。合計是各串流回報速率相加，並非同一時間窗的端到端吞吐。</p>
<p dir="auto">Tool Calling：指定 <code>lookup_city</code> 函式與 Taipei 參數，回傳 <code>finish_reason=tool_calls</code>，JSON 參數 <code>{"city":"Taipei"}</code> 正確；<strong>通過</strong>，端到端約 2.281 秒。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>監控範圍</th>
<th style="text-align:right">最低 Memory Pressure free</th>
<th style="text-align:right">Swap 最大使用</th>
<th style="text-align:right">Metal in-use 峰值</th>
<th style="text-align:right">Metal allocated 峰值</th>
<th style="text-align:right">oMLX footprint 峰值</th>
<th>oMLX 壓力</th>
</tr>
</thead>
<tbody>
<tr>
<td>常態 4 路及 32K／128K／256K</td>
<td style="text-align:right">23%</td>
<td style="text-align:right">7.19 MB</td>
<td style="text-align:right">187.869 GiB</td>
<td style="text-align:right">189.769 GiB</td>
<td style="text-align:right">187.647 GiB</td>
<td><code>ok</code></td>
</tr>
<tr>
<td>額外 8 路含冷載入</td>
<td style="text-align:right">22%</td>
<td style="text-align:right">62.50 MB</td>
<td style="text-align:right">190.424 GiB</td>
<td style="text-align:right">192.343 GiB</td>
<td style="text-align:right">189.974 GiB</td>
<td><code>ok</code></td>
</tr>
</tbody>
</table>
<p dir="auto">8 路期間 Swap 由 7.19 MB 增至 62.50 MB，未達停止線 512 MB。監控腳本在 free ≤12%、Swap ≥512 MB、Metal in-use／allocated ≥232 GiB 或 oMLX 壓力達 hard／critical 時終止本服務。上表為各測試時段峰值；CSV 保存完整時間序列。</p>
]]></description><link>https://lcz.me/topic/2764</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Nov 2026 01:11:45 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2764.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 Nov 2026 06:36:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mac studio M5 ultra 256G - glm 5.3 flash 初嘗試 on Mon, 02 Nov 2026 02:49:14 GMT]]></title><description><![CDATA[<p dir="auto">512G 的的售价倒逼技术进步 ，早日看到双256 M5 Ultra 跑起来。</p>
]]></description><link>https://lcz.me/post/30448</link><guid isPermaLink="true">https://lcz.me/post/30448</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Mon, 02 Nov 2026 02:49:14 GMT</pubDate></item><item><title><![CDATA[Reply to Mac studio M5 ultra 256G - glm 5.3 flash 初嘗試 on Sun, 01 Nov 2026 09:06:10 GMT]]></title><description><![CDATA[<p dir="auto">不错，坛子M5 Ultra的用户越来越多了。</p>
]]></description><link>https://lcz.me/post/30219</link><guid isPermaLink="true">https://lcz.me/post/30219</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 01 Nov 2026 09:06:10 GMT</pubDate></item><item><title><![CDATA[Reply to Mac studio M5 ultra 256G - glm 5.3 flash 初嘗試 on Sun, 01 Nov 2026 09:05:35 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=a055419e292" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:1.4em;width:auto;vertical-align:middle" title="✅" alt="✅" /> 版主审定：本帖设为<strong>优秀</strong>，作者 <strong>+3 积分</strong>奖励，继续加油！</p>
<blockquote>
<p dir="auto">奖励凭证：优秀 +3 分 · 编号 e2764-988-1</p>
</blockquote>
]]></description><link>https://lcz.me/post/30218</link><guid isPermaLink="true">https://lcz.me/post/30218</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 01 Nov 2026 09:05:35 GMT</pubDate></item></channel></rss>