<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: maruhana</title>
    <description>The latest articles on DEV Community by maruhana (@maruhana).</description>
    <link>https://dev.to/maruhana</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4233335%2F7d1dc498-5f17-4f5e-ab46-fa698b14a50a.jpg</url>
      <title>DEV Community: maruhana</title>
      <link>https://dev.to/maruhana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maruhana"/>
    <language>en</language>
    <item>
      <title>One Shell Command Kept Calling Itself Until My PC Froze: Stopping Known Mistakes with Claude Code Hooks</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Sat, 28 Nov 2026 05:39:11 +0000</pubDate>
      <link>https://dev.to/maruhana/one-shell-command-kept-calling-itself-until-my-pc-froze-stopping-known-mistakes-with-claude-code-59fj</link>
      <guid>https://dev.to/maruhana/one-shell-command-kept-calling-itself-until-my-pc-froze-stopping-known-mistakes-with-claude-code-59fj</guid>
      <description>&lt;p&gt;&lt;em&gt;A backtick inside double quotes ran a Markdown file as a shell script, which ran itself. I moved known mistakes out of the notes and into PreToolUse hooks, then tuned the rules against commands left in past session logs.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/claude-code-hooks-stop-known-pitfalls" rel="noopener noreferrer"&gt;1 行のコマンドが自分を呼び続けて PC が固まった。知っている失敗を、実行の前に機械で止める&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original records. While doing that I found that the original described some counts wrongly (what was counted, not the counts themselves). I corrected the original on November 25, 2026, and this version uses the corrected descriptions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: a one-line Git Bash command turned into a chain of bash processes calling each other, 1,123 levels deep, and I had to cut the power. The mistake was already in my notes. So I stopped relying on notes and put the checks in a hook that runs right before each command. The rules only became usable after I ran them against commands from past sessions: the first version had 587 rule hits, the tuned one 181.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 1-minute video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/qUDMd77Q0tA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I run 10 to 18 Claude Code sessions at the same time on one Windows PC with 32 GB of memory, one per project.&lt;/li&gt;
&lt;li&gt;One session wrote a file name in backticks inside a double-quoted &lt;code&gt;py -3 -c "..."&lt;/code&gt;. Bash treats that as command substitution, so it executed the Markdown file. The file contained the same backticked name, so it executed itself again.&lt;/li&gt;
&lt;li&gt;Stopping the top process didn't stop the chain. It kept growing to 1,123 nested bash processes and about 47 GB of committed memory.&lt;/li&gt;
&lt;li&gt;I added three things: a hook that blocks backticks that would really be substituted, a hook with nine rules for other known mistakes, and a memory reservation script for large jobs.&lt;/li&gt;
&lt;li&gt;Replayed over 24,374 commands left in recently updated session logs, the rules went from 587 hits to 181. Counted by when the commands were run, 8 of 2,053 commands over two days would have been blocked.&lt;/li&gt;
&lt;li&gt;In the 13 days since, the two hooks have stopped 7 commands for matching a rule, and 5 because the hook itself timed out.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Environment&lt;/strong&gt;: one Windows PC (32 GB), Git Bash and PowerShell, Claude Code. I keep about 30 sessions prepared; 10 to 18 are running at any moment, and one of them coordinates the others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not covered&lt;/strong&gt;: Linux, macOS, other agents. The rules come from mistakes made on this PC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;The PC's screen started flickering, and in the end I forced it off.&lt;/p&gt;

&lt;p&gt;The cause was one line in Git Bash. A session was passing a short Python script with &lt;code&gt;py -3 -c "..."&lt;/code&gt;, and inside the double quotes it wrote a file name in backticks, the way you would in Markdown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Only the shape; the content is removed&lt;/span&gt;
py -3 -c &lt;span class="s2"&gt;"... `docs/notes.md` ..."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Bash, &lt;strong&gt;backticks inside double quotes are command substitution&lt;/strong&gt;. &lt;code&gt;`docs/notes.md`&lt;/code&gt; isn't text. It means "run &lt;code&gt;docs/notes.md&lt;/code&gt; and put its output here". The Markdown file was executed as a shell script.&lt;/p&gt;

&lt;p&gt;Unfortunately, that file contained the same &lt;code&gt;`docs/notes.md`&lt;/code&gt;. The script that was running ran itself again, and bash kept calling bash.&lt;/p&gt;

&lt;p&gt;The command didn't finish, so the session stopped the top process and noted "stopped, no damage". Only the top process had stopped. The bash processes that had lost their parent kept multiplying in the background. By the time I noticed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Free memory&lt;/td&gt;
&lt;td&gt;0.6 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Committed memory / limit&lt;/td&gt;
&lt;td&gt;63.4 GB / 63.5 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nested bash processes&lt;/td&gt;
&lt;td&gt;1,123&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory committed by the chain&lt;/td&gt;
&lt;td&gt;about 47 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;New processes couldn't start; both bash and PowerShell failed to launch. I had a script ready that would stop only the chain, but I forced the power off before running it.&lt;/p&gt;

&lt;p&gt;After the restart, I had the 17 sessions that were running again (not counting the coordinator) check their files. All 17 reported nothing broken and nothing stuck.&lt;/p&gt;

&lt;h2&gt;
  
  
  It was a known mistake
&lt;/h2&gt;

&lt;p&gt;That backticks in double quotes are substituted is well known to people who use Bash. The AI knows it too. It still happens when it thinks it's writing a Python string and the Markdown habit slips in.&lt;/p&gt;

&lt;p&gt;It also wasn't a one-off. I took the session logs that had been updated in the previous three days, pulled out every command containing a backtick (2,808, including old ones, since the logs go back further), and ran them through the hook I'd write later. It found &lt;strong&gt;17 with the same shape&lt;/strong&gt;: a backtick at a position where Bash substitutes it, such as inside double quotes. The accident itself isn't among them, and none of them turned into one like it. Counted by when they were run, it was 2 of 3,035 Bash commands in three days, and one of those two was the accident.&lt;/p&gt;

&lt;p&gt;Around that time I'd asked each session to write down its failures of the past month, and 20 sessions had contributed to one list. It had more mistakes of the same kind, known but still made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt; nul&lt;/code&gt; in Git Bash creates a file named &lt;code&gt;nul&lt;/code&gt;, which is awkward to delete&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$_&lt;/code&gt; for PowerShell inside Bash double quotes is emptied by Bash before PowerShell sees it&lt;/li&gt;
&lt;li&gt;Checking whether a server is listening with &lt;code&gt;-State Listen&lt;/code&gt; or by looking for &lt;code&gt;LISTEN&lt;/code&gt; in netstat: on this PC, since some point in early November, it comes back empty even when the server is up (I suspect a Windows update, but haven't confirmed the cause)&lt;/li&gt;
&lt;li&gt;Stopping a process by name, such as &lt;code&gt;python.exe&lt;/code&gt;, also stops the Python of other sessions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm -rf $DIR/...&lt;/code&gt; with a variable that might be empty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every session could read the list. It wasn't enough: when in a hurry, they still made the mistakes.&lt;/p&gt;

&lt;p&gt;So I &lt;strong&gt;stopped relying on reading, and had a script check each command right before it runs&lt;/strong&gt;. Claude Code can run a script before a tool call (a &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;PreToolUse hook&lt;/a&gt;). The script receives the command string and can block it or let it through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guard 1: backticks
&lt;/h2&gt;

&lt;p&gt;The first hook blocks what caused the accident. It looks for backticks &lt;strong&gt;at positions where Bash would really substitute them&lt;/strong&gt;, and blocks only those.&lt;/p&gt;

&lt;p&gt;That restriction matters. Blocking every backtick would stop ordinary work. These pass:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside single quotes &lt;code&gt;'...'&lt;/code&gt; (no substitution)&lt;/li&gt;
&lt;li&gt;Inside a heredoc with a quoted delimiter, &lt;code&gt;&amp;lt;&amp;lt;'EOF'&lt;/code&gt; (no substitution)&lt;/li&gt;
&lt;li&gt;After &lt;code&gt;#&lt;/code&gt;, in a comment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When it blocks a command, it returns the reason and the fix: write Python to a file and run the file, use single quotes for strings, or use &lt;code&gt;$( )&lt;/code&gt; if you do want substitution.&lt;/p&gt;

&lt;p&gt;I wrote 15 test cases that should be blocked or passed, with zero wrong answers. The 17 above come from running it over those 2,808 commands. The script printed only the first 12 matches, so I didn't check all 17 one by one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guard 2: the list of known mistakes
&lt;/h2&gt;

&lt;p&gt;I did the same for other items on the list. This hook had nine rules when I wrote the original article, and checks both Bash and PowerShell commands.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;What it blocks&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nul-redirect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;&amp;gt; nul&lt;/code&gt; in Git Bash&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/dev/null&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ps-dollar-in-bash-dq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PowerShell &lt;code&gt;$_&lt;/code&gt;, &lt;code&gt;$env:&lt;/code&gt; or assignments inside Bash double quotes&lt;/td&gt;
&lt;td&gt;Single quotes, or a &lt;code&gt;.ps1&lt;/code&gt; file with &lt;code&gt;-File&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl-dollar-in-bash-dq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;$variable&lt;/code&gt; in double quotes passed to wsl (expanded on the Windows side first)&lt;/td&gt;
&lt;td&gt;Single quotes, or pass the value as an argument&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rm-rf-unguarded-var&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;rm -rf&lt;/code&gt; with a possibly empty variable&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;${X:?}&lt;/code&gt;, which stops if it's empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;listen-state&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checking for a listening port with &lt;code&gt;-State Listen&lt;/code&gt; or &lt;code&gt;LISTEN&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Look up connections by port and find the one whose remote port is 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kill-by-name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stopping a process by name&lt;/td&gt;
&lt;td&gt;Stop it by pid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;winget-upgrade-all&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;winget upgrade --all&lt;/code&gt; (on this PC winget mistakes one app for another, so upgrading everything may overwrite it)&lt;/td&gt;
&lt;td&gt;One at a time with &lt;code&gt;--id&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;borrowed-repo-push&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;git push&lt;/code&gt; in the repository of a tool I'm borrowing from someone&lt;/td&gt;
&lt;td&gt;Don't push&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;printf-winpath&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;C:\Users&lt;/code&gt; in a printf format (&lt;code&gt;\U&lt;/code&gt; is read as an escape)&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;%s&lt;/code&gt; and pass the path as an argument&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sometimes you mean it. Adding &lt;code&gt;# pitfall-ok:&amp;lt;rule&amp;gt;&lt;/code&gt; to the end of the command lets it through. I included that from the start.&lt;/p&gt;

&lt;p&gt;The core of the matching is &lt;strong&gt;not looking inside quotes&lt;/strong&gt;. If &lt;code&gt;echo "&amp;gt; nul"&lt;/code&gt; were blocked, explanations and &lt;code&gt;git commit -m&lt;/code&gt; messages would be blocked too. So most rules first pass the command through this function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;outsideQuotes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"s"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"d"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"\\"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;"  "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"s"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"d"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It replaces everything inside single and double quotes with the same number of spaces. Newlines stay, so lines and positions don't shift. Only &lt;code&gt;&amp;gt; nul&lt;/code&gt; or &lt;code&gt;git push&lt;/code&gt; outside quotes remains for the rule's regex. Inside double quotes, &lt;code&gt;\"&lt;/code&gt; is skipped as two characters so it isn't taken for the closing quote.&lt;/p&gt;

&lt;p&gt;Some rules do need to look inside the quotes. PowerShell's &lt;code&gt;$_&lt;/code&gt; in Bash double quotes, and &lt;code&gt;$variable&lt;/code&gt; passed to wsl, are problems precisely because of the quotes, so those rules don't use this function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tuning against commands that were really run
&lt;/h3&gt;

&lt;p&gt;Writing rules is easy. If they block too much, work stops. So I test in two stages.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: cases to block and cases to pass, per rule. There were 62 when I wrote the original, with zero wrong answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replay&lt;/strong&gt;: take the session logs updated in the last two days, extract every command in them (including old ones), run the rules over them, and count rule hits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first version had &lt;strong&gt;587&lt;/strong&gt; hits (over 24,338 commands). Many of them didn't need blocking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The body of a heredoc (text being written to a file, not executed)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash push&lt;/code&gt; (it reacted to the word &lt;code&gt;push&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm -rf&lt;/code&gt; with a variable that had just been assigned&lt;/li&gt;
&lt;li&gt;A variable from &lt;code&gt;for v in ...&lt;/code&gt; passed to wsl&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After letting those through, there were &lt;strong&gt;181 hits over 24,374 commands&lt;/strong&gt;. The script prints up to four examples per rule; I have no record of checking every hit.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Checking for listening ports with LISTEN&lt;/td&gt;
&lt;td&gt;129&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stopping a process by name&lt;/td&gt;
&lt;td&gt;32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PowerShell &lt;code&gt;$_&lt;/code&gt; etc. in Bash double quotes&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;rm -rf&lt;/code&gt; with a possibly empty variable&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;git push&lt;/code&gt; in the borrowed repository&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These logs go back further than two days. Counting only commands run in the two days before the hook went in, 8 of 2,053 would have been blocked: 4, 1 and 3 for the first three rows.&lt;/p&gt;

&lt;p&gt;The top one surprised me. Every session starts servers and checks whether they're up, and they kept using the method my list says doesn't work on this PC.&lt;/p&gt;

&lt;p&gt;The hook makes no network calls. Each check takes about 0.1 seconds, and I haven't noticed a difference in how fast work goes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guard 3: memory reservations
&lt;/h2&gt;

&lt;p&gt;The third isn't about how a command is written, but about memory.&lt;/p&gt;

&lt;p&gt;Different sessions on this PC run image generation (ComfyUI), local LLMs, and embedding servers, which use from a few GB to almost 20 GB. If they don't know about each other, two can start at once and run out. Before the accident, one session had started an embedding server (4 GB), and right after that another started ComfyUI (16 GB), and the SSD was pinned.&lt;/p&gt;

&lt;p&gt;So I wrote a script that reserves memory before a large job starts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python heavy_lease.py acquire --gb 18 --what &lt;span class="s2"&gt;"ComfyUI 8188"&lt;/span&gt; --session image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The decision &lt;strong&gt;subtracts what other reservations are still going to grow into&lt;/strong&gt;. ComfyUI is small until it loads a model, so looking only at free memory now means running out later.&lt;/li&gt;
&lt;li&gt;A reservation is tied to the process of the session that asked for it. When the process goes away, so does the reservation.&lt;/li&gt;
&lt;li&gt;The ledger is written under a lock. If it's corrupted, it's moved aside and a warning is shown.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;status&lt;/code&gt; shows current reservations and &lt;strong&gt;processes using 2 GB or more without one&lt;/strong&gt;, with their command lines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn't add a permanent monitor. If every session reserves first, this was enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in the first five days
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;From "let it through" to "block" when the hook breaks.&lt;/strong&gt; At first, if the hook itself failed (no node, a crash, a timeout), the command went through, because I didn't want a broken hook to stop all work. But then a guard could disappear without anyone noticing. Now a hook that fails blocks the command, using &lt;code&gt;"onFailure": "block"&lt;/code&gt; in the hook settings (&lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;documented&lt;/a&gt; for Claude Code v2.1.295 or later; by default the action goes ahead when a hook fails). My notes say that if every Bash command is blocked, suspect the hook first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From free memory to a pinned SSD.&lt;/strong&gt; At first I stopped a job when free memory fell below 1 GB. Then I looked at the log of a run that generated 24 images. Free memory dropped to 1.3 GB, but page file usage rose by only 0.4 percentage points. Averaged over 60 seconds, the SSD wasn't pinned at any point. What I want to avoid isn't low memory. It's heavy paging that pins the SSD and slows down the whole PC.&lt;/p&gt;

&lt;p&gt;So when no other large job is running, a job may start even without enough free memory, with a script watching the SSD. Leaving out the two minutes of model loading, it stops the job if disk use over the last 60 seconds averages above 90% &lt;strong&gt;and&lt;/strong&gt; page file usage has risen by more than 0.3 percentage points. When jobs compete, they still queue for a reservation.&lt;/p&gt;

&lt;h2&gt;
  
  
  13 days later
&lt;/h2&gt;

&lt;p&gt;I counted again by when each command was run, on this PC only (8,522 Bash calls for the second hook):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Backtick hook&lt;/th&gt;
&lt;th&gt;Known-mistakes hook&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Blocked by a rule&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4 (PowerShell &lt;code&gt;$_&lt;/code&gt; etc. 2, &lt;code&gt;winpath-backslash-in-code&lt;/code&gt; 2, the rule added later)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blocked by the 10-second timeout&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Let through with &lt;code&gt;# pitfall-ok&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;3 (all &lt;code&gt;listen-state&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Commands I ran only to test the hooks are left out. The hooks block little; I can't count how often a session avoided a mistake because it had read the rule. The timeouts are &lt;code&gt;"onFailure": "block"&lt;/code&gt; doing its job: the command didn't run.&lt;/p&gt;

&lt;p&gt;There are ten rules now. The tenth, &lt;code&gt;winpath-backslash-in-code&lt;/code&gt;, blocks Windows paths with backslashes inside sed or Python strings without &lt;code&gt;r&lt;/code&gt;. The examples went from 62 to 77, still with zero wrong answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this stops
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I don't know whether it has prevented the same accident.&lt;/strong&gt; The same kind of command has been blocked since, but I can't tell whether it would have turned into an accident.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other environments.&lt;/strong&gt; I only check Git Bash and PowerShell on Windows, with rules from this PC's list. I haven't tried Linux or macOS shells.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The replay numbers can't be reproduced exactly.&lt;/strong&gt; They depend on which logs had been updated at that moment, and those logs have grown since.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Writing a rule down isn't enough when someone's in a hurry&lt;/strong&gt;, AI or human. The list was correct, and the accident still happened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draw the line with records of what was really run.&lt;/strong&gt; My first rules had 587 hits. Letting through the forms that didn't need blocking brought that to 181. The work logs became the test data. Also write down what was counted: I first described these numbers wrongly, as commands run in two or three days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you block, also provide a way through.&lt;/strong&gt; Without &lt;code&gt;# pitfall-ok&lt;/code&gt;, someone with a good reason would look for a detour, and I'd no longer see what they did.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Something that calls itself doesn't end when you stop the top.&lt;/strong&gt; Afterwards, check how many bash processes remain and who their parents are.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/claude-code-hooks-stop-known-pitfalls" rel="noopener noreferrer"&gt;1 行のコマンドが自分を呼び続けて PC が固まった。知っている失敗を、実行の前に機械で止める&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claudecode</category>
      <category>bash</category>
      <category>windows</category>
    </item>
    <item>
      <title>llama.cpp v1 on an Integrated GPU: Long Prompts Read About 2x Faster, and the MoE Cache Lost to Full Offload</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Wed, 25 Nov 2026 03:19:36 +0000</pubDate>
      <link>https://dev.to/maruhana/llamacpp-v1-on-an-integrated-gpu-long-prompts-read-about-2x-faster-and-the-moe-cache-lost-to-7af</link>
      <guid>https://dev.to/maruhana/llamacpp-v1-on-an-integrated-gpu-long-prompts-read-about-2x-faster-and-the-moe-cache-lost-to-7af</guid>
      <description>&lt;p&gt;&lt;em&gt;Before/after llama.cpp 1.0 on an Intel Arc 140V (Vulkan): a 4,096-token prompt was read about 2x faster, but only with flash attention on. The MoE cache was slower than putting the whole model on the GPU. Plus a CUDA machine for comparison.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/llamacpp-v1-igpu-prompt-2x-moe-cache" rel="noopener noreferrer"&gt;llama.cpp v1 を内蔵 GPU で試したら、長い入力の読み込みは約 2 倍、MoE キャッシュは遅くなった&lt;/a&gt;. It includes the correction I added to the original after publication (the flash-attention re-measurement). The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: on a handheld PC whose integrated GPU shares main memory, going from a pre-1.0 llama.cpp build to a post-1.0 one roughly doubled the speed of reading a 4,096-token prompt. Re-measuring with flash attention off made the gap almost disappear. The MoE cache sped up generation a little, but slowed prompt reading and used more memory; putting the whole model on the GPU beat every cache size I could run.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intel Arc 140V (Vulkan), dense 2B model&lt;/strong&gt;: 4,096-token prompt processing went from 986 to 2,005 tokens/s (+103%). At 512 tokens it was +14%; generation didn't change beyond noise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The 2x only appears with &lt;code&gt;-fa 1&lt;/code&gt;.&lt;/strong&gt; With &lt;code&gt;-fa 0&lt;/code&gt; the old/new difference at 4,096 tokens was +2%. In the old build, flash attention was slower than no flash attention; in the new build it's faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MoE cache (&lt;code&gt;--moe-cache-mib&lt;/code&gt;) on the same PC&lt;/strong&gt;, with all experts in main memory: generation +6–15%, prompt processing −12–22%, 1–2 GB more memory. Full GPU offload generated 1.4–1.6x as fast as those setups and used the least memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NVIDIA RTX Spark N1X (CUDA), two MoE models fully offloaded&lt;/strong&gt;: prompt processing +9–26%, generation +2–4%.&lt;/li&gt;
&lt;li&gt;An Ollama model file for the same model family didn't load in llama.cpp.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt;: &lt;code&gt;llama-bench&lt;/code&gt; (and &lt;code&gt;llama-server&lt;/code&gt; timings for the MoE cache), comparing builds before and after llama.cpp 1.0.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On what&lt;/strong&gt;: two PCs whose CPU and GPU share memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PC&lt;/th&gt;
&lt;th&gt;GPU&lt;/th&gt;
&lt;th&gt;GPU memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MSI Claw 8 AI+&lt;/td&gt;
&lt;td&gt;Intel Arc 140V (integrated), Vulkan&lt;/td&gt;
&lt;td&gt;Shares 32 GB with the CPU; a setting caps how much the GPU may use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Surface Laptop Ultra&lt;/td&gt;
&lt;td&gt;NVIDIA RTX Spark N1X, CUDA (Windows on Arm)&lt;/td&gt;
&lt;td&gt;Shares about 128 GB with the CPU; 64 GB set aside as dedicated GPU memory&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not measured&lt;/strong&gt;: a PC with separate VRAM too small for the model (the case the MoE cache seems meant for), dense models on the Surface, large or MoE models in the MSI old/new comparison.&lt;/li&gt;
&lt;li&gt;Every number is from one machine on one day, averaged over two or three rounds. Versions are as recorded in November 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;llama.cpp reached 1.0.0. An English-language blog had compared it with an earlier build on an RTX 4060 Ti 8GB (&lt;a href="https://www.michaelleung.info/latest-news/llama-cpp-v1-benchmark-rtx-4060-ti-8gb" rel="noopener noreferrer"&gt;Michael Leung, "llama.cpp v1 benchmark RTX 4060 Ti 8GB"&lt;/a&gt;). For a small model that fits entirely on the GPU, it reported prompt processing a little over 20% faster and generation about the same.&lt;/p&gt;

&lt;p&gt;That post didn't measure the MoE cache, which the &lt;a href="https://github.com/ggml-org/llama.cpp/releases/tag/v1.0.0" rel="noopener noreferrer"&gt;1.0.0 release notes&lt;/a&gt; mention. (The cache itself isn't new in 1.0.0: the option came in &lt;a href="https://github.com/ggml-org/llama.cpp/releases/tag/v0.7.0" rel="noopener noreferrer"&gt;v0.7.0&lt;/a&gt;. 1.0.0 added the CPU share and a new replacement policy.) My two PCs differ from that machine and from each other, so I wanted to see whether the same version jump would look different.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 1: On the MSI, a long prompt was read about 2x faster
&lt;/h2&gt;

&lt;p&gt;I compared a build from before 1.0.0 (b12123) with one from after it (b12374), under the same conditions. The model was a small dense one that fits entirely on the GPU (PLaMo 3 Translate 2B, Q4_K_M, 1.80 GB), the same "dense model, fully offloaded" condition as the blog post.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;llama-bench -ngl 99 -fa 1 -p 512 -n 128 -r 5
llama-bench -ngl 99 -fa 1 -p 4096 -n 0 -r 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To limit order effects I ran old → new → new → old and averaged the two rounds. Units are tokens per second.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Old b12123&lt;/th&gt;
&lt;th&gt;New b12374&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 512 tokens&lt;/td&gt;
&lt;td&gt;1,907&lt;/td&gt;
&lt;td&gt;2,171&lt;/td&gt;
&lt;td&gt;+14%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 4,096 tokens&lt;/td&gt;
&lt;td&gt;986&lt;/td&gt;
&lt;td&gt;2,005&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+103%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generation, 128 tokens&lt;/td&gt;
&lt;td&gt;51.3&lt;/td&gt;
&lt;td&gt;50.0&lt;/td&gt;
&lt;td&gt;−3% (within noise)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The long prompt changed the most. In the old build, speed fell to about half as the input went from 512 to 4,096 tokens. In the new build it barely falls.&lt;/p&gt;

&lt;p&gt;In the blog post (CUDA), the 4,096-token prompt gained 24%. Vulkan on this PC gained much more. At 512 tokens it was the other way round: less than the post's 23%.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I found afterwards: it's flash attention
&lt;/h3&gt;

&lt;p&gt;A reader's comment on X pushed me to look for the cause after publishing. Among the changes between the two builds there is one that gives Intel GPUs a dedicated computation for flash attention during prompt processing (&lt;a href="https://github.com/ggml-org/llama.cpp/pull/29357" rel="noopener noreferrer"&gt;vulkan : Intel FA kernel for prefill, PR #29357&lt;/a&gt;). It covers the generation of the Arc 140V (Xe2) and is used with &lt;code&gt;-fa 1&lt;/code&gt;. The PR's own 8,192-token numbers with &lt;code&gt;-fa 1&lt;/code&gt; show gains of 1.2x to 3.9x on the Intel GPUs it lists.&lt;/p&gt;

&lt;p&gt;So I re-measured with flash attention turned off (&lt;code&gt;-fa 0&lt;/code&gt;), starting with the same old → new → new → old pattern and adding a third round (new → old), and averaged. In the first round, the very first run of each build (&lt;code&gt;-fa 0&lt;/code&gt;, 512 tokens) was cold and a third to a half slower, so I left those two runs out. The 512-token runs were noisier in general (the old build with &lt;code&gt;-fa 1&lt;/code&gt; ranged from 1,517 to 1,891).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Old b12123&lt;/th&gt;
&lt;th&gt;New b12374&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 4,096 tokens (&lt;code&gt;-fa 0&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1,387&lt;/td&gt;
&lt;td&gt;1,412&lt;/td&gt;
&lt;td&gt;+2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 4,096 tokens (&lt;code&gt;-fa 1&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;992&lt;/td&gt;
&lt;td&gt;1,921&lt;/td&gt;
&lt;td&gt;+94%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 512 tokens (&lt;code&gt;-fa 0&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1,847&lt;/td&gt;
&lt;td&gt;1,931&lt;/td&gt;
&lt;td&gt;+5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, 512 tokens (&lt;code&gt;-fa 1&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1,727&lt;/td&gt;
&lt;td&gt;2,066&lt;/td&gt;
&lt;td&gt;+20%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With &lt;code&gt;-fa 0&lt;/code&gt; the difference between old and new almost vanished. The 2x showed up only with flash attention on (&lt;code&gt;-fa 1&lt;/code&gt; nearly reproduces the 986 and 2,005 in the first table).&lt;/p&gt;

&lt;p&gt;In the old build, &lt;code&gt;-fa 1&lt;/code&gt; was slower than &lt;code&gt;-fa 0&lt;/code&gt; (992 vs. 1,387 at 4,096 tokens). In the new build it's faster (1,921 vs. 1,412). That fits the PR above: the slow flash-attention path in the old build appears to have been replaced by a fast one. I didn't revert the change on its own, though, so I can't say it's the only cause.&lt;/p&gt;

&lt;p&gt;If you stay on the old build, &lt;code&gt;-fa 0&lt;/code&gt; was the faster choice for long prompts on this PC, though still only about 70% of the new build's &lt;code&gt;-fa 1&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2: The MoE cache was slower here than full offload
&lt;/h2&gt;

&lt;p&gt;In an MoE model, many small expert networks sit inside the model and only a few are used for each token. When GPU memory is short, you can keep the experts in main memory and put the rest on the GPU (&lt;code&gt;--n-cpu-moe&lt;/code&gt;). The MoE cache copies the experts that are used often into GPU memory while doing that. The &lt;a href="https://github.com/ggml-org/llama.cpp/blob/master/docs/moe-cache.md" rel="noopener noreferrer"&gt;official notes&lt;/a&gt; say it's meant for token-by-token generation, and that during prompt processing the experts in use are sent to the GPU each time.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--moe-cache-mib N&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Size of the GPU-side cache in MiB (default 0: off)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--moe-cache-cpu-share F&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;After the cache is full, the share of cache misses computed on the CPU instead of being sent to the GPU (default 0)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The model was Gemma 4 26B-A4B Q4_0 (14.6 GB, 8 of 128 experts used, 30 layers). I put the experts of all 30 layers in main memory (&lt;code&gt;--n-cpu-moe 30&lt;/code&gt;, with attention and the rest on the GPU) and varied the cache size. The baseline was everything on the GPU (&lt;code&gt;--n-cpu-moe 0&lt;/code&gt;). &lt;code&gt;llama-bench&lt;/code&gt; in this build has no MoE-cache option, so I read the timings in &lt;code&gt;llama-server&lt;/code&gt; responses. I ran two rounds in different orders, with two runs per condition each time; the round averages differed by less than 5%. The full-GPU row is two runs from a single round at the end. Prompt and generation numbers are tokens per second.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Prompt 512&lt;/th&gt;
&lt;th&gt;Prompt 4,096&lt;/th&gt;
&lt;th&gt;Generation 128&lt;/th&gt;
&lt;th&gt;Server memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Experts in main memory, no cache&lt;/td&gt;
&lt;td&gt;346.8&lt;/td&gt;
&lt;td&gt;475.7&lt;/td&gt;
&lt;td&gt;18.5&lt;/td&gt;
&lt;td&gt;17.35 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Same, cache 1024 MiB&lt;/td&gt;
&lt;td&gt;298.6&lt;/td&gt;
&lt;td&gt;419.1&lt;/td&gt;
&lt;td&gt;19.6&lt;/td&gt;
&lt;td&gt;18.35 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Same, cache 2048 MiB&lt;/td&gt;
&lt;td&gt;276.6&lt;/td&gt;
&lt;td&gt;369.5&lt;/td&gt;
&lt;td&gt;21.3&lt;/td&gt;
&lt;td&gt;19.36 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Same, cache 4096 MiB&lt;/td&gt;
&lt;td&gt;did not start (&lt;code&gt;failed to allocate buffer for MoE cache&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Everything on the GPU&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;336.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;498.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;30.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;17.06 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With a cache, generation got 6–15% faster, prompt processing got 12–22% slower, and memory use went up by 1–2 GB. Single runs within a condition varied by up to 12%, so I wouldn't read much into the 6%. The 4096 MiB cache failed to allocate and the server didn't start.&lt;/p&gt;

&lt;p&gt;Putting everything on the GPU generated faster than any cache size (30.0 vs. 18.5–21.3 tokens/s), and it used the least memory.&lt;/p&gt;

&lt;p&gt;This PC's GPU uses main memory directly, so there was nothing to save by not putting the experts "on the GPU." The cache only spends extra memory for the copies and adds work. I believe the slower prompt processing is what the official notes describe: experts being sent each time.&lt;/p&gt;

&lt;p&gt;I think the MoE cache is for PCs whose GPU has its own VRAM that can't hold the model. Both of my PCs share memory between CPU and GPU, so I haven't tried that case. What I can say here is only this: &lt;strong&gt;on a PC that shares memory with the GPU, with the experts of all layers kept in main memory, full offload beat the cache.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An earlier article of mine (Japanese) showed that &lt;a href="https://zenn.dev/maruhana/articles/msi-claw-shared-gpu-memory-limit" rel="noopener noreferrer"&gt;raising the shared-GPU-memory cap&lt;/a&gt; on this PC and putting the same Gemma 4 26B entirely on the GPU (in Ollama then) made it faster. A feature meant as a way out when the model doesn't all fit gave the same answer here: if it fits, put all of it on the GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3: The Surface got faster at reading, too
&lt;/h2&gt;

&lt;p&gt;On the Surface I compared the older build b12110 with b12374: the Windows CUDA build, with dedicated GPU memory at its usual 64 GB. Other servers were stopped, and I ran old → new → new → old, two runs per build.&lt;/p&gt;

&lt;p&gt;The same "small dense model, fully offloaded" isn't installed there, so I used two MoE models I have, both fully on the GPU.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Prompt 512&lt;/th&gt;
&lt;th&gt;Prompt 4,096&lt;/th&gt;
&lt;th&gt;Generation 128&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Nemotron 3.5 Bolt 74B-A9B IQ2_XXS (20.5 GiB)&lt;/td&gt;
&lt;td&gt;1,141 → 1,436 (+26%)&lt;/td&gt;
&lt;td&gt;1,172 → 1,434 (+22%)&lt;/td&gt;
&lt;td&gt;41.2 → 42.1 (+2%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.6-35B-A3B Q6_K (26.6 GiB)&lt;/td&gt;
&lt;td&gt;2,411 → 2,649 (+10%)&lt;/td&gt;
&lt;td&gt;2,268 → 2,475 (+9%)&lt;/td&gt;
&lt;td&gt;74.9 → 78.2 (+4%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prompt processing gained 9–26%, and generation stayed about the same. That's the same tendency as the blog post (CUDA). The long-prompt jump I saw on the MSI didn't appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  A snag: an Ollama model file wouldn't load in llama.cpp
&lt;/h2&gt;

&lt;p&gt;For the MoE test I first tried to give llama.cpp the Gemma 4 26B file I used with Ollama. Both are GGUF, so I expected it to work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wrong number of tensors; expected 1014, got 658
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It failed to start with this. The file Ollama had converted for itself didn't have the layout llama.cpp expects. Downloading the GGUF that ggml-org publishes on Hugging Face fixed it.&lt;/p&gt;

&lt;p&gt;My test script also waited up to 5 minutes for the server to come up, so it wasted time waiting even after loading had failed. I changed it to stop as soon as a failure shows up in the log.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this stops
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I traced the MSI's 2x only as far as the change in flash-attention computation.&lt;/strong&gt; I haven't reverted the changes one by one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The MSI old/new comparison used one dense 2B model.&lt;/strong&gt; Whether large or MoE models gain as much isn't measured.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I haven't tried the MoE cache on a PC with separate VRAM that can't hold the model&lt;/strong&gt;, which is the case it should help.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I didn't try keeping only some layers' experts in main memory&lt;/strong&gt; (a smaller &lt;code&gt;--n-cpu-moe&lt;/code&gt;). On the MSI the model fits on the GPU, so I judged there was no use for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I didn't use the official tuning script&lt;/strong&gt; (&lt;code&gt;scripts/moe-cache-tune.py&lt;/code&gt;), and left &lt;code&gt;--moe-cache-cpu-share&lt;/code&gt; at 0. I also used the default load mode (mmap); the official notes say the experts aren't pinned in host memory then, and I didn't try the modes that pin them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No dense model on the Surface.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Every comparison is one machine, one day, averaged over two or three rounds.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On an integrated GPU that shares memory, moving to a post-1.0 llama.cpp build roughly doubled the speed of reading a 4,096-token prompt. If you compare builds, &lt;strong&gt;try &lt;code&gt;-fa 0&lt;/code&gt; as well as &lt;code&gt;-fa 1&lt;/code&gt;&lt;/strong&gt;: here it showed where the gain came from.&lt;/li&gt;
&lt;li&gt;On the CUDA PC the gain was +9–26% in prompt processing, similar to an earlier report from another machine.&lt;/li&gt;
&lt;li&gt;The MoE cache raised generation a little and lowered prompt speed while using more memory, on this shared-memory PC. If the model fits entirely on the GPU, that was the faster choice.&lt;/li&gt;
&lt;li&gt;A GGUF that Ollama created isn't necessarily loadable by llama.cpp.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my Japanese-language series on running local LLMs on an integrated GPU. Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/msi-claw-shared-gpu-memory-limit" rel="noopener noreferrer"&gt;内蔵 GPU の共有メモリーの上限を変えたら…&lt;/a&gt; (Japanese): the shared-memory cap on this MSI&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine&lt;/a&gt; (English): the Surface&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg"&gt;A 120B Model Ran About 4x Faster Than a 27B One: 8 Local LLMs on a Surface Laptop Ultra&lt;/a&gt; (English): the Surface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/llamacpp-v1-igpu-prompt-2x-moe-cache" rel="noopener noreferrer"&gt;llama.cpp v1 を内蔵 GPU で試したら、長い入力の読み込みは約 2 倍、MoE キャッシュは遅くなった&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>llamacpp</category>
      <category>vulkan</category>
    </item>
    <item>
      <title>Image Translation with a Local LLM: 30 Seconds on My Laptop's CPU, 0.7 Seconds on a GPU</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:11:45 +0000</pubDate>
      <link>https://dev.to/maruhana/image-translation-with-a-local-llm-30-seconds-on-my-laptops-cpu-07-seconds-on-a-gpu-1d4c</link>
      <guid>https://dev.to/maruhana/image-translation-with-a-local-llm-30-seconds-on-my-laptops-cpu-07-seconds-on-a-gpu-1d4c</guid>
      <description>&lt;p&gt;&lt;em&gt;TranslateGemma 4B in Ollama, fed one new 1920x1080 image at a time: 29–34 s on a laptop CPU, about 0.7 s on an RTX Spark GPU. The image cost is a fixed 256 tokens either way; what changed is its price. The prompt-cache trap showed up on the GPU too.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/local-llm-image-translation-gpu-retest" rel="noopener noreferrer"&gt;ローカルLLMの画像翻訳30秒は、GPUで0.7秒になった&lt;/a&gt;. It includes the addendum I added to the original after publication. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: sending a camera frame straight to TranslateGemma 4B took about 30 seconds on my laptop's CPU, so I had dropped the idea. On a machine with an NVIDIA GPU, the same measurement took about 0.7 seconds per new image. With only the GPU switched on and off on that same machine, the gap was about 25×.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 67-second video summary (narration is synthetic):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/a63tb0KFxg8" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Same script, same prompt, &lt;code&gt;translategemma:4b&lt;/code&gt; in Ollama, one new 1920x1080 image per request: &lt;strong&gt;0.665–0.698 s per image on an RTX Spark N1X&lt;/strong&gt;, versus 29–34 s on my laptop's CPU (Core Ultra 7 258V) earlier.&lt;/li&gt;
&lt;li&gt;The prompt was &lt;strong&gt;326 tokens every time&lt;/strong&gt;, image included. Gemma 3-family image input is a fixed 256 tokens. The structure didn't change; the price of that fixed cost did.&lt;/li&gt;
&lt;li&gt;The image-encoding step that took about 23 s on the laptop CPU took &lt;strong&gt;at most about 0.5 s&lt;/strong&gt; here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The prompt-cache trap appeared on the GPU too&lt;/strong&gt;: an exact duplicate of image 1 came back in 0.151 s, more than 4× faster than a new image.&lt;/li&gt;
&lt;li&gt;With matched conditions (same machine, same Ollama, GPU on vs. off), &lt;strong&gt;the GPU accounted for about 25×&lt;/strong&gt;. On my laptop, a newer Ollama (0.40.11) made the integrated GPU about 1.5× faster than the CPU, but still 16–20 s.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt;: translating English text in an image with TranslateGemma 4B (&lt;code&gt;translategemma:4b&lt;/code&gt;, Q4_K_M, 3.3GB download) via the Ollama API, one image per request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On what&lt;/strong&gt;: a Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X, CPU and GPU share memory), and for comparison my laptop (Intel Core Ultra 7 258V).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measured&lt;/strong&gt;: round-trip time plus the server's own breakdown (&lt;code&gt;prompt_eval_duration&lt;/code&gt;, &lt;code&gt;eval_duration&lt;/code&gt;, &lt;code&gt;prompt_eval_count&lt;/code&gt;) for 5 new images, 1 exact duplicate, 1 text-only request, and 1 warm-up. One run per condition; no spread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not measured&lt;/strong&gt;: real camera frames on the GPU machine (synthetic images only), translation quality, larger models.&lt;/li&gt;
&lt;li&gt;Versions are as recorded in November 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Background: why 30 seconds
&lt;/h2&gt;

&lt;p&gt;I was trying to translate English seen through the camera of my XR glasses (VITURE Luma Cyber). One approach was to give the camera frame directly to &lt;a href="https://blog.google/innovation-and-ai/technology/developers-tools/translategemma/" rel="noopener noreferrer"&gt;TranslateGemma&lt;/a&gt; 4B, with no OCR step.&lt;/p&gt;

&lt;p&gt;On my laptop (Core Ultra 7 258V, Ollama on the CPU), a new image took 29–34 seconds. Almost all of that was input processing before generation, and about 23 seconds of it went to turning the image into tokens (the image encoder). At the time, with Ollama 0.32.6, enabling the integrated GPU made text input processing about 5.7× faster but left those 23 seconds almost unchanged. For glasses captions, where a few seconds is the most anyone will wait, 30 seconds was out, so I went with OCR plus text translation (about 4 seconds).&lt;/p&gt;

&lt;p&gt;I had first measured this approach at 2.7 seconds. That number came from sending the same image twice: the second request hit Ollama's prompt cache. That trap was the subject of the previous article (in Japanese, linked at the end).&lt;/p&gt;

&lt;p&gt;One question was left open: &lt;strong&gt;was the 23-second image encoder a cost of the runtime, or a limit of the hardware?&lt;/strong&gt; I had kept the code for the dropped approach, with its prompts and measurement conditions, so that I could answer it on a different GPU. A Surface Laptop Ultra with an NVIDIA RTX Spark N1X gave me that chance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conditions
&lt;/h2&gt;

&lt;p&gt;I applied what I had learned from the cache trap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A new image every time.&lt;/strong&gt; Five synthetic 1920x1080 images (black English text on white, the camera's resolution), each with different text. Plus &lt;strong&gt;one exact copy of image 1&lt;/strong&gt; to see the cache effect, and one separate image for warm-up.&lt;/li&gt;
&lt;li&gt;Prompt, temperature (0) and &lt;code&gt;keep_alive&lt;/code&gt; the same as in the app. One image per request to the Ollama API.&lt;/li&gt;
&lt;li&gt;Not just a stopwatch round trip: &lt;strong&gt;I recorded the server's own breakdown&lt;/strong&gt; (&lt;code&gt;prompt_eval_duration&lt;/code&gt;, &lt;code&gt;eval_duration&lt;/code&gt; and so on) every time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the Surface I installed the Windows ARM64 build of Ollama as is. The startup log showed it using CUDA, &lt;code&gt;ollama ps&lt;/code&gt; showed "100% GPU" after loading the model, and nvidia-smi showed about 6,500MiB more in use. No x64 emulation and no custom build. Ollama's &lt;a href="https://github.com/ollama/ollama/releases/tag/v0.32.3" rel="noopener noreferrer"&gt;0.32.3 release notes&lt;/a&gt; list CUDA support on Windows ARM64, and it worked as described.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result: about 0.7 seconds per new image
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Round trip&lt;/th&gt;
&lt;th&gt;Input processing (prompt_eval)&lt;/th&gt;
&lt;th&gt;Generation (eval)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Warm-up (includes model load)&lt;/td&gt;
&lt;td&gt;3.69 s&lt;/td&gt;
&lt;td&gt;0.77 s&lt;/td&gt;
&lt;td&gt;0.07 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New image 1&lt;/td&gt;
&lt;td&gt;0.695 s&lt;/td&gt;
&lt;td&gt;0.59 s&lt;/td&gt;
&lt;td&gt;0.05 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New image 2&lt;/td&gt;
&lt;td&gt;0.665 s&lt;/td&gt;
&lt;td&gt;0.54 s&lt;/td&gt;
&lt;td&gt;0.05 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New image 3&lt;/td&gt;
&lt;td&gt;0.688 s&lt;/td&gt;
&lt;td&gt;0.55 s&lt;/td&gt;
&lt;td&gt;0.10 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New image 4&lt;/td&gt;
&lt;td&gt;0.686 s&lt;/td&gt;
&lt;td&gt;0.55 s&lt;/td&gt;
&lt;td&gt;0.10 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New image 5&lt;/td&gt;
&lt;td&gt;0.698 s&lt;/td&gt;
&lt;td&gt;0.55 s&lt;/td&gt;
&lt;td&gt;0.12 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exact copy of image 1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.151 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.05 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.04 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(Reference) text only&lt;/td&gt;
&lt;td&gt;0.329 s&lt;/td&gt;
&lt;td&gt;0.05 s&lt;/td&gt;
&lt;td&gt;0.26 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All five new images came back in 0.665–0.698 s. What took 29–34 s on the laptop CPU took about 0.7 s on this GPU. The translations made sense (for example, the Japanese equivalents of "emergency exit only" and "no smoking area"). I didn't keep the CPU-side translations, so I haven't compared the output.&lt;/p&gt;

&lt;p&gt;The prompt token count (&lt;code&gt;prompt_eval_count&lt;/code&gt;) was &lt;strong&gt;326 every time&lt;/strong&gt;, as before. Gemma 3-family image input is designed as a fixed 256 tokens (&lt;a href="https://arxiv.org/abs/2503.19786" rel="noopener noreferrer"&gt;technical report&lt;/a&gt;), and this matches. The structure, a fixed cost per image, didn't change at all. &lt;strong&gt;What changed was the price of that fixed cost.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The open question
&lt;/h2&gt;

&lt;p&gt;Input processing took 0.05 s for text only and 0.54–0.59 s with an image. The difference means that on this GPU, &lt;strong&gt;turning the image into tokens took at most about 0.5 s&lt;/strong&gt; (an upper bound that also includes reading the image's 256 tokens; computed the same way as the previous article, it's about 0.24–0.29 s; see the notes). On the laptop CPU this step took about 23 s.&lt;/p&gt;

&lt;p&gt;So, runtime or hardware? From this run alone I couldn't fully say. What I could say is that &lt;strong&gt;the image encoder itself is not a 23-second job.&lt;/strong&gt; Same model, same fixed 256 tokens, and on a different machine and runtime it ran in at most about 0.5 s.&lt;/p&gt;

&lt;p&gt;This run was not an A/B comparison on one machine: the machine, the OS architecture and the Ollama version all differed. That's why I measured again with matched conditions; see "Re-measured with matched conditions" below.&lt;/p&gt;

&lt;h2&gt;
  
  
  The measurement trap doesn't care how fast the machine is
&lt;/h2&gt;

&lt;p&gt;This is the part I most wanted to write down. &lt;strong&gt;Only the exact copy of image 1 came back in 0.151 s.&lt;/strong&gt; Input processing fell from 0.59 s to 0.05 s. That's the prompt cache.&lt;/p&gt;

&lt;p&gt;The trap that made me record 2.7 s instead of 30 s on the CPU is not a quirk of slow hardware. It shows up in exactly the same form on a fast GPU. If I had measured by sending the same test image repeatedly, I would have recorded a 0.7-second job as 0.15 seconds, more than a 4× error. That's plenty to get an adoption decision wrong.&lt;/p&gt;

&lt;p&gt;Making a new input for every measurement is tedious. But as the duplicate row in the table shows, skip that step and the number you record is a different number.&lt;/p&gt;

&lt;h2&gt;
  
  
  What 0.7 seconds means
&lt;/h2&gt;

&lt;p&gt;For glasses captions, the bar was "a few seconds." 30 seconds was out of the question, and I fell back to OCR plus text translation (about 4 s). With a GPU like this one, &lt;strong&gt;translating the image directly, skipping the OCR step entirely, works in 0.7 s.&lt;/strong&gt; Detecting, reading and translating the text all happen in one model call.&lt;/p&gt;

&lt;p&gt;That said, the handheld PC I actually use has no NVIDIA GPU, so this is an option for people who have that kind of machine. My own setup stays OCR plus text translation. And faster doesn't mean better: the translations are still those of a 4B model, with the same stiffness and the same mistakes. Whether a larger model translates better is a separate question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Re-measured with matched conditions
&lt;/h2&gt;

&lt;p&gt;After I published the original, a reader commented on how much difference a graphics card makes. The comparison above couldn't separate the GPU from the runtime, because the machine, the OS and the Ollama version all differed. So I measured again with the conditions matched.&lt;/p&gt;

&lt;p&gt;Same script, images and procedure as above (5 new images, 1 duplicate, 1 text-only request, 1 warm-up; temperature 0; &lt;code&gt;translategemma:4b&lt;/code&gt;). One run per condition.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;New image&lt;/th&gt;
&lt;th&gt;Of which input processing&lt;/th&gt;
&lt;th&gt;Same image, 2nd time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Surface, GPU (CUDA, Ollama 0.40.10)&lt;/td&gt;
&lt;td&gt;0.64–0.70 s&lt;/td&gt;
&lt;td&gt;0.53–0.55 s&lt;/td&gt;
&lt;td&gt;0.16 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Surface, CPU only (same PC, same version)&lt;/td&gt;
&lt;td&gt;16.4–17.5 s&lt;/td&gt;
&lt;td&gt;16.1–17.3 s&lt;/td&gt;
&lt;td&gt;0.37 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;My laptop, CPU (Ollama 0.40.11)&lt;/td&gt;
&lt;td&gt;28.2–29.7 s&lt;/td&gt;
&lt;td&gt;27.9–29.2 s&lt;/td&gt;
&lt;td&gt;0.48 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;My laptop, integrated GPU (same version, Vulkan)&lt;/td&gt;
&lt;td&gt;16.3–20.0 s&lt;/td&gt;
&lt;td&gt;15.7–19.3 s&lt;/td&gt;
&lt;td&gt;1.01 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For the Surface CPU-only run I kept the same Ollama and set &lt;code&gt;num_gpu: 0&lt;/code&gt; on each request. &lt;code&gt;ollama ps&lt;/code&gt; showed "100% GPU" for the GPU run and "100% CPU" for the CPU run.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the same PC with the same Ollama, switching only the GPU made &lt;strong&gt;about a 25× difference.&lt;/strong&gt; The GPU was the biggest reason for the gap.&lt;/li&gt;
&lt;li&gt;Updating my laptop's Ollama to the newer version still gave 28–30 s on the CPU, about the same as the original 29–34 s. On the CPU, the version wasn't the difference.&lt;/li&gt;
&lt;li&gt;CPU vs. CPU, the Surface (20 Arm cores) took about 17 s and my laptop about 29 s. The roughly 23 s image-encoding cost was the price of paying it on my laptop's CPU.&lt;/li&gt;
&lt;li&gt;"Enabling the integrated GPU didn't shrink it" was true with the old version (0.32.6). With the current version, the integrated GPU took 16–20 s, about 1.5× faster than the CPU. Still far from the GPU's 0.7 s. I haven't looked into what changed between versions.&lt;/li&gt;
&lt;li&gt;The second-request trap appeared in all four conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Before concluding "this step is slow," separate &lt;strong&gt;a fixed cost of the design&lt;/strong&gt; from &lt;strong&gt;the price of the environment you pay it in.&lt;/strong&gt; Here the structure (a fixed 256 tokens) stayed the same, and the price went from about 23 s to at most about 0.5 s.&lt;/li&gt;
&lt;li&gt;The prompt-cache trap doesn't depend on the environment. Measuring on a GPU doesn't let you skip "a new input every time."&lt;/li&gt;
&lt;li&gt;If you drop an approach, keep its prompts and measurement conditions in code. When the environment changes, checking again is quick. Here, setup through measurement took less than an hour (the measurement itself took minutes).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One run per condition (1 warm-up + 5 new images + 1 duplicate + 1 text-only); no spread.&lt;/li&gt;
&lt;li&gt;GPU side: Surface Laptop Ultra (Windows ARM64), NVIDIA RTX Spark N1X (Blackwell generation, CPU and GPU share memory), Ollama 0.40.10 for Windows ARM64. The startup log read "inference compute library=CUDA compute=12.1 driver=13.5". Model: Ollama's &lt;code&gt;translategemma:4b&lt;/code&gt; (Q4_K_M, 3.3GB download).&lt;/li&gt;
&lt;li&gt;The CPU-side numbers in the main text (29–34 s, about 23 s for the image encoder, 5.7× with the integrated GPU) are from the previous article, on a Core Ultra 7 258V with Ollama 0.32.6. &lt;strong&gt;Machine, OS and Ollama version all differ, so the main comparison is not same-condition A/B.&lt;/strong&gt; The matched comparison is in the re-measurement section.&lt;/li&gt;
&lt;li&gt;"Input processing" is &lt;code&gt;prompt_eval_duration&lt;/code&gt; in the response, "generation" is &lt;code&gt;eval_duration&lt;/code&gt;. Ollama's documentation defines the former as the time spent evaluating prompt tokens that were not cached.&lt;/li&gt;
&lt;li&gt;Images are synthetic 1920x1080 (same as the camera), black English text on white. I didn't measure real camera frames here. Previously, real camera frames (about 30 s) and new synthetic images (29–34 s) took about the same time, but that wasn't a direct comparison, and there's no guarantee real frames run at the same speed in this environment.&lt;/li&gt;
&lt;li&gt;"At most about 0.5 s to turn the image into tokens" is the input processing with an image (0.54–0.59 s) minus text-only input processing (0.05 s), so it includes reading the image's 256 tokens. The previous article's 23 s was computed differently: it converted 326 tokens at the per-token time of text and subtracted that. Using that same conversion (50.7 ms ÷ 54 × 326 ≈ 0.31 s) gives about 0.24–0.29 s here.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is a side story in my Japanese-language series on real-time stereo 3D for XR glasses with AI depth estimation; it tested the camera of the same VITURE glasses. Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/local-llm-image-translation-cache-pitfall" rel="noopener noreferrer"&gt;ローカルLLMの画像翻訳が2.7秒から30秒になった計測の落とし穴&lt;/a&gt; (Japanese): the previous article, on the prompt-cache trap&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/xr-ai-depth-3d-viewer-overview" rel="noopener noreferrer"&gt;XRグラスの映像をAIでリアルタイム立体視にする&lt;/a&gt; (Japanese): the series entry point&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg"&gt;A 120B Model Ran About 4x Faster Than a 27B One: 8 Local LLMs on a Surface Laptop Ultra&lt;/a&gt; (English): same Surface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/local-llm-image-translation-gpu-retest" rel="noopener noreferrer"&gt;ローカルLLMの画像翻訳30秒は、GPUで0.7秒になった&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ollama</category>
      <category>gemma</category>
      <category>llm</category>
      <category>cuda</category>
    </item>
    <item>
      <title>Whisper turbo vs. medium on Arm and CUDA: The Faster Model Still Flipped Between CPU and GPU</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Wed, 18 Nov 2026 00:21:51 +0000</pubDate>
      <link>https://dev.to/maruhana/whisper-turbo-vs-medium-on-arm-and-cuda-the-faster-model-still-flipped-between-cpu-and-gpu-5g59</link>
      <guid>https://dev.to/maruhana/whisper-turbo-vs-medium-on-arm-and-cuda-the-faster-model-still-flipped-between-cpu-and-gpu-5g59</guid>
      <description>&lt;p&gt;&lt;em&gt;whisper.cpp v1.9.5, one recording, four builds (x86 CPU, Intel iGPU, Arm CPU, RTX Spark CUDA): medium was faster on both CPUs, turbo was faster or tied on both GPUs, and the per-phase timings had the same shape on all four.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/smartwatch-whisper-arm-cuda-four-builds" rel="noopener noreferrer"&gt;whisper の turbo と medium、Arm の CPU と CUDA でも速い順は入れ替わった&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: on an x86 CPU and an Arm CPU, medium was faster than large-v3-turbo; on two different GPUs, turbo was faster (or tied in total), and the per-phase timings explained the flip the same way on all four.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 67-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/FmzM1ir37co" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Same recording, same arguments, whisper.cpp v1.9.5, four builds: x86 CPU (AVX2), x86 integrated GPU (Intel Arc 140V, Vulkan), Arm CPU (NEON), Arm GPU (RTX Spark N1X, CUDA).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;medium was faster on both CPUs&lt;/strong&gt; (1.27× and 1.43×). &lt;strong&gt;turbo was faster on CUDA&lt;/strong&gt; (by 257ms). On the integrated GPU the totals were a tie (15ms apart), but turbo was faster once model loading is excluded.&lt;/li&gt;
&lt;li&gt;The breakdown had the same shape on all four: turbo gains in the decoder and loses in the encoder, and which is larger depends on the hardware.&lt;/li&gt;
&lt;li&gt;Building whisper.cpp with MSVC on Windows on Arm didn't use NEON and was 5.6–10.2× slower than a clang build. One line of &lt;code&gt;system_info&lt;/code&gt; shows it.&lt;/li&gt;
&lt;li&gt;The faster the GPU, the more of the total is model loading, which hides the compute difference. On CUDA, 1,118ms of turbo's 1,537ms was loading.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt;: transcribing one short Japanese clip with whisper.cpp, comparing &lt;code&gt;large-v3-turbo&lt;/code&gt; (fp16), &lt;code&gt;medium&lt;/code&gt;, and turbo's q5_0 quantization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On what&lt;/strong&gt;: an x86 laptop (Intel Core Ultra 7 258V with the Arc 140V integrated GPU) and a Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X). One CPU build and one GPU build on each.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measured&lt;/strong&gt;: CLI total time and per-phase time (load, encode, batchd), averaged over runs 2–5; round-trip time to a resident server; &lt;code&gt;-t 8&lt;/code&gt; vs. &lt;code&gt;-t 20&lt;/code&gt; on the Arm CPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not measured&lt;/strong&gt;: see "Where this stops" near the end.&lt;/li&gt;
&lt;li&gt;Versions are as recorded in October 2026, when I wrote the original.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This continues an earlier article (in Japanese): &lt;a href="https://zenn.dev/maruhana/articles/smartwatch-whisper-turbo-cpu-slower" rel="noopener noreferrer"&gt;whisper の turbo と medium、速いほうが CPU と内蔵 GPU で入れ替わった&lt;/a&gt;. That one covers the method (same recording, same arguments, each condition run 5 times in a row with the first run discarded) and how to read the phase timings. There, on one PC, medium was faster on the CPU and turbo was faster on the integrated GPU. This time I added a second PC with a different CPU architecture and a different GPU family.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result first
&lt;/h2&gt;

&lt;p&gt;whisper.cpp at v1.9.5 on both machines, same recording, same arguments. Average of runs 2–5, in ms.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;x86 CPU&lt;/th&gt;
&lt;th&gt;x86 iGPU&lt;/th&gt;
&lt;th&gt;Arm CPU&lt;/th&gt;
&lt;th&gt;Arm CUDA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (fp16)&lt;/td&gt;
&lt;td&gt;13,192&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2,393&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;13,873&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,537&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10,370&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,408&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9,698&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,794&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (q5_0)&lt;/td&gt;
&lt;td&gt;12,021&lt;/td&gt;
&lt;td&gt;1,371&lt;/td&gt;
&lt;td&gt;7,108&lt;/td&gt;
&lt;td&gt;795&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Faster of turbo and medium&lt;/td&gt;
&lt;td&gt;medium (1.27×)&lt;/td&gt;
&lt;td&gt;tie (15ms apart)&lt;/td&gt;
&lt;td&gt;medium (1.43×)&lt;/td&gt;
&lt;td&gt;turbo (by 257ms)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On both CPUs, medium was faster.&lt;/strong&gt; x86 uses AVX2 and Arm uses NEON: different instruction sets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On the GPUs, turbo was faster.&lt;/strong&gt; Only the integrated GPU (Vulkan) came out a tie in total on this version. As I noted at the end of the previous article, the spread across the 4 runs overlaps; excluding loading, turbo is 188ms faster.&lt;/li&gt;
&lt;li&gt;The transcription matched the correct text in every condition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The previous comparison was within one PC, so I couldn't tell whether the explanation "where the encoder is heavy, the model with the smaller encoder wins" was specific to that PC. The same direction showed up on a CPU with a different instruction set and on a different family of GPU, so the explanation now covers a little more ground.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Both machines used the same recording (Japanese speech recorded with the watch's microphone, 6.635 s, 16kHz, mono, 16-bit) and the same arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;whisper-cli -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; -l ja -t &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;threads&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; -bs 5 -bo 5 -f sample.wav -otxt -nt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;x86 PC&lt;/th&gt;
&lt;th&gt;Arm PC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Machine&lt;/td&gt;
&lt;td&gt;Laptop with Intel Core Ultra 7 258V&lt;/td&gt;
&lt;td&gt;Surface Laptop Ultra (Windows 11 Arm64)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU&lt;/td&gt;
&lt;td&gt;8 cores, 8 threads (AVX2)&lt;/td&gt;
&lt;td&gt;Arm cores of the NVIDIA RTX Spark N1X (20 threads)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU&lt;/td&gt;
&lt;td&gt;Integrated Intel Arc 140V (Vulkan build)&lt;/td&gt;
&lt;td&gt;RTX Spark N1X GPU (6144 cores, Blackwell, CUDA 13.4 build)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU build&lt;/td&gt;
&lt;td&gt;MSVC, AVX2. &lt;strong&gt;No BLAS&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;clang 19.1.5 (&lt;code&gt;arm64-windows-llvm&lt;/code&gt; toolchain), NEON. No BLAS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Threads&lt;/td&gt;
&lt;td&gt;&lt;code&gt;-t 8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;-t 8&lt;/code&gt; (20-thread results later)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I built whisper.cpp v1.9.5 myself on both machines, from the same commit.&lt;/strong&gt; The x86 numbers in the previous article were 1.8.4, and the CPU side there was the official prebuilt package with OpenBLAS. This time the x86 CPU build has no OpenBLAS, so &lt;strong&gt;the previous CPU column differs in two ways: version and BLAS.&lt;/strong&gt; Please read the previous table (1.8.4 vs. 1.8.4) and this 4-column table as separate comparisons.&lt;/li&gt;
&lt;li&gt;Without BLAS, the encoder is clearly slower. On the same PC, turbo's encode went from 7,700ms with 1.8.4 (OpenBLAS) to 11,235ms with v1.9.5 (no BLAS). &lt;strong&gt;The Arm CPU build has no BLAS either, so the two CPU columns are matched on "no BLAS".&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The Arm build needed clang's OpenMP runtime (&lt;code&gt;libomp140.aarch64.dll&lt;/code&gt;) at run time. I used the debug, non-redistributable copy bundled with Visual Studio, so &lt;strong&gt;this is for testing only and can't be redistributed.&lt;/strong&gt; I'm not distributing the built executables or DLLs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  On Windows on Arm, MSVC doesn't use NEON
&lt;/h2&gt;

&lt;p&gt;At first I built the Arm CPU version with MSVC. These are its numbers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;MSVC build&lt;/th&gt;
&lt;th&gt;clang build&lt;/th&gt;
&lt;th&gt;Ratio&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (fp16)&lt;/td&gt;
&lt;td&gt;84,531ms&lt;/td&gt;
&lt;td&gt;13,873ms&lt;/td&gt;
&lt;td&gt;6.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;53,894ms&lt;/td&gt;
&lt;td&gt;9,698ms&lt;/td&gt;
&lt;td&gt;5.6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (q5_0)&lt;/td&gt;
&lt;td&gt;72,145ms&lt;/td&gt;
&lt;td&gt;7,108ms&lt;/td&gt;
&lt;td&gt;10.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;6.6 seconds of audio took 84 seconds. One line of &lt;code&gt;system_info&lt;/code&gt; shows why:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# MSVC build (no NEON)
system_info: n_threads = 8 / 20 | ... | CPU : ARM_FMA = 1 | MATMUL_INT8 = 1 | DOTPROD = 1 | OPENMP = 1 | REPACK = 1 |

# clang build (NEON = 1 appears)
system_info: n_threads = 8 / 20 | ... | CPU : NEON = 1 | ARM_FMA = 1 | MATMUL_INT8 = 1 | DOTPROD = 1 | OPENMP = 1 | REPACK = 1 |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the MSVC I used, the list of predefined macros (&lt;code&gt;cl /PD&lt;/code&gt;) had no &lt;code&gt;__ARM_NEON&lt;/code&gt;. ggml's CPU backend switches code paths on whether &lt;code&gt;__ARM_NEON&lt;/code&gt; is defined, so an MSVC build runs matrix multiplication and the like in generic C code. When I tried to work around it by passing &lt;code&gt;/D__ARM_NEON=1&lt;/code&gt; from outside, compilation failed in the NEON helper functions. (&lt;strong&gt;At least in v1.9.5&lt;/strong&gt;, that means ggml's NEON path can't be used with MSVC.)&lt;/p&gt;

&lt;p&gt;The whisper.cpp repository has a clang toolchain file for Windows on Arm, and specifying it gave &lt;code&gt;NEON = 1&lt;/code&gt;. Other things I tried on the MSVC build, such as turning off flash attention or enabling llamafile's sgemm, made no difference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look at &lt;code&gt;system_info&lt;/code&gt; before measuring speed.&lt;/strong&gt; That's all it is, but if I had only looked at the totals, I would have stopped at "the Arm CPU is slow." As far as I found, when building this kind of library on Windows on Arm, the choice of compiler seems to make an order-of-magnitude difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  By phase, all four had the same shape
&lt;/h2&gt;

&lt;p&gt;From the phase timings whisper.cpp prints on exit, I took the encoder (&lt;code&gt;encode&lt;/code&gt;) and the decoder side (&lt;code&gt;batchd&lt;/code&gt;) and lined up turbo minus medium. Positive means turbo loses; negative means turbo gains.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Environment&lt;/th&gt;
&lt;th&gt;encode diff&lt;/th&gt;
&lt;th&gt;batchd diff&lt;/th&gt;
&lt;th&gt;Total diff&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;x86 CPU&lt;/td&gt;
&lt;td&gt;+4,604ms&lt;/td&gt;
&lt;td&gt;−1,653ms&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+2,822ms&lt;/strong&gt; (turbo slower)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CPU&lt;/td&gt;
&lt;td&gt;+5,267ms&lt;/td&gt;
&lt;td&gt;−1,067ms&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+4,176ms&lt;/strong&gt; (turbo slower)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 iGPU&lt;/td&gt;
&lt;td&gt;+312ms&lt;/td&gt;
&lt;td&gt;−455ms&lt;/td&gt;
&lt;td&gt;−15ms (tie)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CUDA&lt;/td&gt;
&lt;td&gt;+24ms&lt;/td&gt;
&lt;td&gt;−391ms&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;−257ms&lt;/strong&gt; (turbo faster)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;turbo is large-v3 with the decoder cut from 32 layers to 4. The encoder stays the same as large-v3: 32 layers, 1280 dimensions (medium has 24 layers, 1024 dimensions). So turbo gains on the decoder side and loses in the encoder. &lt;strong&gt;Which of the two is larger flips with the environment.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the CPUs the encoder loss is large. On the GPUs the encoder gap shrinks, so the decoder gain wins. On CUDA the encoder gap was down to 24ms, and the cost of turbo's larger encoder was barely visible.&lt;/p&gt;

&lt;p&gt;The raw breakdown (&lt;code&gt;-t 8&lt;/code&gt;, average of runs 2–5, ms):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Environment&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;load&lt;/th&gt;
&lt;th&gt;encode&lt;/th&gt;
&lt;th&gt;batchd&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;x86 CPU&lt;/td&gt;
&lt;td&gt;turbo fp16&lt;/td&gt;
&lt;td&gt;1,268&lt;/td&gt;
&lt;td&gt;11,235&lt;/td&gt;
&lt;td&gt;519&lt;/td&gt;
&lt;td&gt;13,192&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 CPU&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;1,223&lt;/td&gt;
&lt;td&gt;6,631&lt;/td&gt;
&lt;td&gt;2,171&lt;/td&gt;
&lt;td&gt;10,370&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CPU&lt;/td&gt;
&lt;td&gt;turbo fp16&lt;/td&gt;
&lt;td&gt;1,186&lt;/td&gt;
&lt;td&gt;12,005&lt;/td&gt;
&lt;td&gt;564&lt;/td&gt;
&lt;td&gt;13,873&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CPU&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;1,146&lt;/td&gt;
&lt;td&gt;6,738&lt;/td&gt;
&lt;td&gt;1,631&lt;/td&gt;
&lt;td&gt;9,698&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 iGPU&lt;/td&gt;
&lt;td&gt;turbo fp16&lt;/td&gt;
&lt;td&gt;1,230&lt;/td&gt;
&lt;td&gt;720&lt;/td&gt;
&lt;td&gt;309&lt;/td&gt;
&lt;td&gt;2,393&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 iGPU&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;1,057&lt;/td&gt;
&lt;td&gt;408&lt;/td&gt;
&lt;td&gt;763&lt;/td&gt;
&lt;td&gt;2,408&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CUDA&lt;/td&gt;
&lt;td&gt;turbo fp16&lt;/td&gt;
&lt;td&gt;1,118&lt;/td&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;td&gt;147&lt;/td&gt;
&lt;td&gt;1,537&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CUDA&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;974&lt;/td&gt;
&lt;td&gt;106&lt;/td&gt;
&lt;td&gt;538&lt;/td&gt;
&lt;td&gt;1,794&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The faster the GPU, the more the total is about model loading
&lt;/h2&gt;

&lt;p&gt;On CUDA, 1,118ms of turbo's 1,537ms total is loading; only 419ms is computation. Re-ranked with loading excluded:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Environment&lt;/th&gt;
&lt;th&gt;turbo fp16&lt;/th&gt;
&lt;th&gt;medium&lt;/th&gt;
&lt;th&gt;Difference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;x86 CPU&lt;/td&gt;
&lt;td&gt;11,924ms&lt;/td&gt;
&lt;td&gt;9,147ms&lt;/td&gt;
&lt;td&gt;medium faster by 2,778ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CPU&lt;/td&gt;
&lt;td&gt;12,687ms&lt;/td&gt;
&lt;td&gt;8,551ms&lt;/td&gt;
&lt;td&gt;medium faster by 4,136ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 iGPU&lt;/td&gt;
&lt;td&gt;1,163ms&lt;/td&gt;
&lt;td&gt;1,352ms&lt;/td&gt;
&lt;td&gt;turbo faster by 188ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CUDA&lt;/td&gt;
&lt;td&gt;419ms&lt;/td&gt;
&lt;td&gt;820ms&lt;/td&gt;
&lt;td&gt;turbo faster by 401ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both the integrated GPU, which looked like a tie in total, and CUDA, where loading is most of the time, &lt;strong&gt;show a clear order once loading is taken out.&lt;/strong&gt; It also means the same models can rank differently depending on how you run them: starting a process every time (CLI) versus keeping one running and sending requests to it (resident server).&lt;/p&gt;

&lt;p&gt;I also measured the round trip of sending the same recording over HTTP to a resident server. Loading then happens only once, at startup.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server setting&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;x86 iGPU&lt;/th&gt;
&lt;th&gt;Arm CUDA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default (greedy)&lt;/td&gt;
&lt;td&gt;large-v3-turbo&lt;/td&gt;
&lt;td&gt;867ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;202ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default (greedy)&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;921ms&lt;/td&gt;
&lt;td&gt;473ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;-bs 5&lt;/code&gt; (same width as the CLI)&lt;/td&gt;
&lt;td&gt;large-v3-turbo&lt;/td&gt;
&lt;td&gt;1,269ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;340ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;-bs 5&lt;/code&gt; (same width as the CLI)&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;1,501ms&lt;/td&gt;
&lt;td&gt;724ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As a resident server, turbo was faster on both GPUs. Compared with the integrated GPU, CUDA returned in roughly a quarter of the time for turbo and roughly half for medium. Note that &lt;code&gt;whisper-server&lt;/code&gt; defaults to greedy decoding when nothing is specified, while &lt;code&gt;whisper-cli&lt;/code&gt; defaults to beam search with width 5: &lt;strong&gt;the defaults are opposite.&lt;/strong&gt; (Last time, this left my conditions mismatched.)&lt;/p&gt;

&lt;h2&gt;
  
  
  The benefit of quantization (q5_0) shrank as the hardware got faster
&lt;/h2&gt;

&lt;p&gt;As a third model, I measured turbo's q5_0 (quantized) version under the same conditions.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Environment&lt;/th&gt;
&lt;th&gt;q5_0 total&lt;/th&gt;
&lt;th&gt;Excluding loading&lt;/th&gt;
&lt;th&gt;vs. fp16 (excluding loading)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;x86 CPU&lt;/td&gt;
&lt;td&gt;12,021ms&lt;/td&gt;
&lt;td&gt;11,525ms&lt;/td&gt;
&lt;td&gt;q5_0 faster by 400ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CPU&lt;/td&gt;
&lt;td&gt;7,108ms&lt;/td&gt;
&lt;td&gt;6,690ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;q5_0 faster by 5,997ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86 iGPU&lt;/td&gt;
&lt;td&gt;1,371ms&lt;/td&gt;
&lt;td&gt;944ms&lt;/td&gt;
&lt;td&gt;q5_0 faster by 219ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm CUDA&lt;/td&gt;
&lt;td&gt;795ms&lt;/td&gt;
&lt;td&gt;404ms&lt;/td&gt;
&lt;td&gt;q5_0 faster by 15ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On the Arm CPU, q5_0 was the fastest of the three models, and faster than the x86 CPU.&lt;/strong&gt; This clang build has no fp16 vector arithmetic (&lt;code&gt;HAVE_FP16_VECTOR_ARITHMETIC&lt;/code&gt; isn't set), while the integer instructions are available. My guess is that this is why the two fp16 models were slow, but &lt;strong&gt;that's a guess; I didn't measure which operations were used or how much.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On CUDA, q5_0's advantage was almost entirely lighter loading&lt;/strong&gt; (a smaller file). The compute time differed from fp16 by only 15ms.&lt;/li&gt;
&lt;li&gt;Quantization tends to get summed up as "faster," but as far as I found, the compute benefit seems to shrink on faster hardware, leaving mostly the lighter load.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More threads shrink the encoder, not the decoder side
&lt;/h2&gt;

&lt;p&gt;whisper.cpp sees 20 threads on the Arm PC (&lt;code&gt;n_threads = 8 / 20&lt;/code&gt; in the output), so I measured both &lt;code&gt;-t 8&lt;/code&gt; and &lt;code&gt;-t 20&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;-t 8&lt;/code&gt; total&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;-t 20&lt;/code&gt; total&lt;/th&gt;
&lt;th&gt;encode&lt;/th&gt;
&lt;th&gt;batchd&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (fp16)&lt;/td&gt;
&lt;td&gt;13,873ms&lt;/td&gt;
&lt;td&gt;11,015ms&lt;/td&gt;
&lt;td&gt;12,005 → 9,004ms&lt;/td&gt;
&lt;td&gt;564 → 579ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;9,698ms&lt;/td&gt;
&lt;td&gt;7,478ms&lt;/td&gt;
&lt;td&gt;6,738 → 4,162ms&lt;/td&gt;
&lt;td&gt;1,631 → &lt;strong&gt;2,069ms&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;large-v3-turbo (q5_0)&lt;/td&gt;
&lt;td&gt;7,108ms&lt;/td&gt;
&lt;td&gt;4,448ms&lt;/td&gt;
&lt;td&gt;6,326 → 3,714ms&lt;/td&gt;
&lt;td&gt;276 → 226ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every total went down, but not evenly inside. The encoder is one call that passes the whole audio through at once, so it shrinks cleanly. The decoder side is more than 160 small calls, so it shrinks less, and for medium it actually grew. &lt;strong&gt;More threads don't make everything uniformly faster&lt;/strong&gt;; that's what this table supports.&lt;/p&gt;

&lt;p&gt;On variance: turbo fp16 at &lt;code&gt;-t 20&lt;/code&gt; ranged from 10,294 to 11,674ms (13%) even across runs 2–5, wider than the other conditions (a few %). If you measure only the total once and compare, any difference smaller than that spread disappears.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this stops
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I didn't compare GPUs on the same backend.&lt;/strong&gt; I didn't build a Vulkan version on the Arm side, so the Arc 140V (Vulkan) and the RTX Spark N1X (CUDA) differ in both backend and generation. This is not a measurement that can say which GPU is faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The two CPU columns are matched on "no BLAS", but not on compiler and flags&lt;/strong&gt; (x86: MSVC, AVX2; Arm: clang, &lt;code&gt;-march=armv8.7-a&lt;/code&gt; and others).&lt;/li&gt;
&lt;li&gt;These are measurements on one machine each, so I can't claim more than &lt;strong&gt;the same direction showed up on these two machines.&lt;/strong&gt; It could reverse on other CPUs or GPUs.&lt;/li&gt;
&lt;li&gt;The measurement uses &lt;strong&gt;only the same single sample as last time (6.6 s, one sentence, one speaker).&lt;/strong&gt; The ratios could change with long audio, noisy audio or multiple speakers; I haven't checked.&lt;/li&gt;
&lt;li&gt;The transcription matched the correct text in every condition. &lt;strong&gt;I didn't compare accuracy&lt;/strong&gt; (this clip shows no difference, so it can't support any accuracy ranking).&lt;/li&gt;
&lt;li&gt;The clang OpenMP runtime used for the Arm build is the debug (non-redistributable) copy bundled with the development tools. &lt;strong&gt;I'm not distributing the built executables or DLLs.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The previous result, &lt;strong&gt;medium on the CPU and turbo on the GPU&lt;/strong&gt;, showed the same direction on a CPU with a different instruction set and on a different GPU family. (On the integrated GPU, v1.9.5 gave a tie in total; excluding loading, turbo is faster.)&lt;/li&gt;
&lt;li&gt;The reason was the same too: turbo cuts the decoder but keeps the large encoder. &lt;strong&gt;Where the encoder is heavy, the loss wins; on the GPU, the gain wins.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The faster the GPU, the larger the share of model loading in the total. &lt;strong&gt;Look at the phases, not the total&lt;/strong&gt;, or keep the model resident and measure without loading.&lt;/li&gt;
&lt;li&gt;On Windows on Arm, the compiler used for the build changed the result by an order of magnitude. &lt;strong&gt;Check the &lt;code&gt;system_info&lt;/code&gt; line first.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;whisper.cpp is licensed under MIT (&lt;a href="https://github.com/ggml-org/whisper.cpp" rel="noopener noreferrer"&gt;ggml-org/whisper.cpp&lt;/a&gt;). The phase names come from the comments on the counters in the source.&lt;/p&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my series on a DIY ESP32-S3 smartwatch. The watch sends recorded speech to a PC, which transcribes it; this article and the previous one compare models for that step. The Arm PC here is the same Surface Laptop Ultra I've written about in English before. Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/smartwatch-whisper-turbo-cpu-slower" rel="noopener noreferrer"&gt;whisper の turbo と medium、速いほうが CPU と内蔵 GPU で入れ替わった。区間に分けて測る&lt;/a&gt; (Japanese): the previous article, on one PC&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/smartwatch-overview-v1-to-v5" rel="noopener noreferrer"&gt;電子工作素人の ESP32-S3 スマートウォッチ自作奮闘記&lt;/a&gt; (Japanese): the series entry point&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/moving-comfyui-from-intel-arc-to-arm-wsl2-the-same-requirementstxt-didnt-install-the-same-3kfk"&gt;Moving ComfyUI from Intel Arc to Arm WSL2: The Same requirements.txt Didn't Install the Same Versions&lt;/a&gt; (English): same Surface&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine&lt;/a&gt; (English): same Surface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/smartwatch-whisper-arm-cuda-four-builds" rel="noopener noreferrer"&gt;whisper の turbo と medium、Arm の CPU と CUDA でも速い順は入れ替わった&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>whisper</category>
      <category>cuda</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>I Cut Dedicated GPU Memory to 4GB, and a Local LLM Still Ran at 90% Speed</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Sun, 15 Nov 2026 10:22:24 +0000</pubDate>
      <link>https://dev.to/maruhana/i-cut-dedicated-gpu-memory-to-4gb-and-a-local-llm-still-ran-at-90-speed-4h64</link>
      <guid>https://dev.to/maruhana/i-cut-dedicated-gpu-memory-to-4gb-and-a-local-llm-still-ran-at-90-speed-4h64</guid>
      <description>&lt;p&gt;&lt;em&gt;On a Surface Laptop Ultra (RTX Spark, unified memory), I measured local LLM speed and Windows' free memory with the GPU's dedicated memory set to 4, 64, 82 and 96GB. Speed barely moved; memory left for Windows did.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/surface-gpu-dedicated-memory-4gb" rel="noopener noreferrer"&gt;専用 GPU メモリーを 4GB にしても、ローカル LLM は 9 割の速さで動いた&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: on this laptop, setting the GPU's dedicated memory to the minimum (4GB) still left a local LLM at about 90% of its speed, while the memory left for Windows changed from 122.5GB to 30.5GB across the settings.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update (2026-11-16):&lt;/strong&gt; After publishing, I also generated video inside WSL2 with dedicated GPU memory at 4GB. All 6 videos finished, but Wan 2.2 took about 1.9× as long as at 64GB, while the other video model (MiniMax H3) took about the same. See "Update: video generation in WSL2 at 4GB" below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A 71-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/18hx-wIUlbA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This laptop's CPU and GPU share one pool of physical memory. A setting decides how much is &lt;strong&gt;dedicated to the GPU&lt;/strong&gt;, from 4GB to 96GB. The rest is &lt;strong&gt;main memory&lt;/strong&gt; for Windows and apps.&lt;/li&gt;
&lt;li&gt;With dedicated GPU memory at the minimum 4GB, gpt-oss-120b (63.4GB) still generated &lt;strong&gt;58.8 tokens/s, about 92% of the 63.9–64.2 at 64GB and up.&lt;/strong&gt; Most of the model sat outside the dedicated part, in memory the GPU borrows from main memory.&lt;/li&gt;
&lt;li&gt;Memory left for Windows went from &lt;strong&gt;122.5GB (4GB setting) to 30.5GB (96GB setting).&lt;/strong&gt; At 82GB and 96GB, with the model loaded and a browser open, committed memory reached &lt;strong&gt;99% of the commit limit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Moving MoE experts to the CPU (&lt;code&gt;-ncmoe&lt;/code&gt;) was slower than leaving everything on the GPU, even at 4GB: about 2.1–2.6× slower for gpt-oss-120b and 1.8× for the other model.&lt;/li&gt;
&lt;li&gt;I lowered my everyday setting from 82GB to 64GB.&lt;/li&gt;
&lt;li&gt;One laptop, two models, one run per setting. On a PC with a separate graphics card (its own VRAM), I'd expect very different results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PC&lt;/td&gt;
&lt;td&gt;Surface Laptop Ultra (Windows 11 Pro, NVIDIA RTX Spark N1X, 128GB unified memory)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How the dedicated amount was changed&lt;/td&gt;
&lt;td&gt;NVIDIA App, "Dedicated GPU memory (GB)", with a reboot each time. Options ran from 4GB (minimum) to 96GB (maximum)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Settings tested&lt;/td&gt;
&lt;td&gt;4GB (minimum), 64GB (about the size of gpt-oss-120b's 63.4GB file), 82GB (my setting until then), 96GB (maximum)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Driver&lt;/td&gt;
&lt;td&gt;621.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;llama.cpp&lt;/td&gt;
&lt;td&gt;b12110 (CUDA), the same build as my &lt;a href="https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg"&gt;8-model benchmark&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;gpt-oss-120b (MXFP4, 63.4GB), Nemotron 3.5 Bolt (74B total, about 9B active per token, 2-bit, about 22GB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stopped during the test&lt;/td&gt;
&lt;td&gt;WSL, ComfyUI and other LLMs. Only at 82GB, an Ollama instance with no model loaded was running&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What I call each part of memory
&lt;/h2&gt;

&lt;p&gt;There is one pool of physical memory, split in two by the setting:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dedicated GPU memory&lt;/td&gt;
&lt;td&gt;The part reserved for the GPU. Set in the NVIDIA App. This is what nvidia-smi reports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main memory&lt;/td&gt;
&lt;td&gt;The rest. Used by Windows and apps. This is what Task Manager shows as "Memory"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shared GPU memory&lt;/td&gt;
&lt;td&gt;The part of main memory the GPU borrows when it needs more&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Dedicated plus main came to 126.5GB at every setting.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured
&lt;/h2&gt;

&lt;p&gt;At each setting, in the same order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;3 minutes idle, logging free memory and more every 5 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;llama-bench&lt;/code&gt;, average of 3 runs:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;pp512&lt;/strong&gt; (prompt processing): how fast the model reads a 512-token prompt before answering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tg128&lt;/strong&gt; (generation): how fast it writes 128 tokens. Closest to how fast text appears in a chat.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A 5-minute load with gpt-oss-120b loaded in &lt;code&gt;llama-server&lt;/code&gt;: 10 browser tabs, plus a script grabbing main memory 4GB at a time up to 16GB. Still logging every 5 seconds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I logged Windows performance counters (Available MBytes, Committed Bytes, Commit Limit, page file usage, disk writes) and dedicated GPU memory use from nvidia-smi. Memory sizes from the counters are converted at 1GB = 10^9 bytes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Everything assigned to the GPU (the main runs)&lt;/span&gt;
llama-bench -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -ngl 999 -fa 1 -p 512 -n 128 -r 3

&lt;span class="c"&gt;# Some MoE experts on the CPU side (for comparison)&lt;/span&gt;
llama-bench -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -ngl 999 -ncmoe 16 -fa 1 -p 512 -n 128 -r 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result 1: about 90% of the speed at 4GB
&lt;/h2&gt;

&lt;p&gt;All layers assigned to the GPU (&lt;code&gt;-ngl 999&lt;/code&gt;). Tokens per second, average of 3 runs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dedicated GPU memory&lt;/th&gt;
&lt;th&gt;gpt-oss-120b pp512&lt;/th&gt;
&lt;th&gt;gpt-oss-120b tg128&lt;/th&gt;
&lt;th&gt;Bolt pp512&lt;/th&gt;
&lt;th&gt;Bolt tg128&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;1,950&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;58.8&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,163&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39.9&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;2,136&lt;/td&gt;
&lt;td&gt;63.9&lt;/td&gt;
&lt;td&gt;1,186&lt;/td&gt;
&lt;td&gt;43.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;82GB&lt;/td&gt;
&lt;td&gt;2,028&lt;/td&gt;
&lt;td&gt;64.2&lt;/td&gt;
&lt;td&gt;1,122&lt;/td&gt;
&lt;td&gt;41.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;96GB (max)&lt;/td&gt;
&lt;td&gt;2,127&lt;/td&gt;
&lt;td&gt;64.0&lt;/td&gt;
&lt;td&gt;1,204&lt;/td&gt;
&lt;td&gt;43.6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;At 4GB, generation was about 90% of the speed at 64GB and up&lt;/strong&gt;: 58.8 ÷ 63.9 = 92% for gpt-oss-120b, and 39.9 ÷ 43.6–41.4 = 92–96% for Bolt.&lt;/p&gt;

&lt;p&gt;The standard deviation across the 3 runs was within 4% of the mean for every generation number. gpt-oss-120b generated 58.8 ± 0.5 at 4GB and 63.9 ± 0.5 at 64GB, so the ~10% gap is larger than the run-to-run spread; the differences between 64, 82 and 96GB (63.9–64.2) are within it. The 3 runs were repeats within one launch; each setting was measured once after a reboot. gpt-oss-120b's prompt processing at 82GB had a larger spread (2,028 ± 214, about 11%), so its slightly lower value is within that range. Bolt's 41.4 at 82GB was a separate run from the 42.7 in my 8-model benchmark.&lt;/p&gt;

&lt;p&gt;At 4GB, nvidia-smi showed at most &lt;strong&gt;3,808MiB&lt;/strong&gt; of dedicated GPU memory in use while gpt-oss-120b was fully assigned to the GPU. Most of the 63.4GB model sat outside the dedicated part, in shared GPU memory. It still ran at about 90% speed.&lt;/p&gt;

&lt;p&gt;From 64GB up, speed barely changed. At 64GB, dedicated use peaked at 61,586MiB: the model fit inside.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2: memory left for Windows changes a lot
&lt;/h2&gt;

&lt;p&gt;Values with gpt-oss-120b loaded (all on the GPU) under the 5-minute load. All columns except the first are main-memory values. Committed memory is the total that apps have been promised; the limit is main memory plus the page file.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dedicated GPU memory&lt;/th&gt;
&lt;th&gt;Main memory (Windows can use)&lt;/th&gt;
&lt;th&gt;Free when idle&lt;/th&gt;
&lt;th&gt;Free under load (min)&lt;/th&gt;
&lt;th&gt;Commit under load (max) / limit&lt;/th&gt;
&lt;th&gt;Page file usage (max)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;122.5GB&lt;/td&gt;
&lt;td&gt;~112GB&lt;/td&gt;
&lt;td&gt;47.1GB&lt;/td&gt;
&lt;td&gt;102.6 / 238.9GB&lt;/td&gt;
&lt;td&gt;0.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;62.5GB&lt;/td&gt;
&lt;td&gt;~50.8GB&lt;/td&gt;
&lt;td&gt;45.8GB&lt;/td&gt;
&lt;td&gt;103.1 / 134.2GB&lt;/td&gt;
&lt;td&gt;0.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;82GB&lt;/td&gt;
&lt;td&gt;44.5GB&lt;/td&gt;
&lt;td&gt;~33.8GB&lt;/td&gt;
&lt;td&gt;26.9GB&lt;/td&gt;
&lt;td&gt;108.0 / 108.8GB&lt;/td&gt;
&lt;td&gt;1.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;96GB (max)&lt;/td&gt;
&lt;td&gt;30.5GB&lt;/td&gt;
&lt;td&gt;~19.4GB&lt;/td&gt;
&lt;td&gt;13.3GB&lt;/td&gt;
&lt;td&gt;101.8 / 102.9GB&lt;/td&gt;
&lt;td&gt;0.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;At 82GB and 96GB, committed memory under load reached 99% of the limit.&lt;/strong&gt; At 96GB the page file grew and the limit went from 96.6GB to 102.9GB. In both cases, a little more load would have hit the limit.&lt;/p&gt;

&lt;p&gt;Generation speed, on the other hand, barely dropped under this load. I sent the same prompt (400 tokens, temperature 0) to &lt;code&gt;llama-server&lt;/code&gt; once before and once during the load:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dedicated GPU memory&lt;/th&gt;
&lt;th&gt;Before load&lt;/th&gt;
&lt;th&gt;Under load&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;57.4&lt;/td&gt;
&lt;td&gt;55.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;62.1&lt;/td&gt;
&lt;td&gt;60.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;82GB&lt;/td&gt;
&lt;td&gt;61.6&lt;/td&gt;
&lt;td&gt;60.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;96GB (max)&lt;/td&gt;
&lt;td&gt;61.6&lt;/td&gt;
&lt;td&gt;60.4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The drop was about 3% or less everywhere, and page file usage stayed under 2%. Close to the limit, but not swapping to disk.&lt;/p&gt;

&lt;p&gt;At 4GB, 47.1GB of main memory was still free under load, about the same as at 64GB, with a commit limit of 238.9GB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3: keeping everything on the GPU beat moving experts to the CPU
&lt;/h2&gt;

&lt;p&gt;When dedicated GPU memory is small, one option is to keep some MoE experts on the CPU side (&lt;code&gt;-ncmoe&lt;/code&gt;). The number after &lt;code&gt;-ncmoe&lt;/code&gt; (8, 16, 24, 36, 99) is how many layers put their experts on the CPU side. gpt-oss-120b has 36 layers, so &lt;code&gt;-ncmoe 36&lt;/code&gt; is all of them. For Bolt I used 99, more than its layer count, to put all of them on the CPU side.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dedicated GPU memory&lt;/th&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;pp512&lt;/th&gt;
&lt;th&gt;tg128&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;gpt-oss-120b, all on GPU&lt;/td&gt;
&lt;td&gt;1,950&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;58.8&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;gpt-oss-120b &lt;code&gt;-ncmoe 24&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;1,139&lt;/td&gt;
&lt;td&gt;27.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;gpt-oss-120b &lt;code&gt;-ncmoe 36&lt;/code&gt; (all layers)&lt;/td&gt;
&lt;td&gt;943&lt;/td&gt;
&lt;td&gt;22.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;Bolt, all on GPU&lt;/td&gt;
&lt;td&gt;1,163&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39.9&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4GB (min)&lt;/td&gt;
&lt;td&gt;Bolt &lt;code&gt;-ncmoe 99&lt;/code&gt; (all layers)&lt;/td&gt;
&lt;td&gt;796&lt;/td&gt;
&lt;td&gt;22.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;gpt-oss-120b, all on GPU&lt;/td&gt;
&lt;td&gt;2,136&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;63.9&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;gpt-oss-120b &lt;code&gt;-ncmoe 8&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;1,535&lt;/td&gt;
&lt;td&gt;45.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;gpt-oss-120b &lt;code&gt;-ncmoe 16&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;1,331&lt;/td&gt;
&lt;td&gt;36.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;In every case, the more layers on the CPU side, the slower it got.&lt;/strong&gt; Even at 4GB, leaving everything assigned to the GPU and letting shared GPU memory take the rest was about 2.1–2.6× faster for gpt-oss-120b and about 1.8× faster for Bolt.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-ncmoe&lt;/code&gt; seems to come up often as a way to keep speed when GPU memory runs short. I think that advice is for PCs where VRAM and main memory are separate parts. On this PC, at least with these two models, the result went the other way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why shared GPU memory stays fast (partly a guess)
&lt;/h2&gt;

&lt;p&gt;On this PC the CPU and GPU use the same physical memory. NVIDIA's &lt;a href="https://docs.nvidia.com/rtx-spark/rtx-spark-porting-guide/0.1.0/uma/index.html" rel="noopener noreferrer"&gt;porting guide page on unified memory&lt;/a&gt; says the carve-out reserved for the GPU is reported by Windows as dedicated GPU memory and is physically backed by system DRAM, not separate VRAM. So "dedicated" and "shared" are two ways of allocating the same parts.&lt;/p&gt;

&lt;p&gt;From here on it's my guess: if the GPU reads from the same parts either way, a model in shared GPU memory doesn't pay for a trip through a separate part. I don't know why 4GB was about 10% slower, and I didn't look inside the driver.&lt;/p&gt;

&lt;p&gt;This also half-answers something I left open in the 8-model benchmark: an 86.9GB model ran fully assigned to the GPU while nvidia-smi showed only about 82GB in use. Since a model mostly outside dedicated memory ran fine at 4GB, the part that didn't fit in 82GB was most likely in shared GPU memory. I didn't observe that placement directly, though.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed: 82GB → 64GB
&lt;/h2&gt;

&lt;p&gt;After this, I lowered my everyday setting from 82GB to 64GB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gpt-oss-120b (63.4GB) fits inside dedicated memory, at the same speed as 82GB and 96GB.&lt;/li&gt;
&lt;li&gt;Free main memory under load is 45.8GB, about 19GB more than at 82GB (26.9GB).&lt;/li&gt;
&lt;li&gt;The commit limit (134.2GB) has room.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn't go down to 4GB because there's a use I haven't measured: video generation in ComfyUI inside WSL2. WSL2 sees the GPU through the Windows driver, so it may not behave the same. Image editing didn't slow down when it spilled a little past dedicated memory (see below), but I haven't generated video at 4GB. (After publishing, I measured it at 4GB; see the update section below.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra: prefill with longer prompts
&lt;/h2&gt;

&lt;p&gt;At the 64GB setting, I ran the same Qwen3.6-35B-A3B file as in the 8-model benchmark (UD-Q4_K_M, 22.1GB) with longer prompts: &lt;code&gt;llama-bench -ngl 999 -fa 1 -p 512,4096,8192 -n 128 -r 3&lt;/code&gt;, llama.cpp b12110. No other LLM was on the GPU.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Tokens/s (mean ± std. dev. of 3 runs)&lt;/th&gt;
&lt;th&gt;Time per run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;pp512&lt;/td&gt;
&lt;td&gt;2,831 ± 40&lt;/td&gt;
&lt;td&gt;0.18 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pp4096&lt;/td&gt;
&lt;td&gt;2,820 ± 35&lt;/td&gt;
&lt;td&gt;1.45 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pp8192&lt;/td&gt;
&lt;td&gt;2,735 ± 39&lt;/td&gt;
&lt;td&gt;3.00 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tg128&lt;/td&gt;
&lt;td&gt;74.9 ± 1.8&lt;/td&gt;
&lt;td&gt;1.71 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At 8,192 tokens it still read at about 97% of the 512-token speed. Dedicated GPU memory use peaked at 23,099MiB.&lt;/p&gt;

&lt;p&gt;In the 8-model benchmark (82GB setting), the same file gave pp512 3,092, pp4096 2,834 and tg128 75.7. pp4096 and tg128 are about the same, but pp512 is about 8% lower this time. These were different days and settings, and I haven't separated the cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra: changing WSL2's memory limit for video generation
&lt;/h2&gt;

&lt;p&gt;I also wanted to know whether raising WSL2's memory limit (&lt;code&gt;memory&lt;/code&gt; in &lt;code&gt;.wslconfig&lt;/code&gt;) speeds up video generation. With dedicated GPU memory at 64GB, I set the limit to 24GB, 48GB and 40GB (in that order) and generated Wan 2.2 videos (720×1056, 16fps, 49 frames) in ComfyUI inside WSL2. The model files total about 30GB.&lt;/p&gt;

&lt;p&gt;Each time I shut WSL2 down and started it again, then made: ① one video right after startup, ② one more with the same workflow, ③ one with a different workflow (different start image and prompt). Times run from the start of the measuring script to the end of writing the video. Only the limit changed; the environment was the same all three times (torch 2.14.1+cu132, ComfyUI v0.45.0, Wan 2.2 i2v 14B fp8 with a 4-step LoRA). Memory values use 1GB = 10^9 bytes as above.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;WSL2 limit&lt;/th&gt;
&lt;th&gt;24GB&lt;/th&gt;
&lt;th&gt;48GB&lt;/th&gt;
&lt;th&gt;40GB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;① right after startup&lt;/td&gt;
&lt;td&gt;145 s&lt;/td&gt;
&lt;td&gt;143 s&lt;/td&gt;
&lt;td&gt;143 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;② same workflow again&lt;/td&gt;
&lt;td&gt;127 s&lt;/td&gt;
&lt;td&gt;129 s&lt;/td&gt;
&lt;td&gt;128 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;③ different workflow&lt;/td&gt;
&lt;td&gt;129 s&lt;/td&gt;
&lt;td&gt;129 s&lt;/td&gt;
&lt;td&gt;128 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free main memory (min)&lt;/td&gt;
&lt;td&gt;28.4GB&lt;/td&gt;
&lt;td&gt;5.9GB&lt;/td&gt;
&lt;td&gt;12.4GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Commit (max)&lt;/td&gt;
&lt;td&gt;88.8GB&lt;/td&gt;
&lt;td&gt;111.2GB&lt;/td&gt;
&lt;td&gt;106.1GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Page file usage (max)&lt;/td&gt;
&lt;td&gt;0.8%&lt;/td&gt;
&lt;td&gt;2.0%&lt;/td&gt;
&lt;td&gt;1.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dedicated GPU memory used (max)&lt;/td&gt;
&lt;td&gt;44.4GB&lt;/td&gt;
&lt;td&gt;44.4GB&lt;/td&gt;
&lt;td&gt;44.3GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Times differed by 2 seconds or less: a higher limit wasn't faster. What changed was free main memory, which fell to 5.9GB at 48GB.&lt;/p&gt;

&lt;p&gt;In the 40GB run I also looked inside WSL2. After the three videos, processes used about 4.3GB and the file cache about 35GB. WSL2's swap wasn't used. Dedicated GPU memory use was about 44GB in all three runs, so the model weights were on the dedicated GPU side, outside WSL2's limit.&lt;/p&gt;

&lt;p&gt;My guess is that a higher limit reduces free main memory because WSL2 holds the model files as cache and takes that from main memory. Disk reads for the three videos were about 30GB in every run. For this video on this PC, re-reading from disk seems to have been fast enough even with a smaller cache.&lt;/p&gt;

&lt;p&gt;When I started these runs, my WSL2 setting was 40GB. The day before, at 24GB, switching workflows made one step take 53 seconds while the model was re-read from disk, and I suspected 24GB was too small. At the time dedicated GPU memory was 82GB, and 40GB would have left only about 4.5GB of main memory, so I didn't raise it. After lowering dedicated memory to 64GB, I raised it to 40GB. I didn't measure 40GB's speed before raising it. Now that I have, 24GB gave the same time per video. The alternating test below was just as fast down to 16GB, so I now use 16GB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternating between two models
&lt;/h3&gt;

&lt;p&gt;A higher limit might let WSL2 keep both models' files cached, so switching would be faster. I generated 6 videos alternating between two video models, A→B→A→B→A→B. I measured at 24GB and 40GB, then also at 8GB, 1GB and 16GB to see how low the limit could go. A was the same Wan 2.2 setup (model files about 38.5GB); B was MiniMax H3 video (640×352, 56 frames, about 40.5GB). The two share no files. Dedicated GPU memory stayed at 64GB, same environment as above.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;1GB&lt;/th&gt;
&lt;th&gt;8GB&lt;/th&gt;
&lt;th&gt;16GB&lt;/th&gt;
&lt;th&gt;24GB&lt;/th&gt;
&lt;th&gt;40GB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;A (Wan 2.2)&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;155 s&lt;/td&gt;
&lt;td&gt;145 s&lt;/td&gt;
&lt;td&gt;144 s&lt;/td&gt;
&lt;td&gt;143 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;B (MiniMax H3)&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;50 s&lt;/td&gt;
&lt;td&gt;32 s&lt;/td&gt;
&lt;td&gt;30 s&lt;/td&gt;
&lt;td&gt;30 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;158 s&lt;/td&gt;
&lt;td&gt;143 s&lt;/td&gt;
&lt;td&gt;140 s&lt;/td&gt;
&lt;td&gt;141 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;48 s&lt;/td&gt;
&lt;td&gt;30 s&lt;/td&gt;
&lt;td&gt;27 s&lt;/td&gt;
&lt;td&gt;27 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;157 s&lt;/td&gt;
&lt;td&gt;141 s&lt;/td&gt;
&lt;td&gt;139 s&lt;/td&gt;
&lt;td&gt;140 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;failed&lt;/td&gt;
&lt;td&gt;47 s&lt;/td&gt;
&lt;td&gt;28 s&lt;/td&gt;
&lt;td&gt;30 s&lt;/td&gt;
&lt;td&gt;28 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Disk reads (6 videos total)&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;519.8GB&lt;/td&gt;
&lt;td&gt;229.0GB&lt;/td&gt;
&lt;td&gt;229.1GB&lt;/td&gt;
&lt;td&gt;226.7GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Free main memory (min)&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;45.7GB&lt;/td&gt;
&lt;td&gt;36.8GB&lt;/td&gt;
&lt;td&gt;28.1GB&lt;/td&gt;
&lt;td&gt;12.1GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Dedicated GPU memory used (max)&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;10,112MiB&lt;/td&gt;
&lt;td&gt;43,538MiB&lt;/td&gt;
&lt;td&gt;62,285MiB&lt;/td&gt;
&lt;td&gt;61,424MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At 16GB, 24GB and 40GB, alternating gave almost the same times. At every limit from 16GB up, each switch re-read about as much as that model's files from disk (about 33–43GB per video). The two models total about 79GB, so even at 40GB they didn't both fit in the cache, and I think the previous model was evicted each time.&lt;/p&gt;

&lt;p&gt;Generating A back to back with the same workflow took 127–129 s. Alternating, A took 139–145 s, about 10–15 s slower for the re-read. At 40GB free main memory dropped to 12.1GB, but page file usage stayed at 1.2% or less and WSL2's swap was not in use at the end of the run.&lt;/p&gt;

&lt;p&gt;At 8GB all 6 videos finished, but compared with 40GB, A was about 15 s (about 10%) slower and B about 20 s (about 70%) slower. Disk reads for the 6 videos were 519.8GB, about 2.3× the runs at 16GB and up; each B video read about 101–105GB, more than twice its model files. Dedicated GPU memory peaked at only 10,112MiB, versus 43,538–62,285MiB at 16GB and up. My guess is that the model couldn't stay on the GPU side and was read and dropped over and over (I haven't confirmed how). WSL2's 2GB swap was also used up.&lt;/p&gt;

&lt;p&gt;At 1GB, WSL2 was already using swap right after it started. About 13 s into loading the first model, the Linux kernel's OOM killer stopped ComfyUI's Python process. WSL2 then shut itself down, and all 6 videos failed.&lt;/p&gt;

&lt;p&gt;With these two models, any limit from 16GB to 40GB gave the same speed when alternating. 8GB was slower, and 1GB didn't work. I didn't measure where it starts slowing down (between 8GB and 16GB). A limit big enough for both (80GB or more) might remove the re-reads, but with dedicated GPU memory at 64GB this PC has only 62.5GB of main memory, so I can't test that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image editing that spilled past dedicated memory
&lt;/h3&gt;

&lt;p&gt;With the same settings (dedicated 64GB, WSL2 limit 40GB), I also have a log of 19 image edits in ComfyUI inside WSL2, with an LLM (&lt;code&gt;llama-server&lt;/code&gt;, about 33GB) running at the same time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dedicated GPU memory use peaked at 64,258MiB, and about 40% of the samples during the 19 edits sat at around 64,000MiB. I think the rest went to shared GPU memory.&lt;/li&gt;
&lt;li&gt;Time per image (from an agent requesting the edit to getting the result) was 124.3–132.7 s (median 126.3 s). On the morning of the same day, at 82GB, it was 126.8–138.5 s (median 130.5 s), so 64GB wasn't slower. Inside ComfyUI, one image took 109.8–118.7 s, of which the 6 sampling steps took 73–80 s. (ComfyUI's own timings weren't kept for the 82GB morning.)&lt;/li&gt;
&lt;li&gt;Free main memory fell to 6.9GB at the lowest. Even so, SSD activity peaked at 18%, page file usage stayed at 4.7% or less, WSL2's swap didn't grow, and nothing stalled. (SSD and page file logging started partway through the 19 images.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was image editing, not video, and dedicated memory wasn't cut to 4GB. Still, it's a record that running out of dedicated memory from inside WSL2 didn't slow things down here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update: video generation in WSL2 at 4GB
&lt;/h2&gt;

&lt;p&gt;When I published, I hadn't generated video with dedicated GPU memory at 4GB. So I repeated the 16GB column of the alternating test above, changing only dedicated GPU memory to 4GB. The WSL2 limit (16GB), both models, the workflows, the seeds, and the ComfyUI and model versions were the same. One run of 6 videos, A→B→A→B→A→B.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Dedicated 4GB&lt;/th&gt;
&lt;th&gt;Dedicated 64GB (16GB column above)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;A (Wan 2.2)&lt;/td&gt;
&lt;td&gt;276 s&lt;/td&gt;
&lt;td&gt;145 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;B (MiniMax H3)&lt;/td&gt;
&lt;td&gt;36 s&lt;/td&gt;
&lt;td&gt;32 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;270 s&lt;/td&gt;
&lt;td&gt;143 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;31 s&lt;/td&gt;
&lt;td&gt;30 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;266 s&lt;/td&gt;
&lt;td&gt;141 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;33 s&lt;/td&gt;
&lt;td&gt;28 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Disk reads (6 videos)&lt;/td&gt;
&lt;td&gt;227.6GB&lt;/td&gt;
&lt;td&gt;229.0GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Peak shared GPU memory use&lt;/td&gt;
&lt;td&gt;47.0GB&lt;/td&gt;
&lt;td&gt;not recorded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Peak dedicated GPU memory use&lt;/td&gt;
&lt;td&gt;3,983MiB&lt;/td&gt;
&lt;td&gt;43,538MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At 4GB all 6 videos finished. Nothing was killed for lack of memory, the SSD never pinned, and WSL2 didn't swap. What didn't fit in the 4GB went to Windows' shared GPU memory (peak 47.0GB).&lt;/p&gt;

&lt;p&gt;Speed split by model, though. A (Wan 2.2) averaged 271 s per video, about 1.9× the 143 s at 64GB. B (MiniMax H3) averaged 33 s, about the same as the 30 s at 64GB. The LLM kept about 90% of its speed at 4GB, but in this video test one model ran at roughly half speed.&lt;/p&gt;

&lt;p&gt;I haven't confirmed why only A slowed down. A is 720×1056 with 49 frames and B is 640×352 with 56 frames, so A's intermediate data is larger; my guess is that more of it had to go back and forth through shared GPU memory. Disk reads were about the same at 4GB and 64GB (the model was re-read at every switch either way), so the slowdown didn't come from re-reading files.&lt;/p&gt;

&lt;p&gt;Free main memory bottomed out at 48.5GB (36.8GB at 64GB). That's because at 4GB the memory Windows can use is itself larger (122.5GB), not because anything became more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I didn't measure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One run per setting.&lt;/strong&gt; &lt;code&gt;llama-bench&lt;/code&gt; averages 3 runs, but each setting was measured once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video generation between 4GB and 64GB.&lt;/strong&gt; The 4GB update was one run, with WSL2 at 16GB only. I didn't test 8GB or 16GB, larger resolutions, or running an LLM at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A WSL2 limit big enough to cache both models, or anything between 8GB and 16GB.&lt;/strong&gt; The alternating test covered 1, 8, 16, 24 and 40GB, one run each. At 16GB and up, every switch re-read the model. I didn't find where it starts slowing down, and didn't test other model pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heavier load or longer runs.&lt;/strong&gt; The load was 16GB plus 10 browser tabs, for 5 minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why shared GPU memory stays fast.&lt;/strong&gt; That it's the same physical memory is from NVIDIA's guide; why the speed holds is my guess, and I didn't look inside the driver.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other models and other PCs.&lt;/strong&gt; Two models, one laptop. On a PC where VRAM is a separate part from main memory, I'd expect very different results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On this PC, with dedicated GPU memory at the minimum 4GB, an LLM fully assigned to the GPU ran at about 90% of its speed at 64GB and up.&lt;/li&gt;
&lt;li&gt;Memory left for Windows changed from 122.5GB to 30.5GB. At 82GB and 96GB, running the LLM and a browser together pushed committed memory to 99% of the limit.&lt;/li&gt;
&lt;li&gt;Leaving everything on the GPU and letting shared GPU memory take the rest was faster than moving MoE layers to the CPU (&lt;code&gt;-ncmoe&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Raising WSL2's limit from 24GB to 48GB didn't change the time per video; it only reduced free main memory. Alternating between two models, 16GB, 24GB and 40GB gave almost the same times; 8GB was slower and 1GB didn't work.&lt;/li&gt;
&lt;li&gt;At 4GB dedicated GPU memory, all 6 WSL2 videos still finished, but Wan 2.2 took about 1.9× as long as at 64GB (MiniMax H3 took about the same).&lt;/li&gt;
&lt;li&gt;I set my everyday dedicated GPU memory to 64GB. On this PC, unless I plan to use a bigger model, not over-allocating dedicated GPU memory leaves more room in main memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Update history
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2026-11-16&lt;/strong&gt; — Added "Update: video generation in WSL2 at 4GB" and a note at the top. At publication I said I hadn't measured video at 4GB; I measured it and added the results, and updated the 82GB → 64GB section, What I didn't measure, and Takeaways to match.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my series on the Surface Laptop Ultra (Windows on Arm with an NVIDIA GPU). Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;Initial setup: on Arm Windows, check whether each tool can use the GPU before installing it&lt;/a&gt; (Japanese)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine&lt;/a&gt; (English)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/moving-comfyui-from-intel-arc-to-arm-wsl2-the-same-requirementstxt-didnt-install-the-same-3kfk"&gt;Moving ComfyUI from Intel Arc to Arm WSL2: The Same requirements.txt Didn't Install the Same Versions&lt;/a&gt; (English)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg"&gt;A 120B Model Ran About 4x Faster Than a 27B One: 8 Local LLMs on a Surface Laptop Ultra&lt;/a&gt; (English)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/surface-gpu-dedicated-memory-4gb" rel="noopener noreferrer"&gt;専用 GPU メモリーを 4GB にしても、ローカル LLM は 9 割の速さで動いた&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>llamacpp</category>
      <category>nvidia</category>
    </item>
    <item>
      <title>A 120B Model Ran About 4x Faster Than a 27B One: 8 Local LLMs on a Surface Laptop Ultra</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Sat, 14 Nov 2026 00:28:04 +0000</pubDate>
      <link>https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg</link>
      <guid>https://dev.to/maruhana/a-120b-model-ran-about-4x-faster-than-a-27b-one-8-local-llms-on-a-surface-laptop-ultra-5cpg</guid>
      <description>&lt;p&gt;&lt;em&gt;Same llama.cpp build, same commands, one Surface Laptop Ultra (Windows on Arm, RTX Spark): generation speed lined up by active parameters, not total size, and the fastest model couldn't fix a one-character config error.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/surface-local-llm-8models-bench" rel="noopener noreferrer"&gt;120B が 27B より約 4 倍速かった。Surface Laptop Ultra でローカル LLM 8 種を同じ条件で測る&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: on this laptop, how fast a local LLM wrote text followed how many parameters it uses per token, not how big it is, and the fastest model couldn't get a one-character fix done.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 50-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/ZaIw7G0184Q" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I ran 8 local LLMs through the same llama.cpp build with the same commands. Generation speed (tg128) ranged from &lt;strong&gt;104.8 tokens/s&lt;/strong&gt; (Flint) down to &lt;strong&gt;12.0&lt;/strong&gt; (Hermes 4.3 36B).&lt;/li&gt;
&lt;li&gt;The order did not follow total size. &lt;strong&gt;gpt-oss-120B (117B total, 5.1B active per token) ran at 64.2 tokens/s, about 3.9× faster than the dense Qwen3.8-27B (16.5).&lt;/strong&gt; The order matched the active parameter count, and I think that is the main reason; but quantization was not aligned across models, so I can't attribute the whole gap to it.&lt;/li&gt;
&lt;li&gt;An 86.9GB version of Nemotron 3.5 Super VL ran with every layer assigned to the GPU, although nvidia-smi showed only about 82GB of GPU memory. &lt;strong&gt;Where the part that didn't show up was placed, I did not measure.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Fast didn't mean capable. In a task to fix a one-character error in a config file, &lt;strong&gt;the fastest model (Flint) never fixed it in 12 steps.&lt;/strong&gt; 6 of the 8 models did.&lt;/li&gt;
&lt;li&gt;With 4 requests in parallel, total throughput was about 1.5–2× a single request (measured on 3 models).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt;: 8 local LLMs, loaded with the same build of llama.cpp (b12110, CUDA) and run with the same &lt;code&gt;llama-bench&lt;/code&gt; and &lt;code&gt;llama-server&lt;/code&gt; commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On&lt;/strong&gt;: one Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X, 128GB unified memory), with about 82GB of memory assigned to the GPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measured&lt;/strong&gt;: prompt processing and generation speed (3 runs each), reading a 32,768-token prompt (1 run), peak GPU memory, and 5 short prompts plus one config-fixing task at temperature 0 (1 run each). Also 4 parallel requests on 3 models, and an 86.9GB version of one model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not aligned&lt;/strong&gt;: quantization. Each model was used in the form it is distributed in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not measured&lt;/strong&gt;: see "What I didn't measure" near the end.&lt;/li&gt;
&lt;li&gt;Versions and model cards are as of November 2026, when I wrote the original.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I did this
&lt;/h2&gt;

&lt;p&gt;In my &lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;initial setup of this laptop&lt;/a&gt; (Japanese) and the &lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp comparison&lt;/a&gt;, I had only run one model, Qwen3.6-35B-A3B. I wanted a list: how fast other models run on this PC, and how big a model fits.&lt;/p&gt;

&lt;p&gt;So I loaded 8 models with the same llama.cpp build and measured speed with the same commands. I also had each model answer short prompts (tool calling, code, and so on) and work on a task to fix an error in a config file, all under the same conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test setup
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PC&lt;/td&gt;
&lt;td&gt;Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory assigned to the GPU&lt;/td&gt;
&lt;td&gt;83,968MiB (about 82GB) as shown by nvidia-smi. Windows has about 44GB (background below)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inference engine&lt;/td&gt;
&lt;td&gt;llama.cpp b12110 (CUDA build). All 8 models loaded with &lt;code&gt;llama-bench&lt;/code&gt; and &lt;code&gt;llama-server&lt;/code&gt; from the same build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Other workloads&lt;/td&gt;
&lt;td&gt;Other GPU workloads (image generation, other LLM servers) were stopped during measurement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speculative decoding&lt;/td&gt;
&lt;td&gt;Off. For Nemotron 3.5 Bolt only, I also took separate rows with it on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In the &lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;initial setup&lt;/a&gt;, I had assigned 95.5GB to the GPU. Later, even video generation did not use up that GPU allocation (about 46GiB at most in my comparison), while the Windows side (about 31GB) was down to about 4GB free and close to its commit limit including the page file. Leaning on the page file means more disk reads and writes, which slows things down, and I was also a little worried about SSD wear. I wanted fewer page-file writes, so I reduced the GPU assignment and gave more to Windows. My thinking was that, for the way I use this machine, the GPU assignment only needs to be as large as what I actually use.&lt;/p&gt;

&lt;p&gt;Quantization (how many bits each weight is stored in) was &lt;strong&gt;not aligned&lt;/strong&gt;. I used each model in the form it is distributed in. gpt-oss-120B is distributed in MXFP4, and Nemotron 3.5 Bolt has only one official GGUF, in the 2-bit range. For the other models I picked versions around 4 bits (except Super VL, where I used the 3-bit version that fits on the GPU). The results table lists the quantization and file size for each.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured
&lt;/h2&gt;

&lt;p&gt;Speed came from &lt;code&gt;llama-bench&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pp512 and pp4096: prompt processing speed (reading 512 and 4,096 tokens)&lt;/li&gt;
&lt;li&gt;tg128 and tg512: generation speed (writing 128 and 512 tokens)&lt;/li&gt;
&lt;li&gt;3 runs each, averaged. The long-context row (read 32,768 tokens, then write 128) was run once&lt;/li&gt;
&lt;li&gt;GPU memory use was logged with nvidia-smi every second, and I took the peak&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For usability, I started &lt;code&gt;llama-server&lt;/code&gt; with a 32,768-token context and sent the prompts below at temperature 0. For models where thinking (reasoning before answering) can be turned off, I turned it off.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Prompt&lt;/th&gt;
&lt;th&gt;What I checked&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tool calling&lt;/td&gt;
&lt;td&gt;A prompt that should trigger a call to a shell command: are the function name and the command string correct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code&lt;/td&gt;
&lt;td&gt;Write a short Python function; I ran it to see if it passes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JSON&lt;/td&gt;
&lt;td&gt;Write a list of cities and their prefectures as JSON; does it parse&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Japanese&lt;/td&gt;
&lt;td&gt;Write a short explanation (I only kept the full text; I did not judge quality)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image&lt;/td&gt;
&lt;td&gt;Only for models that handle images. I only checked that an answer came back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error-fixing task&lt;/td&gt;
&lt;td&gt;Given a small app whose startup check fails, fix it with 4 tools (list files, read, write, run a command). Each tool call counts as one step; up to 12 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The cause in the error-fixing task: in the config file (&lt;code&gt;config.yaml&lt;/code&gt;), &lt;code&gt;port&lt;/code&gt; is &lt;code&gt;8O80&lt;/code&gt;. Where the 0 (zero) should be, there is a capital letter O.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Sorted by generation speed. What the columns mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Speeds are in tokens/s. "Active" is the number of parameters used per token (from each model's official model card).&lt;/li&gt;
&lt;li&gt;"32k read" is the speed of reading a 32,768-token prompt (pp32768).&lt;/li&gt;
&lt;li&gt;"GPU peak" is the highest value across the speed runs, the 32k row and the server prompts. About 2GB is in use even when nothing is running.&lt;/li&gt;
&lt;li&gt;"Task" is how many steps it took to fix the error-fixing task. Each tool call (list files, read, write, run a command) counts as one step, up to 12. "Not fixed" means it was not fixed within 12 steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Total / active&lt;/th&gt;
&lt;th&gt;Quantization, size&lt;/th&gt;
&lt;th&gt;pp512&lt;/th&gt;
&lt;th&gt;tg128&lt;/th&gt;
&lt;th&gt;32k read&lt;/th&gt;
&lt;th&gt;GPU peak&lt;/th&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint (Recursive)&lt;/td&gt;
&lt;td&gt;39.8B / ~2.5B&lt;/td&gt;
&lt;td&gt;NVFP4, 22.9GB&lt;/td&gt;
&lt;td&gt;2,066&lt;/td&gt;
&lt;td&gt;104.8&lt;/td&gt;
&lt;td&gt;1,582&lt;/td&gt;
&lt;td&gt;24.2GB&lt;/td&gt;
&lt;td&gt;Not fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.6-35B-A3B&lt;/td&gt;
&lt;td&gt;35B / 3B&lt;/td&gt;
&lt;td&gt;UD-Q4_K_M, 22.1GB&lt;/td&gt;
&lt;td&gt;3,092&lt;/td&gt;
&lt;td&gt;75.7&lt;/td&gt;
&lt;td&gt;2,138&lt;/td&gt;
&lt;td&gt;24.9GB&lt;/td&gt;
&lt;td&gt;5 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gpt-oss-120B&lt;/td&gt;
&lt;td&gt;117B / 5.1B&lt;/td&gt;
&lt;td&gt;MXFP4, 63.4GB&lt;/td&gt;
&lt;td&gt;2,116&lt;/td&gt;
&lt;td&gt;64.2&lt;/td&gt;
&lt;td&gt;1,708&lt;/td&gt;
&lt;td&gt;63.8GB&lt;/td&gt;
&lt;td&gt;Fixed (empty report)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nemotron 3.5 Bolt 74B-A9B&lt;/td&gt;
&lt;td&gt;74B / 9B&lt;/td&gt;
&lt;td&gt;Mostly IQ2_XXS (mixed), 22.0GB&lt;/td&gt;
&lt;td&gt;1,174&lt;/td&gt;
&lt;td&gt;42.7&lt;/td&gt;
&lt;td&gt;1,083&lt;/td&gt;
&lt;td&gt;25.8GB&lt;/td&gt;
&lt;td&gt;5 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nemotron 3.5 Super VL 120B-A12B&lt;/td&gt;
&lt;td&gt;120B / 12B&lt;/td&gt;
&lt;td&gt;UD-Q3_K_XL, 65.8GB&lt;/td&gt;
&lt;td&gt;635&lt;/td&gt;
&lt;td&gt;26.6&lt;/td&gt;
&lt;td&gt;596&lt;/td&gt;
&lt;td&gt;64.5GB&lt;/td&gt;
&lt;td&gt;5 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mistral Small 3.2 (2506)&lt;/td&gt;
&lt;td&gt;24B (dense)&lt;/td&gt;
&lt;td&gt;Q4_K_M, 14.3GB&lt;/td&gt;
&lt;td&gt;1,183&lt;/td&gt;
&lt;td&gt;18.5&lt;/td&gt;
&lt;td&gt;952&lt;/td&gt;
&lt;td&gt;21.7GB&lt;/td&gt;
&lt;td&gt;8 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8-27B&lt;/td&gt;
&lt;td&gt;27B (dense)&lt;/td&gt;
&lt;td&gt;UD-Q4_K_M, 16.5GB&lt;/td&gt;
&lt;td&gt;942&lt;/td&gt;
&lt;td&gt;16.5&lt;/td&gt;
&lt;td&gt;836&lt;/td&gt;
&lt;td&gt;20.9GB&lt;/td&gt;
&lt;td&gt;9 steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hermes 4.3 36B&lt;/td&gt;
&lt;td&gt;36B (dense)&lt;/td&gt;
&lt;td&gt;Q4_K_M, 21.8GB&lt;/td&gt;
&lt;td&gt;733&lt;/td&gt;
&lt;td&gt;12.0&lt;/td&gt;
&lt;td&gt;393&lt;/td&gt;
&lt;td&gt;30.7GB&lt;/td&gt;
&lt;td&gt;Not fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;All 8 got through the 32k read without timing out.&lt;/li&gt;
&lt;li&gt;Over the 3 runs, the standard deviation of tg128 was 0.7 or less for every model.&lt;/li&gt;
&lt;li&gt;7 models (all except Flint) passed tool calling, code and JSON. Flint passed JSON, but in tool calling it called things in the wrong order, and in code its answer was cut off at the 800-token answer limit (details below).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fthlxoxpjpuc6wxnkk5q4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fthlxoxpjpuc6wxnkk5q4.jpg" alt="Horizontal bar chart of generation speed (tg128) for the 8 models, fastest first: Flint 104.8, Qwen3.6-35B-A3B 75.7, gpt-oss-120B 64.2, Nemotron 3.5 Bolt 42.7, Nemotron 3.5 Super VL 26.6, Mistral Small 3.2 18.5, Qwen3.8-27B 16.5, Hermes 4.3 12.0. The top 5 are MoE, the bottom 3 dense." width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I found
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Speed lined up by active parameters per token
&lt;/h3&gt;

&lt;p&gt;The models did not line up by total parameter count. gpt-oss-120B, at 117B, generated 64.2 tokens/s, about 3.9× faster than the 27B Qwen3.8-27B (16.5). By file size it's the same story: 63.4GB vs. 16.5GB, and the bigger one is faster.&lt;/p&gt;

&lt;p&gt;What set the order was the number of parameters active per token. The top 5 are MoE (Mixture of Experts) models: out of many "expert" weights, they use only some for each token. gpt-oss-120B uses only 5.1B of its 117B. The bottom 3 are dense models, which use all their weights every time. In order of active parameters (about 2.5B → 3B → 5.1B → 9B → 12B → 24–36B), the speeds lined up the same way.&lt;/p&gt;

&lt;p&gt;Each time a model writes one token, the weights it uses have to be read from memory. As far as I've read, generation speed is said to depend largely on how much has to be read. These 8 models lined up the way that explanation predicts. But quantization isn't aligned, so I can't say the whole 4× gap comes from the difference in active parameters.&lt;/p&gt;

&lt;p&gt;From the point of view of picking a model, on this PC whether it fits on the GPU depends on file size, and how fast it runs depends on active parameters. The 63GB gpt-oss-120B is faster than the 17GB Qwen3.8-27B.&lt;/p&gt;

&lt;h3&gt;
  
  
  An ~87GB model still ran with everything assigned to the GPU
&lt;/h3&gt;

&lt;p&gt;The 4-bit version of Super VL (UD-Q4_K_XL) is 86.9GB as a file. That's bigger than the GPU memory shown (about 82GB), so I expected it either to fail to load or to spill over to the CPU side and slow down. To find the boundary, I ran &lt;code&gt;llama-bench&lt;/code&gt; with everything assigned to the GPU (&lt;code&gt;-ngl 999&lt;/code&gt;).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;pp512&lt;/th&gt;
&lt;th&gt;tg128&lt;/th&gt;
&lt;th&gt;nvidia-smi peak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;All on GPU (&lt;code&gt;-ngl 999&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;625.1&lt;/td&gt;
&lt;td&gt;23.9&lt;/td&gt;
&lt;td&gt;81,869MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Experts of 8 layers on the CPU side (&lt;code&gt;-ncmoe 8&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;585.5&lt;/td&gt;
&lt;td&gt;21.6&lt;/td&gt;
&lt;td&gt;78,367MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Experts of 16 layers on the CPU side (&lt;code&gt;-ncmoe 16&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;548.5&lt;/td&gt;
&lt;td&gt;19.2&lt;/td&gt;
&lt;td&gt;71,309MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With everything assigned to the GPU, it ran without errors, only about 10% slower than the 3-bit version (65.8GB, 26.6). Moving expert weights to the CPU side made it slower the more I moved.&lt;/p&gt;

&lt;p&gt;nvidia-smi's usage topped out at 81,869MiB. Meanwhile, at startup llama.cpp reported 112,350MiB of GPU memory visible to CUDA (the total PyTorch saw was the same value). That's about 28GB more than nvidia-smi's 83,968MiB.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;initial setup article&lt;/a&gt;, I read the total CUDA reports as close to "dedicated" plus "shared" GPU memory. If that holds here too, the part that didn't show up in nvidia-smi was placed in shared memory. &lt;strong&gt;But I didn't measure where it was placed.&lt;/strong&gt; I also don't know whether the roughly 10% speed difference comes from that placement.&lt;/p&gt;

&lt;p&gt;This test was one run per setting, and only reading 512 tokens and writing 128. I did not run the server prompts or the 32k context on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The 2-bit Bolt is a mixed quantization with only the experts at 2 bits
&lt;/h3&gt;

&lt;p&gt;Nemotron 3.5 Bolt 74B-A9B fits a 74B model into 22GB. llama.cpp shows "IQ2_XXS - 2.0625 bpw", but that's the main type for the file as a whole. According to the &lt;a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB-GGUF" rel="noopener noreferrer"&gt;official model card&lt;/a&gt;, the expert weights are 2-bit (IQ2-XXS), the Mamba layers are NVFP4, and the embedding and output layers are Q8_0. The card also says accuracy was recovered with quantization-aware distillation (QAD). In my prompts and task, it passed despite the 2 bits, the same as 6 of the other models.&lt;/p&gt;

&lt;p&gt;Bolt also comes with an official small draft model (drafter) for speculative decoding. Adding it with &lt;code&gt;--spec-type draft-dflash&lt;/code&gt;, as in the official instructions, short answers came out at 105–115 tokens/s, about 2.5× the 42.7 without drafting. Longer answers in Japanese stayed at 55. The error-fixing task took 6.0 s without drafting and 3.6 s with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  With 4 requests at once, the total went up
&lt;/h3&gt;

&lt;p&gt;I started &lt;code&gt;llama-server&lt;/code&gt; with &lt;code&gt;-np 4&lt;/code&gt; and sent the same prompt 4 times at once. I measured only 3 models.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Single request (tg128)&lt;/th&gt;
&lt;th&gt;Per request, 4 at once&lt;/th&gt;
&lt;th&gt;Total of 4&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.6-35B-A3B&lt;/td&gt;
&lt;td&gt;75.7&lt;/td&gt;
&lt;td&gt;30.8–43.5&lt;/td&gt;
&lt;td&gt;110.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nemotron 3.5 Bolt&lt;/td&gt;
&lt;td&gt;42.7&lt;/td&gt;
&lt;td&gt;22.4–22.6&lt;/td&gt;
&lt;td&gt;87.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nemotron 3.5 Super VL (Q3)&lt;/td&gt;
&lt;td&gt;26.6&lt;/td&gt;
&lt;td&gt;14.3–14.4&lt;/td&gt;
&lt;td&gt;55.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each request gets slower, but the total was about 1.5–2× a single request. Qwen3.6's per-request numbers vary because its answer lengths varied, from 267 to 421 tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast and able to finish the task were different things
&lt;/h3&gt;

&lt;p&gt;The fastest model, Flint, did not fix the error in 12 steps. It never opened &lt;code&gt;config.yaml&lt;/code&gt;. It ran commands like &lt;code&gt;pwd&lt;/code&gt;, &lt;code&gt;echo hello&lt;/code&gt; and &lt;code&gt;ls -la /&lt;/code&gt;, and ended up just looking around at folder contents. Flint wrote out its thinking even when I passed the setting to turn thinking off. Because of that, on the code prompt with an 800-token answer limit, it hit the limit on thinking alone and the answer was empty. With the limit at 4,000 it passed (3,408 tokens), but it still didn't fix the task. In tool calling, it called &lt;code&gt;ls -la&lt;/code&gt; before the correct command (both times, at the 800 and the 4,000 limit).&lt;/p&gt;

&lt;p&gt;Hermes 4.3 didn't fix it either. In what the log kept, it repeated &lt;code&gt;npm start&lt;/code&gt;, &lt;code&gt;npm test&lt;/code&gt; and &lt;code&gt;npm run build&lt;/code&gt; (only the end of the log survived, and the final verdict line is cut off too).&lt;/p&gt;

&lt;p&gt;The other 6 fixed it, in different numbers of steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5 steps: Qwen3.6-35B-A3B, Bolt, Super VL. List files, read the config, fix it, run the check command: close to the shortest path.&lt;/li&gt;
&lt;li&gt;8 steps: Mistral Small 3.2.&lt;/li&gt;
&lt;li&gt;9 steps: Qwen3.8-27B. Its report included the cause (a capital O where a 0 should be).&lt;/li&gt;
&lt;li&gt;gpt-oss-120B: fixed it correctly at step 5, but then didn't run the check script (&lt;code&gt;check.py&lt;/code&gt;) and kept listing folders until it used up all 12 steps. Its report was empty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the JSON prompt, 4 models (Bolt, Super VL, Flint, Hermes 4.3) returned bare JSON, and the other 4 wrapped it in a Markdown code fence tagged &lt;code&gt;json&lt;/code&gt;. With the fence removed, all 8 parsed. If you pass the output straight to another program, you'll want a step that strips the fence.&lt;/p&gt;

&lt;p&gt;With Hermes 4.3, GPU memory grew by about 7GB at the 32k context (23.5GB → 30.7GB). The other models grew by 0.2–4.5GB. If you use it with long contexts, budget more than the model file size.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands you can reuse
&lt;/h2&gt;

&lt;p&gt;Speed (&lt;code&gt;llama-bench&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;llama-bench -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -ngl 999 -fa 1 -p 512,4096 -n 128,512 -r 3 -o csv
&lt;span class="c"&gt;# Long-context row&lt;/span&gt;
llama-bench -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -ngl 999 -fa 1 -p 32768 -n 128 -r 1 -o csv
&lt;span class="c"&gt;# Move expert weights to the CPU side (MoE only; the number is the layer count)&lt;/span&gt;
llama-bench -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -ngl 999 -fa 1 -p 512 -n 128 -r 1 -ncmoe 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Server (&lt;code&gt;llama-server&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;llama-server -m &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;model&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;.gguf -c 32768 -np 1 -fa on -ngl 999 --jinja --host 127.0.0.1 --port 8080
&lt;span class="c"&gt;# For models that handle images, add that model's mmproj&lt;/span&gt;
&lt;span class="c"&gt;#   --mmproj &amp;lt;mmproj&amp;gt;.gguf&lt;/span&gt;
&lt;span class="c"&gt;# 4 requests at once&lt;/span&gt;
&lt;span class="c"&gt;#   -np 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To turn thinking off, I put &lt;code&gt;"chat_template_kwargs": {"enable_thinking": false}&lt;/code&gt; in the request body. gpt-oss can't turn thinking off, so I used the lightest setting, &lt;code&gt;{"reasoning_effort": "low"}&lt;/code&gt;, and set the answer limit to 1,500 tokens.&lt;/p&gt;

&lt;p&gt;Bolt with speculative decoding (from the official model card's instructions):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;llama-server -m NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB.gguf -c 32768 -fa on -ngl 999 --jinja \
  --spec-type draft-dflash --spec-draft-n-max 7 \
  --spec-draft-model NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB-LiLiCorr.gguf --spec-draft-ngl 999
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I didn't measure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One PC only.&lt;/strong&gt; I didn't compare with other machines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantization isn't aligned.&lt;/strong&gt; This is not a same-bit-width comparison.&lt;/li&gt;
&lt;li&gt;I judged capability with only 5 short prompts and 1 task. I did not judge the quality of the Japanese and image answers. All prompts and the task were run once each at temperature 0.&lt;/li&gt;
&lt;li&gt;For the ~87GB Super VL: where the part that didn't show up in nvidia-smi was placed. Also the server prompts and 32k context on that version.&lt;/li&gt;
&lt;li&gt;I didn't measure with tools other than llama.cpp, such as Ollama. (The difference from Ollama on the same file is in the &lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;previous article&lt;/a&gt;. There, Ollama used speculative decoding by default, and Qwen3.6 ran at about 100 tokens/s.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On this PC (about 82GB of GPU memory), generation speed lined up by the number of parameters active per token, not by total parameter count. The 117B gpt-oss-120B was about 4× faster than the 27B Qwen3.8-27B.&lt;/li&gt;
&lt;li&gt;A model of about 87GB still ran with everything assigned to the GPU. nvidia-smi's ~82GB was not the upper limit of what could be placed.&lt;/li&gt;
&lt;li&gt;Speed and finishing the task were separate. The fastest model, Flint, could not fix a one-character error in a config file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Licenses: of the 8 models, 6 are Apache-2.0, and the two Nemotron 3.5 models are &lt;a href="https://openmdw.ai/license/1-1/" rel="noopener noreferrer"&gt;OpenMDW-1.1&lt;/a&gt;. OpenMDW-1.1 asks you to keep a copy of the license and the attribution notices when you redistribute the model, and does not restrict how the outputs are used.&lt;/p&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my series on the Surface Laptop Ultra (Windows on Arm with an NVIDIA GPU). Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;Initial setup: on Arm Windows, check whether each tool can use the GPU before installing it&lt;/a&gt; (Japanese)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine&lt;/a&gt; (English)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/moving-comfyui-from-intel-arc-to-arm-wsl2-the-same-requirementstxt-didnt-install-the-same-3kfk"&gt;Moving ComfyUI from Intel Arc to Arm WSL2: The Same requirements.txt Didn't Install the Same Versions&lt;/a&gt; (English)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/surface-local-llm-8models-bench" rel="noopener noreferrer"&gt;120B が 27B より約 4 倍速かった。Surface Laptop Ultra でローカル LLM 8 種を同じ条件で測る&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>llamacpp</category>
      <category>localllm</category>
    </item>
    <item>
      <title>Moving ComfyUI from Intel Arc to Arm WSL2: The Same requirements.txt Didn't Install the Same Versions</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Thu, 12 Nov 2026 05:51:53 +0000</pubDate>
      <link>https://dev.to/maruhana/moving-comfyui-from-intel-arc-to-arm-wsl2-the-same-requirementstxt-didnt-install-the-same-3kfk</link>
      <guid>https://dev.to/maruhana/moving-comfyui-from-intel-arc-to-arm-wsl2-the-same-requirementstxt-didnt-install-the-same-3kfk</guid>
      <description>&lt;p&gt;&lt;em&gt;Measured on a Surface Laptop Ultra (Windows on Arm, RTX Spark): PyTorch 2.14.1+cu132 just worked on the GPU; torchaudio was the only piece that didn't, and the version number wasn't what had to match.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/surface-comfyui-wsl2" rel="noopener noreferrer"&gt;ComfyUI を Intel Arc から Arm の WSL2 へ。同じ requirements でも部品の版は揃わなかった&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Short version: the same &lt;code&gt;requirements.txt&lt;/code&gt; did not give me the same package versions, and when a package wouldn't install, the thing to check was its CUDA build, not its version number.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 55-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/8Hp1LsAM5dk" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Inside WSL2 on Windows on Arm, the official PyTorch 2.14.1+cu132 (Linux Arm build) ran ComfyUI on the GPU. &lt;strong&gt;Re-drawing with models already loaded&lt;/strong&gt; (sampling + decode + save, not the end-to-end time for one image) took 21.60 s vs. 50.87 s on the old Intel Arc laptop: about 2.4× faster.&lt;/li&gt;
&lt;li&gt;torchaudio was the only package that didn't install. I first looked for a torchaudio numbered like torch (2.14.1); &lt;strong&gt;that premise was wrong.&lt;/strong&gt; What had to match was the CUDA build: PyPI's torchaudio 2.11.0 targets CUDA 13.0, and my torch was CUDA 13.2.&lt;/li&gt;
&lt;li&gt;A CUDA 13.2 build on PyTorch's &lt;strong&gt;test&lt;/strong&gt; index loaded the audio nodes, but it isn't a stable release, so &lt;strong&gt;the image environment still runs without torchaudio.&lt;/strong&gt; (ComfyUI v0.38.0 and later don't require torchaudio at all.)&lt;/li&gt;
&lt;li&gt;The same commit's requirements installed different versions (numpy 1.26.4 → 2.5.2, opencv-python 4.10 → 5.0).&lt;/li&gt;
&lt;li&gt;Same workflow, input and seed: the preprocessing was nearly identical, but the final images had the same composition with different details. &lt;strong&gt;With a different GPU and torch, the same seed did not give the same image.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What I moved&lt;/strong&gt;: one image workflow (SDXL img2img with line-art and tile ControlNets), as-is: pinned ComfyUI commit, same custom nodes, the same 4 model files. The goal was to run what already worked in the same form, not to try a new model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From&lt;/strong&gt;: a laptop with an Intel Arc 140V integrated GPU, running PyTorch's Intel GPU (XPU) build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To&lt;/strong&gt;: a Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X), inside WSL2. The GPU vendor and the CPU architecture both changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measured&lt;/strong&gt;: what installed and what didn't; re-draw time for runs 2–5 on both machines; output differences (mean difference, PSNR, SSIM) for the preprocessing and the final image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not measured&lt;/strong&gt;: see "Where this stops" near the end.&lt;/li&gt;
&lt;li&gt;Versions and index contents are as recorded in October 2026, when I wrote the original.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post keeps both my first attempt at the torchaudio problem and the correction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The target environment
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PC&lt;/td&gt;
&lt;td&gt;Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WSL2&lt;/td&gt;
&lt;td&gt;Ubuntu 24.04 (aarch64), Python 3.12.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory assigned to the GPU&lt;/td&gt;
&lt;td&gt;95.5GB (NVIDIA App setting)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ComfyUI&lt;/td&gt;
&lt;td&gt;Pinned commit (table below); reports itself as 0.18.1 at startup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PyTorch&lt;/td&gt;
&lt;td&gt;2.14.1+cu132 (from PyTorch's CUDA 13.2 index, Linux Arm build)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;4 files, about 9.5GiB in total (checkpoint, ControlNets, line-art extractor)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  WSL2 memory: raised to 24GB
&lt;/h2&gt;

&lt;p&gt;According to &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/wsl-config" rel="noopener noreferrer"&gt;Microsoft's WSL configuration docs&lt;/a&gt;, WSL2 gets 50% of Windows' total memory by default. This laptop assigns 95.5GB to the GPU, so Windows itself has only about 31GB, and WSL2 saw 15GB.&lt;/p&gt;

&lt;p&gt;Image generation reads model files into CPU memory before moving them to the GPU. I estimated that peak at 8–16GB and created &lt;code&gt;%USERPROFILE%\.wslconfig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="k"&gt;[wsl2]&lt;/span&gt;
&lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;24GB&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After &lt;code&gt;wsl --shutdown&lt;/code&gt; and restarting WSL2, &lt;code&gt;free -g&lt;/code&gt; showed 23GB total.&lt;/p&gt;

&lt;p&gt;As it turned out, WSL2 memory use peaked at 5.5GiB during the first generation, so 24GB was more than enough. &lt;strong&gt;For this workflow, the default 15GB may well have been enough.&lt;/strong&gt; I kept 24GB for larger models later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pin ComfyUI, then read the requirements before installing
&lt;/h2&gt;

&lt;p&gt;I checked out the exact commits running on the old laptop:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Repository&lt;/th&gt;
&lt;th&gt;Commit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ComfyUI&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/comfyanonymous/ComfyUI" rel="noopener noreferrer"&gt;comfyanonymous/ComfyUI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;13917b388028aee922efce6b4714db96e8cfea36&lt;/code&gt; ("Nightly Nvidia pytorch is now cu132 (#13288)")&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom nodes&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/Fannovel16/comfyui_controlnet_aux" rel="noopener noreferrer"&gt;Fannovel16/comfyui_controlnet_aux&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;95a13e2e5d8f8ae57583fbebb0be1f670889858b&lt;/code&gt; ("Merge pull request #615 …")&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Before installing, I checked both &lt;code&gt;requirements.txt&lt;/code&gt; files for lines that pull from somewhere other than PyPI: &lt;code&gt;git+&lt;/code&gt; lines, URLs, &lt;code&gt;-e&lt;/code&gt;, &lt;code&gt;--index-url&lt;/code&gt;, and so on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep -nE &lt;span class="s1"&gt;'git\+|https?://|^-e|--index-url|--extra-index-url|--find-links'&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Neither file had any.&lt;/p&gt;

&lt;h2&gt;
  
  
  PyTorch: the official CUDA build installed as-is
&lt;/h2&gt;

&lt;p&gt;As in my initial setup of this laptop, I installed the official CUDA 13.2 build for Linux Arm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torch 2.14.1+cu132
cuda.is_available() True
NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU)
get_arch_list() ['sm_80', 'sm_90', 'sm_100', 'sm_110', 'sm_120']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This GPU is compute capability 12.1, but the arch list has no &lt;code&gt;sm_121&lt;/code&gt;; it stops at 12.0. Generation still ran on the GPU. NVIDIA's &lt;a href="https://docs.nvidia.com/cuda/blackwell-compatibility-guide/index.html" rel="noopener noreferrer"&gt;Blackwell compatibility guide&lt;/a&gt; says a cubin built for one compute capability runs on GPUs with the same major version and an equal or higher minor version. 12.0 code running on 12.1 is consistent with that.&lt;/p&gt;

&lt;h2&gt;
  
  
  torchaudio: the CUDA version didn't match, not the version number
&lt;/h2&gt;

&lt;p&gt;At this commit, ComfyUI's &lt;code&gt;requirements.txt&lt;/code&gt; lists &lt;code&gt;torch&lt;/code&gt;, &lt;code&gt;torchvision&lt;/code&gt; and &lt;code&gt;torchaudio&lt;/code&gt;. Only torchaudio failed to install.&lt;/p&gt;

&lt;h3&gt;
  
  
  First attempt: look for the same version as torch, then drop it
&lt;/h3&gt;

&lt;p&gt;torch was 2.14.1, so I looked for torchaudio 2.14.1.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On PyTorch's &lt;a href="https://download.pytorch.org/whl/cu132/torchaudio/" rel="noopener noreferrer"&gt;CUDA 13.2 index&lt;/a&gt;, the newest torchaudio was a 2.2.0 aarch64 build. Nothing newer was there, for aarch64 or any other platform. Installing torch, torchvision and torchaudio together from that index stopped with &lt;code&gt;Cannot install torch and torchaudio==2.2.0 because these package versions have conflicting dependencies&lt;/code&gt; and &lt;code&gt;ResolutionImpossible&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On &lt;a href="https://pypi.org/project/torchaudio/" rel="noopener noreferrer"&gt;PyPI&lt;/a&gt;, the latest was 2.11.0. No 2.14.1.&lt;/li&gt;
&lt;li&gt;The CUDA 13.0 and 12.8 indexes also stopped at torchaudio 2.11.0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I installed only torch and torchvision from the CUDA 13.2 index, and installed ComfyUI's requirements with the torchaudio line removed.&lt;/p&gt;

&lt;p&gt;I also pinned torch and torchvision with a pip constraints file. The &lt;code&gt;torch&lt;/code&gt; line in requirements has no version, and I was worried that dependency resolution might swap the CUDA 13.2 torch for the PyPI one. At the time I thought PyPI's Linux Arm torch was a CPU-only build. Later, reading the METADATA of PyPI's aarch64 wheel, I found it depends on CUDA 13.0. So there was no risk of ending up on a CPU build, but I still didn't want 13.2 swapped for 13.0. &lt;strong&gt;I never actually saw the swap happen.&lt;/strong&gt; After pinning, torch stayed at 2.14.1+cu132. The fact that PyPI's Linux Arm builds target CUDA 13.0 comes up again below.&lt;/p&gt;

&lt;p&gt;Roughly (not the literal commands I typed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip freeze &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^(torch|torchvision)=='&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; constraints.txt
grep -v &lt;span class="s1"&gt;'^torchaudio'&lt;/span&gt; requirements.txt &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements-noaudio.txt
pip install -r requirements-noaudio.txt -c constraints.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only effect was that three audio node files (&lt;code&gt;nodes_audio.py&lt;/code&gt;, &lt;code&gt;nodes_lt_audio.py&lt;/code&gt;, &lt;code&gt;nodes_audio_encoder.py&lt;/code&gt;) failed to load at startup. The image workflow doesn't use them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Later: looking for the same number was the mistake
&lt;/h3&gt;

&lt;p&gt;torchaudio's &lt;a href="https://docs.pytorch.org/audio/main/installation.html" rel="noopener noreferrer"&gt;official installation page&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TorchAudio 2.11 works with PyTorch 2.11 and with every future PyTorch release&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I confirmed it in PyPI's METADATA as well. torchaudio 2.10.0 has &lt;code&gt;Requires-Dist: torch==2.10.0&lt;/code&gt;, but 2.11.0 has no torch requirement. &lt;strong&gt;Since 2.11, torchaudio is not tied to a torch version.&lt;/strong&gt; Searching for a torchaudio numbered 2.14.1 was the wrong premise.&lt;/p&gt;

&lt;h3&gt;
  
  
  PyPI's 2.11.0 installed, then failed at import
&lt;/h3&gt;

&lt;p&gt;So I installed PyPI's torchaudio 2.11.0 (aarch64), in a copy of the image venv. The image venv itself was not touched.&lt;/p&gt;

&lt;p&gt;With the constraints still in place, pip installed only torchaudio 2.11.0, and torch was not replaced. But import failed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RuntimeError: Detected that PyTorch and TorchAudio were compiled with different CUDA versions. PyTorch has CUDA version 13.2 whereas TorchAudio has CUDA version 13.0. Please install the TorchAudio version that matches your PyTorch version.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PyPI's aarch64 torchaudio is built for CUDA 13.0, and torchaudio checks its CUDA version against torch's at import (&lt;code&gt;_check_cuda_version()&lt;/code&gt; in &lt;code&gt;torchaudio/_extension/utils.py&lt;/code&gt;). My torch was CUDA 13.2. ComfyUI started, but the audio nodes failed with the same error, and the node count was 706 (20 of them audio), the same as with no torchaudio at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pip succeeding did not mean it worked. What had to match was the CUDA version, not the version number.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  A CUDA 13.2 build of 2.11.0 was on the test index
&lt;/h3&gt;

&lt;p&gt;At the time of writing (October 2026), the stable CUDA 13.2 index had no torchaudio 2.11. PyTorch's &lt;a href="https://download.pytorch.org/whl/test/cu132/torchaudio/" rel="noopener noreferrer"&gt;test index&lt;/a&gt; had &lt;code&gt;torchaudio-2.11.0+cu132-cp312-cp312-manylinux_2_28_aarch64.whl&lt;/code&gt;. I installed it with &lt;code&gt;--no-deps&lt;/code&gt; so it wouldn't touch torch. torch and torchvision stayed the same.&lt;/p&gt;

&lt;p&gt;Roughly (not the literal command):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install --no-deps --index-url https://download.pytorch.org/whl/test/cu132 &lt;span class="s2"&gt;"torchaudio==2.11.0+cu132"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;torch and torchaudio &lt;code&gt;__version__&lt;/code&gt;, and &lt;code&gt;torch.cuda.is_available()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2.14.1+cu132 2.11.0+cu130 True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;torchaudio's &lt;code&gt;__version__&lt;/code&gt; says "2.11.0+cu130", but the CUDA check at import passed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MelSpectrogram and resample ran on the GPU.&lt;/li&gt;
&lt;li&gt;The "torchaudio missing" line disappeared from ComfyUI's startup log, and the audio nodes loaded without errors.&lt;/li&gt;
&lt;li&gt;Nodes went from 706 to 732, and audio nodes from 20 to 45 (LoadAudio, SaveAudio, VAEEncodeAudio, VAEDecodeAudio and others).&lt;/li&gt;
&lt;li&gt;One image from the image workflow also ran to the end in this state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Still not in the image environment
&lt;/h3&gt;

&lt;p&gt;The test index is where builds sit before a stable release. The stable CUDA 13.2 index had no 2.11 (at the time of writing), so I kept torchaudio out of the image environment. The results above are from the copied venv.&lt;/p&gt;

&lt;p&gt;On the ComfyUI side, torchaudio has since been removed from requirements (&lt;a href="https://github.com/comfyanonymous/ComfyUI/pull/16457" rel="noopener noreferrer"&gt;#16457&lt;/a&gt;, "Remove torchaudio dependency."). The PR description says "no stable cu132 build", naming the lack of a stable CUDA 13.2 build as the reason. v0.37.0's requirements include torchaudio; v0.38.0's don't. Because I had pinned a commit, I landed on a version from before the removal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom nodes: skipped a dependency I don't use
&lt;/h2&gt;

&lt;p&gt;From the custom nodes' (comfyui_controlnet_aux) requirements, I left out &lt;code&gt;mediapipe&lt;/code&gt;. It's used by the face, pose and hand nodes, which this workflow doesn't use.&lt;/p&gt;

&lt;p&gt;On PyPI, mediapipe 0.10.33 has no Linux aarch64 wheel; the newer 1.1.1 does. I haven't checked whether this custom node pack works with 1.x. I'll check when I need it.&lt;/p&gt;

&lt;p&gt;After installing, I confirmed with &lt;code&gt;pip list&lt;/code&gt; that mediapipe, insightface and torchaudio, and any Intel GPU packages (names containing intel or xpu), were not installed.&lt;/p&gt;

&lt;p&gt;onnxruntime also wasn't installed, because neither requirements file lists it. At startup there's a warning that DWPose (pose estimation) falls back to OpenCV on the CPU. This workflow doesn't use it either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Package versions didn't match the old laptop
&lt;/h2&gt;

&lt;p&gt;Even from the same commit's requirements, the installed versions didn't match the old laptop. Most requirements don't pin versions (some only set a floor, like &lt;code&gt;numpy&amp;gt;=1.25.0&lt;/code&gt;), so you get whatever is newest at install time.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Old laptop (at migration)&lt;/th&gt;
&lt;th&gt;Surface (WSL2)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;torch&lt;/td&gt;
&lt;td&gt;Intel GPU (XPU) build&lt;/td&gt;
&lt;td&gt;2.14.1+cu132&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;torchaudio&lt;/td&gt;
&lt;td&gt;installed&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;not installed&lt;/strong&gt; (see above)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;numpy&lt;/td&gt;
&lt;td&gt;1.26.4&lt;/td&gt;
&lt;td&gt;2.5.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;opencv-python&lt;/td&gt;
&lt;td&gt;4.10.0.84&lt;/td&gt;
&lt;td&gt;5.0.0.93 (headless too)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pillow&lt;/td&gt;
&lt;td&gt;12.1.1&lt;/td&gt;
&lt;td&gt;12.3.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;transformers&lt;/td&gt;
&lt;td&gt;5.5&lt;/td&gt;
&lt;td&gt;5.20.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onnxruntime&lt;/td&gt;
&lt;td&gt;1.24.4&lt;/td&gt;
&lt;td&gt;not installed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;comfyui_frontend_package&lt;/td&gt;
&lt;td&gt;1.42.8&lt;/td&gt;
&lt;td&gt;1.42.8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The old-laptop column is as of the migration. Since then, the old laptop moved from Python 3.12 to 3.14, numpy to 2.5.4, and opencv-python to 4.14. The output comparison below was done with these newer versions.&lt;/p&gt;

&lt;p&gt;I didn't bring the Surface back in line with the old laptop. At migration time, numpy had crossed from 1.x to 2.x and opencv-python from 4.x to 5.x: major-version jumps. How the output changed is in "Comparing the outputs" below.&lt;/p&gt;

&lt;p&gt;I saved the full &lt;code&gt;pip freeze&lt;/code&gt; to a file after installing, so that if a difference shows up later I can trace which package differed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Models: verified before placing them
&lt;/h2&gt;

&lt;p&gt;I copied the 4 model files (about 9.5GiB) from the old laptop. After copying, I checked SHA256 and byte counts against the originals, then checked again with &lt;code&gt;sha256sum -c&lt;/code&gt; after placing them inside WSL2. All 4 matched.&lt;/p&gt;

&lt;p&gt;One of them (&lt;code&gt;netG.pth&lt;/code&gt;, the line-art extractor) is a pickle file: the public AnimeLineArt weights that controlnet_aux uses. Before loading it, I inspected it without executing the pickle opcodes, the same way as in &lt;a href="https://zenn.dev/maruhana/articles/model-file-pickle-scan-before-load" rel="noopener noreferrer"&gt;an earlier article (Japanese)&lt;/a&gt;. Everything it calls was within the allowlist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Startup and the first image
&lt;/h2&gt;

&lt;p&gt;Part of the startup log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total VRAM 112872 MB, total RAM 23982 MB
pytorch version: 2.14.1+cu132
Device: cuda:0 NVIDIA RTX Spark N1X (6144-core Blackwell RTX GPU) : cudaMallocAsync
ComfyUI version: 0.18.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;112872MB of VRAM (about 110.2GiB) is more than the 95.5GB assigned in the NVIDIA App. It's the same number I noted in the initial setup article, where the total CUDA reports looked close to "dedicated" plus "shared". The 23982MB of RAM reflects the 24GB in &lt;code&gt;.wslconfig&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;706 nodes loaded, including the line-art preprocessing node (&lt;code&gt;AnimeLineArtPreprocessor&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Opening &lt;code&gt;http://127.0.0.1:&amp;lt;port&amp;gt;/&lt;/code&gt; in a browser on the Windows side returned HTTP 200. It arrives through WSL2's localhost forwarding; I didn't change any settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I submitted the workflow through the API (&lt;code&gt;POST /prompt&lt;/code&gt;) and generated one image, the first run on migration day:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;53.2 s (first run, including model loading)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak GPU memory (nvidia-smi)&lt;/td&gt;
&lt;td&gt;13,579MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak GPU temperature&lt;/td&gt;
&lt;td&gt;79°C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak WSL2 memory use&lt;/td&gt;
&lt;td&gt;5.5GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It ran on the GPU to the end. I measured speed and compared outputs against the old laptop later, under matched conditions (next two sections).&lt;/p&gt;

&lt;h2&gt;
  
  
  Runs 2 and later, compared with the old laptop
&lt;/h2&gt;

&lt;p&gt;Same procedure on both machines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart ComfyUI and run once. This run includes model loading, so I treated it as warm-up and left it out of the comparison.&lt;/li&gt;
&lt;li&gt;Runs 2–5 change only the seed. Models, line-art preprocessing and VAEEncode stay cached, so only sampling, decode and save run.&lt;/li&gt;
&lt;li&gt;Time is the &lt;code&gt;Prompt executed in X seconds&lt;/code&gt; value from ComfyUI's log.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this compares &lt;strong&gt;the time to re-draw the same picture from the second image on&lt;/strong&gt;, not the time for one image including preprocessing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Run 1 (incl. loading)&lt;/th&gt;
&lt;th&gt;Run 2&lt;/th&gt;
&lt;th&gt;Run 3&lt;/th&gt;
&lt;th&gt;Run 4&lt;/th&gt;
&lt;th&gt;Run 5&lt;/th&gt;
&lt;th&gt;Avg. runs 2–5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Old laptop (Intel Arc 140V, XPU)&lt;/td&gt;
&lt;td&gt;99.34 s&lt;/td&gt;
&lt;td&gt;51.09&lt;/td&gt;
&lt;td&gt;50.89&lt;/td&gt;
&lt;td&gt;51.37&lt;/td&gt;
&lt;td&gt;50.12&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;50.87 s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Surface (RTX Spark N1X, WSL2)&lt;/td&gt;
&lt;td&gt;38.44 s&lt;/td&gt;
&lt;td&gt;21.79&lt;/td&gt;
&lt;td&gt;21.57&lt;/td&gt;
&lt;td&gt;21.46&lt;/td&gt;
&lt;td&gt;21.59&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;21.60 s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;From run 2 on, the Surface was about 2.4× faster (50.87 ÷ 21.60).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Peak GPU memory was about 10.6GiB on the old laptop and 13,873MiB on the Surface. The old laptop's integrated GPU has no nvidia-smi equivalent, so that number is an estimate from ComfyUI's &lt;code&gt;/system_stats&lt;/code&gt; (total minus minimum free). The Surface number is from nvidia-smi and, because the memory is unified, includes other processes (1,928MiB before measuring).&lt;/li&gt;
&lt;li&gt;On the Surface, temperature peaked at 82°C (run 1) and was 75°C on run 5. I had no way to measure the old laptop's temperature, so I didn't.&lt;/li&gt;
&lt;li&gt;The Surface's run 1 took 38.44 s, shorter than the 53.2 s on migration day. Migration day was right after restarting WSL, with a cold disk cache; that's my reading of the difference.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comparing the outputs
&lt;/h2&gt;

&lt;p&gt;Same workflow, same input, same seed on both machines. I added one node to save the line-art preprocessor (AnimeLineArt) output, so I could compare the preprocessing result and the final output separately. The old laptop ran the newer versions mentioned above (Python 3.14, numpy 2.5.4, opencv-python 4.14).&lt;/p&gt;

&lt;p&gt;Metrics: mean per-pixel difference (0–255), PSNR and SSIM.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Compared&lt;/th&gt;
&lt;th&gt;Mean diff&lt;/th&gt;
&lt;th&gt;Max diff&lt;/th&gt;
&lt;th&gt;PSNR&lt;/th&gt;
&lt;th&gt;SSIM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Line-art preprocessing: old laptop vs. Surface&lt;/td&gt;
&lt;td&gt;0.044&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;61.7dB&lt;/td&gt;
&lt;td&gt;0.9999&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Final output: old laptop vs. Surface&lt;/td&gt;
&lt;td&gt;27.8&lt;/td&gt;
&lt;td&gt;255&lt;/td&gt;
&lt;td&gt;15.3dB&lt;/td&gt;
&lt;td&gt;0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Final output: old laptop vs. Surface (migration-day outputs)&lt;/td&gt;
&lt;td&gt;27.7&lt;/td&gt;
&lt;td&gt;255&lt;/td&gt;
&lt;td&gt;15.3dB&lt;/td&gt;
&lt;td&gt;0.45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Final output: same Surface, different days&lt;/td&gt;
&lt;td&gt;1.36&lt;/td&gt;
&lt;td&gt;210&lt;/td&gt;
&lt;td&gt;37.3dB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Final output: same old laptop, before vs. after the version upgrade&lt;/td&gt;
&lt;td&gt;6.66&lt;/td&gt;
&lt;td&gt;227&lt;/td&gt;
&lt;td&gt;25.5dB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The line-art preprocessing was nearly identical on both machines.&lt;/strong&gt; 96% of pixels matched exactly, and the remaining differences were at most 4. The difference between opencv-python 4.14 (old laptop) and 5.0 (Surface) barely showed up in this preprocessing result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The final outputs differed a lot.&lt;/strong&gt; With nearly identical preprocessing, SSIM still dropped to 0.45. The difference was spread over the whole image, not one region: split into a 4×4 grid, every cell's mean difference was between 19 and 34. Comparing the migration-day outputs gave almost the same numbers.&lt;/p&gt;

&lt;p&gt;So the difference between the two machines arises in generation (sampling), not in preprocessing. The sampler here is euler_ancestral, which adds random noise at each step. Reading ComfyUI's code, the initial noise is generated from the seed on the CPU (&lt;a href="https://github.com/Comfy-Org/ComfyUI/blob/13917b388028aee922efce6b4714db96e8cfea36/comfy/sample.py" rel="noopener noreferrer"&gt;&lt;code&gt;comfy/sample.py&lt;/code&gt;&lt;/a&gt;), so that part should be the same on both. The noise euler_ancestral adds at each step, however, comes from the random number generator on the latent's device, i.e. the GPU (&lt;a href="https://github.com/Comfy-Org/ComfyUI/blob/13917b388028aee922efce6b4714db96e8cfea36/comfy/k_diffusion/sampling.py" rel="noopener noreferrer"&gt;&lt;code&gt;comfy/k_diffusion/sampling.py&lt;/code&gt;&lt;/a&gt;). CUDA and Intel GPUs have different RNGs, so even with the same seed the per-step noise wouldn't match, and the images would drift apart along the way. &lt;strong&gt;That's my inference; I did not extract and compare the two machines' random sequences.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even on the same machine, the same seed didn't give a perfect match. Surface vs. itself on different days was 37.3dB PSNR, visually almost identical. The old laptop before vs. after its version upgrade was 25.5dB. Both are far closer than the 15.3dB between the two machines.&lt;/p&gt;

&lt;p&gt;Visually, the composition, the placement of the figures and the position of the text were the same; the details differed: colors, how the lettering broke down, the shape and number of small background objects, and how deep the dark areas went. I didn't see one as lower quality than the other.&lt;/p&gt;

&lt;p&gt;PyTorch's &lt;a href="https://docs.pytorch.org/docs/stable/notes/randomness.html" rel="noopener noreferrer"&gt;reproducibility notes&lt;/a&gt; say completely reproducible results are not guaranteed across PyTorch releases or platforms. Different GPUs and torch builds giving different images from the same seed falls within that.&lt;/p&gt;

&lt;p&gt;The goal was to run what already worked in the same form. Judged by "does it produce images of the same quality" rather than "does it produce the same image", the migration worked. But the assumption that the same seed gives the same image again did not hold across machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  A newer ComfyUI goes in a separate folder and venv
&lt;/h2&gt;

&lt;p&gt;I'll also try video generation on this laptop, and video models need a newer ComfyUI. For example, MiniMax H3's &lt;a href="https://docs.comfy.org/tutorials/video/minimax/minimax-h3-fastvideo" rel="noopener noreferrer"&gt;official tutorial&lt;/a&gt; asks for "ComfyUI 0.36.0 or later".&lt;/p&gt;

&lt;p&gt;The image workflow is pinned to a commit, as above. Upgrading it could change the image results, so the newer version got its own folder and venv.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Image&lt;/th&gt;
&lt;th&gt;Video&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ComfyUI&lt;/td&gt;
&lt;td&gt;pinned commit (0.18.1)&lt;/td&gt;
&lt;td&gt;v0.42.4 (&lt;code&gt;3f438ca69f3d0efc5f748de055daeea9ba26ee50&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;torch&lt;/td&gt;
&lt;td&gt;2.14.1+cu132&lt;/td&gt;
&lt;td&gt;2.14.1+cu132&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;torchaudio&lt;/td&gt;
&lt;td&gt;removed&lt;/td&gt;
&lt;td&gt;not in requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;1.42.8&lt;/td&gt;
&lt;td&gt;1.55.18&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I checked the video install's requirements for non-PyPI sources the same way. torchaudio is no longer in its requirements, so there was nothing to remove.&lt;/p&gt;

&lt;p&gt;One thing I noticed while picking a version: GitHub's Releases page still showed v0.42.1 as "Latest", but tags from v0.42.2 on kept coming after it (up to v0.42.5 at the time of writing). The MiniMax H3 LoRA fix (&lt;a href="https://github.com/comfyanonymous/ComfyUI/pull/17239" rel="noopener noreferrer"&gt;#17239&lt;/a&gt;) is in v0.42.3. &lt;strong&gt;Looking only at the latest Release, you can miss fixes that are already tagged&lt;/strong&gt;, so I picked from the tag list.&lt;/p&gt;

&lt;p&gt;Video test results are out of scope here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this stops
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The effect of the numpy version.&lt;/strong&gt; opencv-python 4.x vs. 5.x made almost no difference to preprocessing, but I couldn't check numpy 1.26 vs. 2.5. By the time I compared, the old laptop was already on numpy 2.5.4, and no preprocessing output from 1.26.4 remained.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The mechanism that splits the outputs.&lt;/strong&gt; I read in the code that the per-step noise comes from the GPU's RNG. I didn't compare the actual random sequences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time for one image including preprocessing.&lt;/strong&gt; I compared only the cached re-draw time (sampling, decode, save).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The old laptop's GPU temperature.&lt;/strong&gt; No way to measure it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflows that actually handle audio.&lt;/strong&gt; With the test-index torchaudio, I confirmed only that the audio nodes load and that MelSpectrogram and resample run on the GPU. I didn't run any workflow that generates audio or reads/writes audio files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pairing with a CUDA 13.0 torch.&lt;/strong&gt; PyPI's torchaudio 2.11.0 targets CUDA 13.0, so with a CUDA 13.0 torch, the PyPI build should pass the import check. That's an inference; I didn't try it.&lt;/li&gt;
&lt;li&gt;Whether the custom nodes that use mediapipe (face, pose, hand) work on Arm Linux.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Even on Arm Windows, inside WSL2, ComfyUI ran on the GPU with the official CUDA build of PyTorch. With models loaded, re-drawing took 21.60 s, about 2.4× faster than the old laptop (50.87 s).&lt;/li&gt;
&lt;li&gt;torchaudio was the only package that didn't install. I dropped it after failing to find one numbered like torch, but torchaudio 2.11 doesn't pin a torch version. On the other hand, PyPI's 2.11.0 targets CUDA 13.0 and failed at import with a CUDA 13.2 torch. &lt;strong&gt;When adding a package, don't look for the same number as torch; look at its dependency metadata and its CUDA version.&lt;/strong&gt; Something missing from the stable index may be on the test index, but it isn't a stable release, so I didn't put it in the image environment. ComfyUI v0.38.0 and later don't require torchaudio at all.&lt;/li&gt;
&lt;li&gt;The same commit's requirements don't give you the same package versions. Keep a &lt;code&gt;pip freeze&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;After migrating, compare preprocessing and generation separately. Here, preprocessing was nearly identical and the images split during generation. &lt;strong&gt;With a different GPU and torch, the same seed did not give the same image.&lt;/strong&gt; Composition and placement matched, and I saw no quality difference.&lt;/li&gt;
&lt;li&gt;WSL2's memory defaults to half of Windows'. On a PC that assigns a lot to the GPU, that gets small; set it in &lt;code&gt;.wslconfig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I kept the pinned version and the newer version in separate folders and venvs. When picking a newer version, look at the tag list, not just the latest Release.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Update note (Nov 2026): Since I wrote the original, PyTorch's stable CUDA 13.2 index has added torchaudio 2.11.1+cu132 for Linux aarch64, so the "not on the stable index" reason above no longer holds. I have not installed or tested it on the machine yet; everything above is the October 2026 record (torch 2.14.1+cu132, pinned ComfyUI 0.18.1). ComfyUI's current requirements (v0.45.0) still don't include torchaudio.&lt;/p&gt;

&lt;p&gt;ComfyUI is licensed under GPL-3.0, and comfyui_controlnet_aux under Apache-2.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my series on the Surface Laptop Ultra (Windows on Arm with an NVIDIA GPU). Related articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;Initial setup: on Arm Windows, check whether each tool can use the GPU before installing it&lt;/a&gt; (Japanese)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl"&gt;Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine&lt;/a&gt; (English)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/surface-comfyui-wsl2" rel="noopener noreferrer"&gt;ComfyUI を Intel Arc から Arm の WSL2 へ。同じ requirements でも部品の版は揃わなかった&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>comfyui</category>
      <category>pytorch</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Ollama vs. llama.cpp on the Same GGUF: The 15% Speed Gap Was the Defaults, Not the Engine</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Mon, 09 Nov 2026 05:54:04 +0000</pubDate>
      <link>https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl</link>
      <guid>https://dev.to/maruhana/ollama-vs-llamacpp-on-the-same-gguf-the-15-speed-gap-was-the-defaults-not-the-engine-3hcl</guid>
      <description>&lt;p&gt;&lt;em&gt;Measured on a Surface Laptop Ultra (Windows on Arm, RTX Spark): align the draft and sampling settings, and the gap mostly disappears.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/surface-llama-windows-ollama-defaults" rel="noopener noreferrer"&gt;Ollama と Llama-Windows を同じ GGUF で比べたら、差はエンジンではなく既定の設定だった&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you benchmark local LLMs, this is a log of how I got the comparison wrong twice before getting it roughly right. The fix was not a faster engine. It was making both sides use the same settings.&lt;/p&gt;

&lt;p&gt;A 55-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/c1_b7dOgf5I" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Same GGUF (Qwen3.6-35B-A3B, Q4_K_M), same laptop. &lt;strong&gt;With default settings, Llama-Windows ran at about 85% of Ollama's speed&lt;/strong&gt; (roughly 15% slower).&lt;/li&gt;
&lt;li&gt;Ollama is also running llama.cpp inside. Its bundled build was &lt;strong&gt;only 32 commits newer&lt;/strong&gt; than the one in Llama-Windows.&lt;/li&gt;
&lt;li&gt;Two defaults differed: &lt;strong&gt;Ollama uses MTP speculative decoding (2 draft tokens) by default&lt;/strong&gt;, and the &lt;strong&gt;sampling defaults&lt;/strong&gt; are different.&lt;/li&gt;
&lt;li&gt;With both aligned, the speeds were &lt;strong&gt;about the same&lt;/strong&gt;. The one remaining difference: with &lt;code&gt;presence_penalty&lt;/code&gt; 1.5, only the llama.cpp side got &lt;strong&gt;about 7% slower&lt;/strong&gt;. I have not investigated why.&lt;/li&gt;
&lt;li&gt;2 draft tokens were enough. 3 was never faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Names first
&lt;/h2&gt;

&lt;p&gt;Four names in this article look alike. They are different things:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Llama-Windows&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A Windows tray app from ggml-org (the llama.cpp developers). Not llama.cpp itself. &lt;a href="https://github.com/ggml-org/Llama-Windows" rel="noopener noreferrer"&gt;github.com/ggml-org/Llama-Windows&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;llama.exe&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The inference engine that Llama-Windows downloads and runs. It is a llama.cpp build (b11706, as recorded at measurement time).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;llama.cpp&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The engine project both tools are built on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;llama-server (bundled in Ollama)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The llama.cpp server that Ollama 0.40.7 ships and runs internally.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first comparison below is "Ollama app vs. Llama-Windows app, defaults as shipped". Everything after that compares Ollama against &lt;code&gt;llama.exe&lt;/code&gt; started by hand, so I could control its settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the comparison flipped
&lt;/h2&gt;

&lt;p&gt;I revised the conclusion twice while writing this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Defaults as shipped:&lt;/strong&gt; Llama-Windows is about 15% slower than Ollama.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draft (speculative decoding) aligned:&lt;/strong&gt; now &lt;code&gt;llama.exe&lt;/code&gt; looked 7–8% &lt;em&gt;faster&lt;/em&gt; than Ollama. That was also too early.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draft and sampling aligned:&lt;/strong&gt; about the same speed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The rest of the article is what I forgot to align at each step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test setup
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PC&lt;/td&gt;
&lt;td&gt;Surface Laptop Ultra (Windows 11 Arm64, NVIDIA RTX Spark N1X)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Qwen3.6-35B-A3B, Q4_K_M. The GGUF Ollama had downloaded, hard-linked into Llama-Windows (so no extra 22 GB on disk)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ollama&lt;/td&gt;
&lt;td&gt;0.40.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Llama-Windows&lt;/td&gt;
&lt;td&gt;0.13.0. Its engine is &lt;code&gt;llama.exe&lt;/code&gt; (llama.cpp b11706, as recorded at measurement time; CUDA aarch64 build)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context length&lt;/td&gt;
&lt;td&gt;262144 (same on both)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt&lt;/td&gt;
&lt;td&gt;A single Japanese prompt asking for a three-sentence explanation of the capital of Japan. Thinking mode left at its default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed metric&lt;/td&gt;
&lt;td&gt;Ollama: from &lt;code&gt;eval_count&lt;/code&gt; / &lt;code&gt;eval_duration&lt;/code&gt; in its API. &lt;code&gt;llama.exe&lt;/code&gt;: &lt;code&gt;timings.predicted_per_second&lt;/code&gt; from its server API (&lt;code&gt;/v1/chat/completions&lt;/code&gt;). Unit is tokens/sec, &lt;strong&gt;including the thinking tokens&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 1: with defaults, Llama-Windows was about 15% slower
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Ollama 0.40.7&lt;/th&gt;
&lt;th&gt;Llama-Windows 0.13.0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Generation speed (3 runs, tokens/sec)&lt;/td&gt;
&lt;td&gt;101.89 / 104.12 / 100.11&lt;/td&gt;
&lt;td&gt;87.97 / 86.19 / 85.70&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU utilization&lt;/td&gt;
&lt;td&gt;69–75%&lt;/td&gt;
&lt;td&gt;84–86%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same file, and Llama-Windows ran at about 85% of Ollama's speed. It also had &lt;em&gt;higher&lt;/em&gt; GPU utilization. Busier, yet slower.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ollama is llama.cpp inside, too
&lt;/h2&gt;

&lt;p&gt;Before blaming either engine, I checked what Ollama was actually running. Ollama 0.40.7 runs its bundled llama.cpp &lt;code&gt;llama-server&lt;/code&gt; on CUDA:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The log shows &lt;code&gt;using llama-server for model&lt;/code&gt;, and the RUNNER column in &lt;code&gt;ollama ps&lt;/code&gt; says &lt;code&gt;llamacpp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The GPU library is &lt;code&gt;ggml-cuda.dll&lt;/code&gt; from &lt;code&gt;cuda_v13&lt;/code&gt;. No Vulkan build is included.&lt;/li&gt;
&lt;li&gt;The bundled &lt;code&gt;llama-server&lt;/code&gt; commit was &lt;strong&gt;only 32 commits newer&lt;/strong&gt; than Llama-Windows' &lt;code&gt;llama.exe&lt;/code&gt; (b11706). I compared the commits printed by &lt;code&gt;--version&lt;/code&gt; using GitHub's compare view.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this was close to llama.cpp vs. llama.cpp. If there is a 15% gap, the settings are the first suspect, not the engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference 1: Ollama drafts ahead by default (MTP)
&lt;/h2&gt;

&lt;p&gt;Qwen3.6 has multi-token prediction (MTP) layers built into the model. They let the runtime guess upcoming tokens and verify them in one go: speculative decoding without a separate draft model.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ollama uses this by default.&lt;/strong&gt; &lt;code&gt;ollama show&lt;/code&gt; lists &lt;code&gt;draft_num_predict 2&lt;/code&gt; under Parameters, meaning it drafts 2 tokens ahead. Setting &lt;code&gt;draft_num_predict&lt;/code&gt; to 0 in the API &lt;code&gt;options&lt;/code&gt; turns it off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Llama-Windows app does not draft by default.&lt;/strong&gt; If you start &lt;code&gt;llama.exe&lt;/code&gt; yourself, &lt;code&gt;--spec-type draft-mtp --spec-draft-n-max 2&lt;/code&gt; gives you 2-token drafting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drafting costs about 1.5–2 GB of extra GPU memory and &lt;em&gt;lowers&lt;/em&gt; GPU utilization. That explains the "busier but slower" pattern in step 1: Llama-Windows was simply not drafting.&lt;/p&gt;

&lt;p&gt;When I aligned only the drafting, &lt;code&gt;llama.exe&lt;/code&gt; came out 7–8% faster than Ollama. That was my second conclusion, and it was also premature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference 2: the sampling defaults were different
&lt;/h2&gt;

&lt;p&gt;The sampling defaults did not match either:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Ollama (this model's defaults)&lt;/th&gt;
&lt;th&gt;Llama-Windows (llama.cpp defaults)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;temperature&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;top_k&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;min_p&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;presence_penalty&lt;/td&gt;
&lt;td&gt;1.5&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So I started the app's engine (&lt;code&gt;llama.exe&lt;/code&gt;) separately as a server and aligned both drafting and sampling. I used two sampling settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S1&lt;/strong&gt;: the model's recommended values, which are the same as Ollama's defaults: temperature 1.0, top_k 20, top_p 0.95, min_p 0, presence_penalty 1.5, repeat_penalty 1.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S2&lt;/strong&gt;: greedy decoding (temperature 0), which always picks the most likely token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Seed fixed at 42 for both.&lt;/li&gt;
&lt;li&gt;Values passed per request. I did not change the app's or Ollama's configuration files.&lt;/li&gt;
&lt;li&gt;Generation capped at 1024 tokens (&lt;code&gt;num_predict&lt;/code&gt; for Ollama, &lt;code&gt;max_tokens&lt;/code&gt; for &lt;code&gt;llama.exe&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;For each combination, one warm-up run discarded, then 5 measured runs. The engine not being measured was stopped.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Results (tokens/sec, mean of 5 runs; standard deviations 0.38–1.90):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Drafting&lt;/th&gt;
&lt;th&gt;Sampling&lt;/th&gt;
&lt;th&gt;Ollama 0.40.7&lt;/th&gt;
&lt;th&gt;llama.exe (b11706)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;S1 (recommended)&lt;/td&gt;
&lt;td&gt;81.45&lt;/td&gt;
&lt;td&gt;74.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;S2 (greedy)&lt;/td&gt;
&lt;td&gt;81.69&lt;/td&gt;
&lt;td&gt;80.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MTP, 2 tokens&lt;/td&gt;
&lt;td&gt;S1 (recommended)&lt;/td&gt;
&lt;td&gt;99.05&lt;/td&gt;
&lt;td&gt;97.30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MTP, 2 tokens&lt;/td&gt;
&lt;td&gt;S2 (greedy)&lt;/td&gt;
&lt;td&gt;104.04&lt;/td&gt;
&lt;td&gt;110.85&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MTP, 3 tokens&lt;/td&gt;
&lt;td&gt;S1 (recommended)&lt;/td&gt;
&lt;td&gt;97.17&lt;/td&gt;
&lt;td&gt;97.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MTP, 3 tokens&lt;/td&gt;
&lt;td&gt;S2 (greedy)&lt;/td&gt;
&lt;td&gt;101.31&lt;/td&gt;
&lt;td&gt;106.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;What I read from this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;With both drafting and sampling aligned, the two were about the same speed&lt;/strong&gt; (no drafting, greedy: 81.69 vs. 80.44).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The remaining difference was &lt;code&gt;presence_penalty&lt;/code&gt;.&lt;/strong&gt; At 1.5, only &lt;code&gt;llama.exe&lt;/code&gt; got about 7% slower (80.44 → 74.75). Ollama barely changed (81.69 at presence_penalty 0 → 81.45 at 1.5).&lt;/li&gt;
&lt;li&gt;Drafting 2 tokens sped both up by roughly 20–40% (Ollama 22–27%, &lt;code&gt;llama.exe&lt;/code&gt; 30–38%). With the recommended settings, &lt;code&gt;llama.exe&lt;/code&gt; made up for the &lt;code&gt;presence_penalty&lt;/code&gt; slowdown through drafting and ended up roughly level with Ollama.&lt;/li&gt;
&lt;li&gt;With greedy decoding and 2-token drafting, &lt;code&gt;llama.exe&lt;/code&gt; came out ahead (110.85 vs. 104.04). But the output text was different, and so was the draft acceptance rate (0.835 vs. 0.819), so &lt;strong&gt;I can't call that an engine difference.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 draft tokens were enough
&lt;/h2&gt;

&lt;p&gt;Going from 2 to 3 draft tokens was not faster in any of the four combinations (the same or slower). The draft acceptance rate was 0.71–0.84 with 2 tokens and 0.65–0.71 with 3. The third guess is harder to hit, which pulls down the overall acceptance rate.&lt;/p&gt;

&lt;p&gt;Before I fixed the seed, 3-token drafting swung between 103 and 113 tokens/sec, because each run generated a different text. With the seed fixed, all 5 runs produced the same number of tokens and the spread went away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update (2026-11-18): long prompts can be cut without an error
&lt;/h2&gt;

&lt;p&gt;A reader pointed out another Ollama default in the comments here: when a prompt is longer than num_ctx (the context length), Ollama drops the front part without an error and still returns 200. It reads less, so on long prompts Ollama can look faster than it really is.&lt;/p&gt;

&lt;p&gt;The comparison in this post used one short question, and both runners had the context length set to 262144, so this did not happen here. I still wanted to see it myself, so I measured it afterwards.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;HTTP&lt;/th&gt;
&lt;th&gt;Tokens read (prompt_eval_count)&lt;/th&gt;
&lt;th&gt;Passphrase at the start&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;num_ctx 4096&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;2,051 (7,695 sent)&lt;/td&gt;
&lt;td&gt;Not recalled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;num_ctx 4096, &lt;code&gt;"truncate": false&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;num_ctx 16384&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;7,695&lt;/td&gt;
&lt;td&gt;Recalled&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Ollama 0.40.10 with translategemma:4b (not the Qwen3.6 model from this post). The prompt had a passphrase at the very start, about 30,000 characters of filler, and at the end a question asking for the passphrase&lt;/li&gt;
&lt;li&gt;With num_ctx 4096, only 2,051 of the 7,695 tokens were read. Nothing in the response JSON showed that the prompt had been cut. The only sign was that &lt;code&gt;prompt_eval_count&lt;/code&gt; was smaller than what I sent&lt;/li&gt;
&lt;li&gt;The server log had a &lt;code&gt;truncating input prompt&lt;/code&gt; warning. That does not reach the client&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;"truncate": false&lt;/code&gt;, it stopped with a 400: &lt;code&gt;request (7695 tokens) exceeds the available context size (4096 tokens)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;I set num_ctx to 4096 myself. I did not test the default value in 0.40.10. I wanted to compare with upstream llama-server too, but upstream could not load the same model file, so there is no side-by-side&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When comparing speed with long prompts, also check that &lt;code&gt;prompt_eval_count&lt;/code&gt; matches what you sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I checked when installing Llama-Windows
&lt;/h2&gt;

&lt;p&gt;Llama-Windows fetches its inference engine separately from the app itself (an MSIX package). The app downloads &lt;code&gt;install.ps1&lt;/code&gt;, runs it in memory, and installs the &lt;code&gt;llama.exe&lt;/code&gt; build matching your GPU (here, the CUDA aarch64 build) from Hugging Face.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The MSIX is signed, and its hash matched the one listed in the release.&lt;/li&gt;
&lt;li&gt;The downloaded &lt;code&gt;llama.exe&lt;/code&gt; was not signed, and there was no hash check. It is just fetched over HTTPS.&lt;/li&gt;
&lt;li&gt;So I read &lt;code&gt;install.ps1&lt;/code&gt; before installing, and recorded the hash of &lt;code&gt;llama.exe&lt;/code&gt; afterwards.&lt;/li&gt;
&lt;li&gt;By default, the server listened on &lt;code&gt;127.0.0.1&lt;/code&gt; only.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I didn't measure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One prompt, one PC.&lt;/strong&gt; With long contexts or other models, the direction and size of the gap could change.&lt;/li&gt;
&lt;li&gt;Because the seed was fixed, the 5 runs are &lt;strong&gt;the same text repeated&lt;/strong&gt;. Variation from different outputs is not included.&lt;/li&gt;
&lt;li&gt;Even with greedy decoding, the two engines' outputs did not match. The thinking started the same, but the answer diverged partway, and the generated token counts ranged from 739 to 1024. Even the same engine produced different text with and without drafting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I have not investigated why &lt;code&gt;presence_penalty&lt;/code&gt; slows down only &lt;code&gt;llama.exe&lt;/code&gt;.&lt;/strong&gt; Ollama's bundled build is 32 commits newer, so it might be a change in between, or it might be a difference in how the engines are called. Those are candidates, not findings.&lt;/li&gt;
&lt;li&gt;I did not compare answer quality.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Ollama runs llama.cpp too. With the same GGUF, &lt;strong&gt;the speed gap came from default settings rather than the engine.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Two defaults differed: &lt;strong&gt;Ollama drafts 2 tokens ahead with MTP, and its sampling values (presence_penalty 1.5 and others) are different.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Aligned, the speeds were about the same; only &lt;code&gt;presence_penalty&lt;/code&gt; left a ~7% gap on the llama.cpp side. 2 draft tokens were enough.&lt;/li&gt;
&lt;li&gt;When comparing speeds, &lt;strong&gt;align drafting, sampling, seed, and generation length.&lt;/strong&gt; Leave any one of them out and a 10% gap is easy to get, sometimes pointing the wrong way.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All defaults above are &lt;strong&gt;as of the measured versions&lt;/strong&gt; (Ollama 0.40.7, Llama-Windows 0.13.0 with llama.cpp b11706). Newer versions may have changed them.&lt;/p&gt;

&lt;p&gt;Update note (Nov 2026): Ollama on this machine has since auto-updated from 0.40.7 to 0.40.10. All measurements above are from 0.40.7, and I have not re-checked whether the defaults changed in 0.40.10. Llama-Windows is still 0.13.0.&lt;/p&gt;

&lt;p&gt;Llama-Windows and llama.cpp are MIT-licensed (&lt;a href="https://github.com/ggml-org/Llama-Windows" rel="noopener noreferrer"&gt;ggml-org/Llama-Windows&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my Japanese-language series on the Surface Laptop Ultra (Windows on Arm with an NVIDIA GPU). Related articles on Zenn (Japanese):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://zenn.dev/maruhana/articles/surface-laptop-ultra-day1-arm-cuda" rel="noopener noreferrer"&gt;Initial setup: on Arm Windows, check whether each tool can use the GPU before installing it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zenn.dev/maruhana/articles/surface-comfyui-wsl2" rel="noopener noreferrer"&gt;Moving ComfyUI from Intel Arc to WSL2 on Arm: same requirements, different package versions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original of this article: &lt;a href="https://zenn.dev/maruhana/articles/surface-llama-windows-ollama-defaults" rel="noopener noreferrer"&gt;Ollama と Llama-Windows を同じ GGUF で比べたら、差はエンジンではなく既定の設定だった&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>ollama</category>
      <category>llamacpp</category>
    </item>
    <item>
      <title>Rokid Glasses Can Record 4 Microphone Channels, But Only If You Ask for Exactly 4</title>
      <dc:creator>maruhana</dc:creator>
      <pubDate>Sun, 08 Nov 2026 08:56:37 +0000</pubDate>
      <link>https://dev.to/maruhana/rokid-glasses-can-record-4-microphone-channels-but-only-if-you-ask-for-exactly-4-3106</link>
      <guid>https://dev.to/maruhana/rokid-glasses-can-record-4-microphone-channels-but-only-if-you-ask-for-exactly-4-3106</guid>
      <description>&lt;p&gt;&lt;em&gt;Measured on a real RV101: which channel carries your voice, which carry the room, and the claims I had to take back.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is an English adaptation of an article I originally published in Japanese on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/rokid-glasses-mic-4ch-audiosource" rel="noopener noreferrer"&gt;Rokid Glasses のマイクは 4ch で使える&lt;/a&gt;. The measurements and conclusions are mine; I used an AI tool to help translate and restructure the text, and I checked the numbers against the original.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Scope first
&lt;/h2&gt;

&lt;p&gt;This article is about recording audio &lt;strong&gt;on the glasses themselves&lt;/strong&gt;: an Android app running on the Rokid Glasses (RV101, YodaOS-Sprite / Android) and opening &lt;code&gt;AudioRecord&lt;/code&gt; directly. It is &lt;strong&gt;not&lt;/strong&gt; about the phone-side CXR-M SDK, which documents its own near-field / far-field / panoramic pickup modes. The two are easy to mix up; nothing below applies to the phone SDK.&lt;/p&gt;

&lt;p&gt;Everything here was measured on &lt;strong&gt;one unit&lt;/strong&gt;, on firmware &lt;strong&gt;1.25.012&lt;/strong&gt;. I later re-checked the structure on 1.25.015, 1.26.011, 1.27.009 and 1.28.016 (details at the end). Treat this as a measurement log of one device, not as a specification.&lt;/p&gt;

&lt;p&gt;A 50-second video summary (narration is synthetic, English captions available):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/rNTjbVXpoFQ" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An app on the glasses can get &lt;strong&gt;4 distinct microphone channels&lt;/strong&gt;, but only when it requests &lt;strong&gt;exactly 4&lt;/strong&gt;. With &lt;code&gt;MIC&lt;/code&gt;, asking for 1, 2, 3, 6 or 8 channels gives you copies of a single stream (plus zero-filled channels).&lt;/li&gt;
&lt;li&gt;What each of the 4 channels contains &lt;strong&gt;depends on the &lt;code&gt;AudioSource&lt;/code&gt;&lt;/strong&gt;. With &lt;code&gt;UNPROCESSED&lt;/code&gt;: a voice-heavy stream, a copy of it, and 2 room-sound streams. With &lt;code&gt;MIC&lt;/code&gt;: one processed stream that keeps your voice and suppresses the room, plus 3 room-sound streams.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;VOICE_RECOGNITION&lt;/code&gt; opens without error but returns &lt;strong&gt;all zeros&lt;/strong&gt; on this device, no matter how many channels you request.&lt;/li&gt;
&lt;li&gt;Opening a second &lt;code&gt;AudioRecord&lt;/code&gt; in the same app stops the first one (&lt;code&gt;read&lt;/code&gt; returns &lt;code&gt;-6&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Measure your own unit before relying on any of this.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Requesting 4 channels
&lt;/h2&gt;

&lt;p&gt;This started with a report I saw on X (paraphrased; the report counts channels from 1, while this article counts from ch0): "Rokid Glasses can record 4 channels", "channels 1 and 2 are the same data", "channels 3 and 4 are in phase", "channels 1 and 2 are DSP-processed", "maybe it's the pickup-mode switch in the translation app". That contradicted something I had written earlier in my series: that apps can use &lt;strong&gt;2&lt;/strong&gt; microphones.&lt;/p&gt;

&lt;p&gt;The reason for the contradiction was quick to find. My earlier claim was based on &lt;code&gt;getMicrophones()&lt;/code&gt; returning two built-in microphones with different hardware ids, and on logs from a session opened as a single channel (equivalent to &lt;code&gt;CHANNEL_IN_MONO&lt;/code&gt;). Every configuration I had tried was 1 or 2 channels. I had only asked for 2, so I only got 2. I never tried the configurations I hadn't asked for.&lt;/p&gt;

&lt;p&gt;You can't express 4 or more channels cleanly with position masks (&lt;code&gt;CHANNEL_IN_MONO&lt;/code&gt; / &lt;code&gt;CHANNEL_IN_STEREO&lt;/code&gt;). A channel &lt;strong&gt;index mask&lt;/strong&gt; lets you request the count directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AudioFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEncoding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AudioFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ENCODING_PCM_16BIT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSampleRate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;48000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setChannelIndexMask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// request exactly 4 channels&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two pitfalls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;AudioRecord.getMinBufferSize()&lt;/code&gt; does not accept an index mask. It only accepts the mono/stereo position masks and returns &lt;code&gt;ERROR_BAD_VALUE&lt;/code&gt; for anything else. Size the buffer yourself. My test app used half a second: &lt;code&gt;ch × rate × 2 / 2&lt;/code&gt; bytes.&lt;/li&gt;
&lt;li&gt;If you compute the recording size in milliseconds as &lt;code&gt;ch × rate × 2 × ms&lt;/code&gt;, then 48 kHz × 8 ch × 3,000 ms overflows &lt;code&gt;int&lt;/code&gt; and the app crashes with &lt;code&gt;NegativeArraySizeException&lt;/code&gt;. In my first sweep, 48 kHz / 8 ch was the only configuration that crashed, for this reason. Use &lt;code&gt;long&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tested by brute force: &lt;strong&gt;4 sources × 2 sample rates × 6 channel counts&lt;/strong&gt; (&lt;code&gt;MIC&lt;/code&gt; / &lt;code&gt;UNPROCESSED&lt;/code&gt; / &lt;code&gt;VOICE_RECOGNITION&lt;/code&gt; / &lt;code&gt;CAMCORDER&lt;/code&gt;, 16 kHz / 48 kHz, 1/2/3/4/6/8 channels). Each configuration was opened in turn, recorded for 3 seconds, and saved with the configuration in the file name. Checking whether a configuration &lt;em&gt;opens&lt;/em&gt; is not enough: some configurations initialize successfully and then return all zeros, so I read the data and computed the RMS of every channel. The test app is called &lt;code&gt;jp.example.micprobe&lt;/code&gt; here as an example name.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What the sweep showed
&lt;/h2&gt;

&lt;p&gt;RMS per channel in dBFS, quiet room, 48 kHz, 4 channels requested:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;4ch&lt;/th&gt;
&lt;th&gt;ch0 / ch1 / ch2 / ch3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MIC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;−91.4&lt;/strong&gt; / −74.4 / −73.2 / −75.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UNPROCESSED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;−84.3 / −84.3 / −83.6 / −83.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CAMCORDER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;−86.5&lt;/strong&gt; / −72.8 / −72.0 / −73.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VOICE_RECOGNITION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;opens, but&lt;/td&gt;
&lt;td&gt;zero / zero / zero / zero&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With &lt;code&gt;MIC&lt;/code&gt; and &lt;code&gt;CAMCORDER&lt;/code&gt;, only ch0 is 14–17 dB lower; with &lt;code&gt;UNPROCESSED&lt;/code&gt; all four are level. &lt;code&gt;VOICE_RECOGNITION&lt;/code&gt; stays all-zero however many channels you request. If you record from your own app on this device, use &lt;code&gt;MIC&lt;/code&gt; or &lt;code&gt;UNPROCESSED&lt;/code&gt;. (The built-in features open the microphones a different way; see section 9.)&lt;/p&gt;

&lt;p&gt;The important part: &lt;strong&gt;you only get 4 real channels when you request exactly 4.&lt;/strong&gt; Counting how many &lt;em&gt;distinct&lt;/em&gt; streams actually come back for each requested channel count (8 ch measured at 16 kHz, the rest at 48 kHz; &lt;code&gt;CAMCORDER&lt;/code&gt; behaves like &lt;code&gt;MIC&lt;/code&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requested&lt;/th&gt;
&lt;th&gt;Non-zero channels&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;MIC&lt;/code&gt;: distinct streams&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;UNPROCESSED&lt;/code&gt;: distinct streams&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 ch&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 ch&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1 (duplicate of the same data)&lt;/td&gt;
&lt;td&gt;2 (separate; content not checked)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 ch&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1 (+1 zero)&lt;/td&gt;
&lt;td&gt;2 (+1 zero)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4 ch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;4&lt;/strong&gt; (the only case with 4)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;3&lt;/strong&gt; (ch0 = copy of ch1, + 2)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6 ch&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1 (+4 zero)&lt;/td&gt;
&lt;td&gt;2 (+4 zero)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8 ch&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1 (+6 zero)&lt;/td&gt;
&lt;td&gt;2 (+6 zero)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With &lt;code&gt;MIC&lt;/code&gt; at 2 channels, &lt;code&gt;ch0 == ch1&lt;/code&gt; is a bit-exact match (correlation +1.0000, lag 0): the same single stream in two slots. In other words, &lt;strong&gt;the number of microphones returned by &lt;code&gt;getMicrophones()&lt;/code&gt; is not a cap on the channel count.&lt;/strong&gt; With &lt;code&gt;MIC&lt;/code&gt; and &lt;code&gt;CAMCORDER&lt;/code&gt;, you cannot get the room-side streams unless you request exactly 4. With &lt;code&gt;UNPROCESSED&lt;/code&gt;, 2 channels already gives two different streams, but I did not check whether those two are voice-side or room-side.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Sine tones: what is ch0?
&lt;/h2&gt;

&lt;p&gt;I played 500 / 1000 / 2000 / 4000 Hz tones from a PC speaker, recorded 4 channels, and measured the phase difference and amplitude ratio between channels from the FFT. (Why a PC speaker and not the glasses' own speaker: see section 10.)&lt;/p&gt;

&lt;p&gt;Amplitude of ch0, relative to the channel that picked up each frequency best:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Frequency&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;MIC&lt;/code&gt; ch0&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;UNPROCESSED&lt;/code&gt; ch0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;500 Hz&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−98.2 dB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−7.3 dB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1000 Hz&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−98.1 dB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−2.4 dB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2000 Hz&lt;/td&gt;
&lt;td&gt;−28.8 dB&lt;/td&gt;
&lt;td&gt;−6.1 dB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4000 Hz&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−72.1 dB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−4.2 dB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same microphones, same sound, same 4-channel request. &lt;strong&gt;Changing only the &lt;code&gt;AudioSource&lt;/code&gt; changes ch0 by more than 90 dB at most.&lt;/strong&gt; The &lt;code&gt;MIC&lt;/code&gt; / &lt;code&gt;CAMCORDER&lt;/code&gt; ch0 is a DSP-processed channel (which is also why it produces stretches of exact digital zero in a quiet room).&lt;/p&gt;

&lt;p&gt;ch1–ch3, on the other hand, line up in phase even though the two sources were recorded separately. The phase difference of ch3, expressed as a distance:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Frequency&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;MIC&lt;/code&gt; ch3&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;UNPROCESSED&lt;/code&gt; ch3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2000 Hz&lt;/td&gt;
&lt;td&gt;−42.3 mm&lt;/td&gt;
&lt;td&gt;−42.6 mm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4000 Hz&lt;/td&gt;
&lt;td&gt;−30.5 mm&lt;/td&gt;
&lt;td&gt;−30.6 mm&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So ch1–ch3 carry the same microphone signals under both sources; only ch0 is swapped. With &lt;code&gt;UNPROCESSED&lt;/code&gt;, the amplitude ratio and phase of &lt;strong&gt;ch0 and ch1 matched to the decimal at every frequency&lt;/strong&gt;, consistent with the bit-exact match. &lt;strong&gt;With &lt;code&gt;UNPROCESSED&lt;/code&gt;, the slot that holds the processed stream under &lt;code&gt;MIC&lt;/code&gt; holds a copy of ch1 instead.&lt;/strong&gt; (Whether that ch1 is truly unprocessed, I did not verify; see section 5.)&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Wearing the glasses and talking
&lt;/h2&gt;

&lt;p&gt;Next I wore the glasses and recorded 4 channels for 60 seconds: silent for the first 28 seconds, talking for the last 30. No speaker playback, just my own voice.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;ch0&lt;/th&gt;
&lt;th&gt;ch1&lt;/th&gt;
&lt;th&gt;ch2&lt;/th&gt;
&lt;th&gt;ch3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;MIC&lt;/code&gt; silent&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−104&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−77.6&lt;/td&gt;
&lt;td&gt;−77.3&lt;/td&gt;
&lt;td&gt;−77.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;MIC&lt;/code&gt; talking&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−33&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−46.5&lt;/td&gt;
&lt;td&gt;−45.1&lt;/td&gt;
&lt;td&gt;−43.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;MIC&lt;/code&gt; rise&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+71 dB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+31&lt;/td&gt;
&lt;td&gt;+32&lt;/td&gt;
&lt;td&gt;+34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;UNPROC&lt;/code&gt; silent&lt;/td&gt;
&lt;td&gt;−83.7&lt;/td&gt;
&lt;td&gt;−83.7&lt;/td&gt;
&lt;td&gt;−83.1&lt;/td&gt;
&lt;td&gt;−82.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;UNPROC&lt;/code&gt; talking&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−40&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−40&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−53&lt;/td&gt;
&lt;td&gt;−52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;UNPROC&lt;/code&gt; rise&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+44 dB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+44&lt;/td&gt;
&lt;td&gt;+30&lt;/td&gt;
&lt;td&gt;+31&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Only &lt;code&gt;MIC&lt;/code&gt; ch0 flips position: about 27 dB &lt;em&gt;below&lt;/em&gt; the others when I'm silent, 10–13 dB &lt;em&gt;above&lt;/em&gt; them when I talk. Comparing the rise, the contrast between voice and room sound improves by about 40 dB.&lt;/p&gt;

&lt;p&gt;Correlation coefficients during speech show what each slot holds:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;ch0-ch1&lt;/th&gt;
&lt;th&gt;ch1-ch2&lt;/th&gt;
&lt;th&gt;ch1-ch3&lt;/th&gt;
&lt;th&gt;ch2-ch3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UNPROCESSED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+1.000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+0.436&lt;/td&gt;
&lt;td&gt;+0.469&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.981&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MIC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.109&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.990&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.954&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+0.979&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Under &lt;code&gt;UNPROCESSED&lt;/code&gt;, the voice-side pair (ch0 = ch1) correlates with the room-side channels at about 0.44. Under &lt;code&gt;MIC&lt;/code&gt;, ch1 correlates with ch2/ch3 at 0.95–0.99. Same "4 channels", different meaning per slot depending on the &lt;code&gt;AudioSource&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UNPROCESSED : ch0 = ch1 = voice-side (bit-identical copy)   ch2, ch3 = room-side (2)
MIC         : ch0 = processed (uncorrelated with all)        ch1, ch2, ch3 = room-side (3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcispi5hgw6m0w5gvaq4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcispi5hgw6m0w5gvaq4m.png" alt="What goes into each of the four channel slots under UNPROCESSED and under MIC" width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure (labels in Japanese): the four slots ch0–ch3 for each source. UNPROCESSED: ch0 and ch1 hold the same voice-side data (ch1 is a copy of ch0), ch2 and ch3 hold room sound. MIC: ch0 holds the voice-side stream with suppression applied, ch1–ch3 hold room sound. "Voice-side" and "room-side" are my labels.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note on the labels:&lt;/strong&gt; "voice-side" and "room-side" are my own names. They do &lt;strong&gt;not&lt;/strong&gt; describe a confirmed physical microphone layout. As the next sections explain, I could not determine the physical layout.&lt;/p&gt;

&lt;p&gt;When I first saw this, I started writing "the hardware is 1 voice mic + 3 room mics". That goes too far. A correlation of 0.99 can come from separate physical elements or from the same element with different processing, and the number of room-side streams doesn't even agree between sources (2 under &lt;code&gt;UNPROCESSED&lt;/code&gt;, 3 under &lt;code&gt;MIC&lt;/code&gt;). What I can say is: &lt;strong&gt;under &lt;code&gt;MIC&lt;/code&gt;, the 4 channels are one processed stream plus three mutually distinct streams.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Spectral ratio, and the explanation I withdrew
&lt;/h2&gt;

&lt;p&gt;I computed the spectral ratio of the voice-side channel (ch0) to a room-side channel (ch2), separately for speech and silence. Values in dB:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Band&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;UNPROC&lt;/code&gt; speech&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;UNPROC&lt;/code&gt; silence&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;MIC&lt;/code&gt; speech&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;MIC&lt;/code&gt; silence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;100–300 Hz&lt;/td&gt;
&lt;td&gt;+12.8&lt;/td&gt;
&lt;td&gt;−0.6&lt;/td&gt;
&lt;td&gt;+12.0&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−24.0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;600–1200 Hz&lt;/td&gt;
&lt;td&gt;+11.9&lt;/td&gt;
&lt;td&gt;−0.4&lt;/td&gt;
&lt;td&gt;+11.9&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−20.5&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2400–4800 Hz&lt;/td&gt;
&lt;td&gt;+12.1&lt;/td&gt;
&lt;td&gt;−0.6&lt;/td&gt;
&lt;td&gt;+11.7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−16.4&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4800–9600 Hz&lt;/td&gt;
&lt;td&gt;+11.3&lt;/td&gt;
&lt;td&gt;+0.3&lt;/td&gt;
&lt;td&gt;+11.7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−15.9&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp6hih37nss7a0sje7yjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp6hih37nss7a0sje7yjj.png" alt="Level difference between ch0 and ch2 per frequency band" width="799" height="413"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure (labels in Japanese): bar chart of the ch0 ÷ ch2 level difference per band. During speech, both UNPROCESSED and MIC are about +12 dB across all bands. During silence, UNPROCESSED is about 0 dB and MIC is about −18 to −25 dB. The chart was recomputed from raw data and differs from the table by a few dB.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The ch0–ch2 delay during speech was also essentially zero across bands (split into three bands from 300 to 8000 Hz, all within 1 cm). Three things can be read from this: in silence, all bands are within ±1 dB (ch0 is as sensitive to the room as the room-side channels); during speech, a flat +12 dB across all bands (no frequency dependence, so neither a low-frequency-heavy bone-conduction path nor a high-frequency-heavy acoustic horn); and zero delay.&lt;/p&gt;

&lt;p&gt;At this point I once wrote: "the +12 dB comes from physics (directional placement), so a dedicated mouth-facing microphone physically exists." &lt;strong&gt;I withdrew that.&lt;/strong&gt; The same observations can be explained by beamforming output synthesized from 8 channels: a directional synthesis also boosts only the nearby voice, averages out room sound, and shows no delay if everything is time-aligned within one stream. And the guarantee that &lt;code&gt;UNPROCESSED&lt;/code&gt; is truly unprocessed is Android's intent, not something I verified this ROM honors. So I cannot tell whether the +12 dB comes from physical placement or from synthesis.&lt;/p&gt;

&lt;p&gt;What I &lt;em&gt;can&lt;/em&gt; say is limited to this: &lt;strong&gt;what &lt;code&gt;MIC&lt;/code&gt; adds is suppression&lt;/strong&gt; (it drops ch0 by 16–24 dB during silence). The +12 dB voice emphasis is already present under &lt;code&gt;UNPROCESSED&lt;/code&gt;. Combined, the per-band level difference gives about 32 dB of contrast improvement. (The "about 40 dB" in section 4 comes from the RMS rise, a different calculation.)&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Other hypotheses I withdrew, and what survived
&lt;/h2&gt;

&lt;p&gt;To estimate the physical layout, I went as far as chirps (200→8000 Hz sweeps ×3), ESS impulse responses, and direct-sound detection (first point above 35% of the peak). The values changed from measurement to measurement (ch0–ch3 went from −26.7 mm to +70.3 mm). Reverberation dominates, and a single sine or chirp can't give you the physical layout. &lt;strong&gt;Withdrawn.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the same reason, I withdrew "ch2 and ch3 have different frequency responses" (the 4–8 kHz difference changed from −4.1 dB to +0.6 dB, which room position explains). The X report's "channels 1 and 3 have different acoustic characteristics / channels 3 and 4 are the same" (counted from 1) is something my measurements could neither confirm nor rule out.&lt;/p&gt;

&lt;p&gt;The only thing that survived is &lt;code&gt;ch0 == ch1&lt;/code&gt;. It reproduces every time at &lt;strong&gt;+0.00 samples, spread 0.00&lt;/strong&gt;. It's data identity, not acoustics, so the room doesn't affect it.&lt;/p&gt;
&lt;h2&gt;
  
  
  7. Physical vs. synthesized can't be decided from outside
&lt;/h2&gt;

&lt;p&gt;On reflection, this was never a measurement-technique problem. &lt;strong&gt;A physical directional microphone and linear beamforming are both linear, time-invariant, and direction-dependent.&lt;/strong&gt; A linearity test (vary the input level and check whether the ratio stays constant) can tell you whether non-linear processing (suppression, AGC) is present, but it cannot separate "a single directional element" from "a linear synthesis".&lt;/p&gt;

&lt;p&gt;There is weak circumstantial evidence. Beamforming usually loses directivity at low frequencies, where the wavelength is longer than the element spacing. Yet the measured boost is +12.8 dB even at 100–300 Hz and flat from 100 Hz to 9.6 kHz. That leans toward a single directional element, but adaptive beamforming can create directivity at low frequencies too, so it is not decisive. I'm closing this line of inquiry here.&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Opening two recordings in one app: the later one wins
&lt;/h2&gt;

&lt;p&gt;While trying to separate these, I opened &lt;code&gt;MIC&lt;/code&gt; and &lt;code&gt;UNPROCESSED&lt;/code&gt; at the same time in the same app. The result was symmetric:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open MIC first          -&amp;gt; MIC returns -6 on read and stops; UNPROCESSED is used
Open UNPROCESSED first  -&amp;gt; UNPROCESSED returns -6 and stops; MIC is used
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-6&lt;/code&gt; is &lt;code&gt;ERROR_DEAD_OBJECT&lt;/code&gt;. Both sessions report &lt;code&gt;STATE_INITIALIZED&lt;/code&gt;, but opening the second one stops the first.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;a different situation&lt;/strong&gt; from another thing I checked: my recording kept running while the built-in AI assistant was active (worn, one A/B trial each way). That was coexistence &lt;strong&gt;across processes&lt;/strong&gt; with a system service (uid 1000). This section is about &lt;strong&gt;two recordings inside your own app&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. The official apps open 8 channels
&lt;/h2&gt;

&lt;p&gt;I switched the pickup scenes in the translation feature (Hi Rokid) and looked at how the recording session was opened, via the &lt;code&gt;openAudioRecord2&lt;/code&gt; log line. Its &lt;code&gt;mode&lt;/code&gt; changes per scene:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pickup scene&lt;/th&gt;
&lt;th&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;channelMask&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;denoiseMode&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lecture / movie&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0x6000fc&lt;/code&gt; (8 channels)&lt;/td&gt;
&lt;td&gt;−1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Face-to-face conversation&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0x6000fc&lt;/code&gt; (8 channels)&lt;/td&gt;
&lt;td&gt;−1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phone audio&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0x10&lt;/code&gt; (1 channel, &lt;code&gt;inputSource 500&lt;/code&gt;) *&lt;/td&gt;
&lt;td&gt;−1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;(reference) Built-in AI&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0x6000fc&lt;/code&gt; (8 channels)&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;* The phone-audio row was measured on firmware 1.27.009 (same in all 4 trials). On 1.25.012 it was &lt;code&gt;0x6000fc&lt;/code&gt; (8 channels).&lt;/p&gt;

&lt;p&gt;For the scenes that use the microphones (lecture/movie, face-to-face) and for the built-in AI, &lt;code&gt;channelMask&lt;/code&gt; is &lt;code&gt;0x6000fc&lt;/code&gt; (8 bits set), and switching scenes does not change the channel count; only &lt;code&gt;mode&lt;/code&gt; changes. The &lt;code&gt;intent&lt;/code&gt; is &lt;code&gt;trans_ali&lt;/code&gt; for translation and &lt;code&gt;AI_assistant&lt;/code&gt; for the built-in AI. Only the built-in AI uses suppression (&lt;code&gt;denoiseMode 2&lt;/code&gt;). On 1.27.009, the phone-audio scene (translating audio playing on the phone) did not use the glasses' microphones; it opened 1 channel from an input that is not a standard &lt;code&gt;AudioSource&lt;/code&gt; (&lt;code&gt;inputSource 500&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;What is observation and what is not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inference:&lt;/strong&gt; that &lt;code&gt;mode&lt;/code&gt; corresponds to the pickup scene. The log doesn't say what &lt;code&gt;mode&lt;/code&gt; means.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inference:&lt;/strong&gt; that &lt;code&gt;inputSource 500&lt;/code&gt; is audio coming from the phone. I did not check what &lt;code&gt;500&lt;/code&gt; is.&lt;/li&gt;
&lt;li&gt;I captured each scene &lt;strong&gt;only once&lt;/strong&gt;; reproducibility is unconfirmed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Capture notes: &lt;code&gt;openAudioRecord2&lt;/code&gt; is logged only once, when a recording session starts, so you have to &lt;strong&gt;reopen&lt;/strong&gt; the translation feature (clearing the log while it's open shows nothing). Translation does not appear in &lt;code&gt;dumpsys audio&lt;/code&gt;. A scene change made on the phone sometimes doesn't reach the glasses immediately (check the indicator at the bottom of the display).&lt;/p&gt;

&lt;p&gt;So, when the built-in translation and AI assistant use the microphones, they handle 8 channels through their own way of opening the device. From an app, the most I could get as separate streams was 4.&lt;/p&gt;

&lt;p&gt;This ties back to section 7: since the built-in AI uses 8 channels, it is if anything &lt;em&gt;more&lt;/em&gt; plausible that the 4 channels an app receives are synthesized from those 8. That is exactly why "physical or synthesized" is hard to decide from outside.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Measurement traps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Don't rely on synchronization.&lt;/strong&gt; The recording start and playback start were measured 4 seconds apart. Make the analysis side search for where the tone is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't &lt;code&gt;adb pull&lt;/code&gt; before the recording finishes.&lt;/strong&gt; You'll grab the previous file. I nearly drew a wrong conclusion this way once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sound played from the glasses' own speaker does not reach the recording.&lt;/strong&gt; I assume the echo canceller (AEC) removes it, but I have no direct evidence. Using a PC speaker as the sound source turned out to be necessary, not just convenient.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  11. If you're implementing this
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;If you want the room-side streams reliably, request exactly 4 channels.&lt;/strong&gt; Under &lt;code&gt;MIC&lt;/code&gt; / &lt;code&gt;CAMCORDER&lt;/code&gt;, 1/2/3/6/8 channels collapse to copies of one stream. Under &lt;code&gt;UNPROCESSED&lt;/code&gt;, 2/3/6/8 channels give two separate streams, but I haven't checked what they contain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;AudioSource&lt;/code&gt; changes what each channel means.&lt;/strong&gt; For just your own voice, &lt;code&gt;MIC&lt;/code&gt; ch0 (processed). For room sound, &lt;code&gt;UNPROCESSED&lt;/code&gt; ch2/ch3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open one recording at a time per app.&lt;/strong&gt; Opening a second one stops the first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Above all, measure your own unit before relying on this.&lt;/strong&gt; Source/channel assignments can change with firmware and model, and every number here comes from one device on the firmware of the time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Firmware notes
&lt;/h2&gt;

&lt;p&gt;All measurements in the body were taken on my unit on firmware &lt;strong&gt;1.25.012&lt;/strong&gt;, and results may differ in your environment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1.25.015:&lt;/strong&gt; re-ran only the sweep. The structure was unchanged: 4 distinct streams only with a 4-channel request, &lt;code&gt;ch0 == ch1&lt;/code&gt;, &lt;code&gt;VOICE_RECOGNITION&lt;/code&gt; all zero. (Absolute RMS values move with room noise, so the numbers above are from the original measurement.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1.26.011:&lt;/strong&gt; checked only that &lt;code&gt;VOICE_RECOGNITION&lt;/code&gt; is still all zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1.27.009 and 1.28.016:&lt;/strong&gt; the 4-channel slot layout, the number of streams per requested channel count, and the two-recordings behavior were the same. Room-dependent values such as ch0 during silence differed by several to a dozen-plus dB. Only the phone-audio row in section 9 changed, on 1.27.009, so that table shows the 1.27.009 value. On 1.28.016 I did not measure the talk/silence comparison (section 4) or how the official apps open the microphones (section 9).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About this series
&lt;/h2&gt;

&lt;p&gt;This is part of my Japanese-language series on building my own apps for the Rokid Glasses (RV101): setup, a conversation-support app, input handling, and audio. The original article and the rest of the series are on Zenn: &lt;a href="https://zenn.dev/maruhana/articles/rokid-glasses-mic-4ch-audiosource" rel="noopener noreferrer"&gt;Rokid Glasses のマイクは 4ch で使える（original, Japanese）&lt;/a&gt;. There is also a free Zenn book (Japanese) that walks through getting your own app running on the RV101 from scratch: &lt;a href="https://zenn.dev/maruhana/books/rokid-glasses-rv101-app-from-zero" rel="noopener noreferrer"&gt;Rokid Glasses（RV101）を買ってから、自分のアプリが動くまで&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>android</category>
      <category>java</category>
      <category>audio</category>
      <category>smartglasses</category>
    </item>
  </channel>
</rss>
