<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raymond Ng, MH on Medium]]></title>
        <description><![CDATA[Stories by Raymond Ng, MH on Medium]]></description>
        <link>https://medium.com/@rnmanhon?source=rss-1dcdd4b7032c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ytckR5tOZXPyNqtPHmKyTQ.jpeg</url>
            <title>Stories by Raymond Ng, MH on Medium</title>
            <link>https://medium.com/@rnmanhon?source=rss-1dcdd4b7032c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:50:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rnmanhon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fail-Closed Storage for Docker: Running Production Services on a Removable USB Disk]]></title>
            <link>https://medium.com/@rnmanhon/fail-closed-storage-for-docker-running-production-services-on-a-removable-usb-disk-4d8cd8fff1f1?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d8cd8fff1f1</guid>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[site-reliability]]></category>
            <category><![CDATA[fault-tolerance]]></category>
            <category><![CDATA[usb-drives]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 06:24:20 GMT</pubDate>
            <atom:updated>2026-11-19T07:51:05.413Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How to run production Docker services on a removable disk without ever writing to the wrong one: systemd mount binding, startup preflight checks, and a guard that stops containers when the disk disappears. Tested by pulling the cable.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3ORij66jeMPA2mImyjSpQ.jpeg" /></figure><p><em>Our home Docker host’s SSD was nearly full, and a big USB disk is the cheap fix. Copying the data is the easy part. This is the pattern we built so that a production Docker service handles the disk disappearing: stop cleanly, write nothing anywhere else, tell a human, wait. It is generic, so each further service we move needs only a few lines of configuration.</em></p><p>Our home Docker host runs a dozen small services, and their data had nearly filled the internal SSD. Much of that data is large and regenerable: caches, downloaded models, generated media. That is the ideal thing to move to a big bus-powered USB disk.</p><p>The first service we moved is a self-hosted read-aloud app. It keeps every sentence it has spoken as a WAV file, so it never synthesizes the same text twice. Losing that cache costs time (clips are regenerated as people read), not data. More services will follow, so we wanted an approach we could reuse, not a one-off.</p><p>Copying the files is the easy part. The hard part is that <strong>USB disks disappear</strong>: a cable gets knocked, a power dip resets the enclosure, the kernel autosuspends the port. What happens to your containers then depends on defaults you have probably never looked at, and most of those defaults are wrong for this case.</p><p><strong>Short answer:</strong> by default, a Docker stack whose data disk vanishes does not stop. Docker quietly creates an empty folder where the disk used to be, on the SSD, and the app carries on writing into it. We built nine small layers so that a lost disk instead <strong>stops exactly the containers that use it, writes nothing anywhere else, tells a human, and waits</strong> for someone to check the disk. Then we pulled the cable while a container was writing once a second. Everything stopped in the same second, only the in-flight second of data was lost, and e2fsck replayed the journal cleanly. Moving a production service then takes only a couple of minutes of downtime, because the long copy happens while it keeps running.</p><p>The complete implementation (host installer, guard, preflight, Compose and fstab examples) is on GitHub: <a href="https://github.com/rnmanhon/docker-usb-fail-closed"><strong>docker-usb-fail-closed</strong></a>. The snippets below are excerpts.</p><h3>What goes wrong by default</h3><p>Three defaults combine badly:</p><ol><li><strong>Docker recreates missing bind sources.</strong> With the usual short syntax (- /mnt/data/cache:/data/cache), if /mnt/data/cache does not exist, Docker creates it. If the disk is not mounted, /mnt/data is just an empty directory on your SSD, so Docker creates cache there and your app starts with an empty cache on the wrong disk.</li><li><strong>restart: unless-stopped starts containers behind your back.</strong> Even if you guard your startup script, the Docker daemon itself restarts those containers at boot, before and around any check you wrote.</li><li><strong>Nobody is told.</strong> If the disk drops while the stack runs, the app gets I/O errors, logs them, and keeps going. Nothing reaches a person.</li></ol><h3>The rule: fail closed, never fall back, recover by hand</h3><p>We decided up front what “safe” means:</p><ul><li><strong>Only regenerable data moves.</strong> The database, uploads and backups stay on the SSD. Losing the USB disk must never cost anything that cannot be rebuilt.</li><li><strong>A short outage is fine. Writing to the wrong place is not.</strong> No fallback to a fresh empty folder, ever.</li><li><strong>Nothing restarts on its own after a loss.</strong> The disk may be damaged; a human checks it first.</li></ul><p>Each layer below closes one specific gap.</p><h3>The layers</h3><h3>1. ext4, not the factory exFAT</h3><p>The disk came formatted exFAT, which has no Unix owners or permissions. Container data needs both, so we reformatted it ext4 with no reserved blocks (mkfs.ext4 -m 0): it is a data-only disk.</p><h3>2. An fstab entry that tolerates absence</h3><pre>UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/project-data ext4 defaults,nofail,errors=remount-ro,x-systemd.device-timeout=10s,x-systemd.device-bound 0 2</pre><ul><li><strong>By UUID</strong>, never /dev/sdX: USB device names change between boots.</li><li><strong>nofail and a 10-second device timeout</strong>: the host boots normally without the disk; only the mount fails.</li><li><strong>x-systemd.device-bound</strong>: the systemd mount unit stops by itself when the device disappears. This is the hook everything else hangs on.</li><li><strong>errors=remount-ro</strong>: ext4 corruption becomes a read-only filesystem instead of continued writes.</li><li><strong>No automount</strong>: we want the mount state to be explicit and easy to check.</li></ul><h3>3. Make the empty mountpoint immutable</h3><pre>sudo chattr +i /mnt/project-data    # on the EMPTY directory, before the first mount</pre><p>This is the cheapest layer and maybe the most effective. While the disk is unmounted, /mnt/project-data is an ordinary directory on the SSD, and chattr +i makes it impossible to create anything inside it. Not Docker, not a script, not root by accident. It does not affect the mounted disk at all.</p><p>One trap: you can only see the flag while the disk is <em>un</em>mounted. With the disk mounted, lsattr -d /mnt/project-data shows the disk&#39;s own root directory instead.</p><h3>4. Compose: never create a missing source</h3><pre>volumes:<br>  - type: bind<br>    source: ${APP_CACHE_DIR:-${HOME}/app-data/cache}<br>    target: /data/cache<br>    bind:<br>      create_host_path: false</pre><p>The long bind syntax with create_host_path: false makes Docker refuse to start the container when the folder is missing, instead of creating it. The path comes from a per-machine setting with the old location as the default, so the same Compose file still works on our other machine, which has no USB disk.</p><h3>5. The trap: restart: unless-stopped</h3><p>This is the layer we nearly skipped. Our production stack is started by a systemd unit, and we were about to add a storage check to that unit. But the containers had restart: unless-stopped, which means the Docker daemon restarts them by itself at boot, without ever running our unit&#39;s check. After an unclean shutdown with the disk missing, the daemon would have brought half the app back up.</p><p>The fix is to give the stack one lifecycle owner. On the machine with the USB disk, every service in the stack gets restart: &quot;no&quot; (through a variable that defaults to unless-stopped elsewhere), and only the systemd unit starts it.</p><p>The cost is real: a container that crashes stays down until the stack is restarted. For a regenerable-cache app at home, we accept that.</p><h3>6. A systemd drop-in that binds the stack to the mount</h3><pre># /etc/systemd/system/&lt;stack&gt;.service.d/10-required-mounts.conf<br>[Unit]<br>RequiresMountsFor=/mnt/project-data<br>BindsTo=mnt-project\x2ddata.mount<br>After=mnt-project\x2ddata.mount</pre><pre>[Service]<br>RestartPreventExitStatus=78</pre><p>BindsTo plus After means: when the mount unit stops (the device vanished, thanks to x-systemd.device-bound), systemd stops this unit first, and its stop command runs docker compose down for the whole stack. mnt-project\x2ddata.mount is just systemd&#39;s name for /mnt/project-data: / becomes -, so a real dash is escaped as \x2d (systemd-escape --path --suffix=mount /mnt/project-data prints it).</p><p>Before docker compose up, the unit runs a preflight check, which exits 78 on failure:</p><ul><li>the fstab’s UUID is what is actually mounted at that path (the wrong disk is rejected);</li><li>it is mounted read/write;</li><li>every bind source of the resolved Compose project that lives on the disk exists, really is on that filesystem (no symlink or nested mount leading elsewhere), and is writable.</li></ul><p>It discovers those sources itself from docker compose config --format json, so no project has to list its paths. RestartPreventExitStatus=78 stops a failed check from looping through the unit&#39;s Restart=on-failure every 10 seconds.</p><h3>7. A catch-all guard for everything else</h3><p>Development stacks and one-off docker run containers have no systemd unit. For those, one host-level unit is bound to the mount the same way. Its start does nothing; its stop step finds every running container with a bind source on the disk and stops it:</p><pre>docker ps -q | xargs docker inspect --format &#39;{{.Name}}{{range .Mounts}} {{.Source}}{{end}}&#39;<br># -&gt; stop every container with a source at or under /mnt/project-data</pre><p>Every Docker call in it is time-bounded, and its failure cannot block the unmount.</p><h3>8. Telling a human</h3><p>This surprised us. A BindsTo stop counts as a normal, clean stop, not a failure, so OnFailure= never fires. Without extra work, a disk loss shows up only in the journal.</p><p>So the guard’s stop step sends a wall message to every open terminal, saying whether the disk was <em>disconnected</em> (its UUID vanished from /dev/disk/by-uuid) or just unmounted. A small script also prints a red warning in every new shell while the disk is missing or read-only.</p><p>Second surprise: we first installed that script in /etc/profile.d/, the usual place. GNOME Terminal opens <strong>non-login</strong> shells, which never read /etc/profile.d/. It needs a line in /etc/bash.bashrc too. The script reads only /etc/fstab and /proc/self/mountinfo, so it cannot hang a new shell on a dead disk.</p><h3>9. Small things</h3><ul><li>A udev rule turns off USB autosuspend for this one disk, matched by serial number.</li><li>The app already wrote each clip to a temp file and renamed it into place, so a reader never sees half a clip. We added a sweep for temp files that a lost disk left behind.</li></ul><h3>All the ways to start it without the disk</h3><p>Put together, every route that could start the service while the disk is missing ends at a layer that stops it:</p><figure><img alt="Flowchart of four ways to start a service without the disk. Boot or starting the stack’s systemd unit: if the disk is not mounted, the unit fails as a dependency while the host boots normally; if the preflight fails (wrong disk, read-only, sources missing), it exits 78 with no restart loop; only if both pass does docker compose up run. The Docker daemon starting old containers at boot: restart “no” leaves nothing to start. A Compose helper script: if a bind source is on an unmounted disk it refu" src="https://cdn-images-1.medium.com/max/1024/1*wGkABJ3T3KjqB2jdyFZM5g.png" /><figcaption><em>Figure 1. Every path that could start a service without its disk, and the layer that stops it.</em></figcaption></figure><h3>Pulling the cable</h3><p>We tested on the empty disk first, so a mistake could not cost anything. A throwaway container wrote the time to a file every second, calling sync after each line.</p><p><strong>Soft test first:</strong> sudo systemctl stop on the mount unit. The guard stopped the container, wall said &quot;unmounted&quot;, and a new terminal showed the red warning. With the disk unmounted, touch and mkdir under the mountpoint failed with &quot;Operation not permitted&quot;, and docker run -v with a path there was refused. Nothing appeared on the SSD.</p><p><strong>Then the real thing:</strong> we pulled the USB cable. The journal shows everything inside one second, in this order:</p><figure><img alt="Sequence diagram of the cable pull. 1: the kernel reports a USB disconnect to the mount unit, which stops itself because of x-systemd.device-bound. 2: it stops the stack’s systemd unit, which 3: runs docker compose down for the whole stack. 4: it stops the catch-all guard, which 5: stops every container with a bind source on the disk and 6: sends a wall message “disk DISCONNECTED” to the human. 7: the filesystem is unmounted; every new shell shows a red warning and nothing restarts on its own. 8" src="https://cdn-images-1.medium.com/max/1024/1*0CJOZr6_5GjGb9KwTEzHoQ.png" /><figcaption><em>Figure 2. What happens when the disk is unplugged while services are running.</em></figcaption></figure><ol><li>Kernel: USB disconnect, then a few lost async page write errors and Aborting journal: the container was mid-write.</li><li>systemd stopped the guard <strong>before</strong> unmounting (BindsTo + After order). The guard stopped the container and sent &quot;the disk DISCONNECTED&quot;.</li><li>systemd unmounted the filesystem.</li></ol><p>After reconnecting, the disk did <strong>not</strong> mount by itself, which is what we wanted. e2fsck -p printed recovering journal and then clean. The last line in the test file was from <strong>one second before</strong> the pull: only the in-flight second was lost.</p><p>Later, with the real development stack on the disk, the same soft test stopped exactly one container, the backend that holds the cache, and left the rest running. Restarting it with docker start failed, as it should: the old container still pointed at the dead mount instance. Recovery means recreating containers, never restarting old ones.</p><h3>Moving a service’s data</h3><p>The same procedure works for each service we move:</p><figure><img alt="Flowchart of moving one service’s data in three phases. While the service runs: step 1, the long rsync copy to the disk; step 2, time it including the final sync. Short downtime: step 3, stop the service and run a catch-up copy with — delete; step 4, compare counts, bytes and owners; step 5, set the per-machine settings (new path, restart “no”, opt-in) and reinstall the unit. Service running again: start through the preflight; step 6, check the bind source, restart policy, old and new data; a ch" src="https://cdn-images-1.medium.com/max/1024/1*Appl1nR1nmCVkj-ngPEANA.png" /><figcaption><em>Figure 3. Moving a service’s data to the disk with minimal downtime.</em></figcaption></figure><ol><li><strong>Copy while the service runs.</strong> rsync -aHAX --numeric-ids from the old folder to its new place under the disk. This takes the time; the service keeps serving.</li><li><strong>Measure the disk honestly.</strong> Our disk is an SMR drive (shingled magnetic recording), which can slow down on long writes, so we timed a smaller copy first. Time the final sync too: rsync finishes while gigabytes may still be waiting in RAM, so its own speed figure is optimistic.</li><li><strong>Stop the service</strong>, then run the copy again with --delete, aimed only at the verified destination folder. It moves just what changed since step 1.</li><li><strong>Verify.</strong> Compare file counts, total bytes and owners. For a full check against the disk rather than RAM, drop the copied files from the page cache first (posix_fadvise(..., POSIX_FADV_DONTNEED) per file, no root needed), then compare checksums with rsync -anc. The old copy is frozen once the service has stopped, so this can also run after the restart: only files the service writes afterwards show up.</li><li><strong>Switch the service over</strong> with its per-machine settings: the new data path, restart: &quot;no&quot;, and the opt-in that installs the systemd drop-in. Reinstall the unit, then start it through the preflight.</li><li><strong>Check</strong> the bind source with docker inspect, the restart policies, that old data reads and new data lands on the disk, and that the unit is bound to the mount.</li><li><strong>Delete the old copy</strong> once the check has passed. For regenerable data, that is enough; the app can always rebuild anything we missed.</li></ol><h3>Mistakes we nearly made</h3><ul><li><strong>A “convenience” symlink at the old path.</strong> Linking ~/app-data/cache to the USB disk looks harmless. But Compose then binds the link&#39;s path, and every guard that matches paths under /mnt/project-data sees nothing. We made the preflight follow symlinks anyway, and put a differently named shortcut in $HOME for browsing.</li><li><strong>Putting the per-machine switch in </strong><strong>~/.bashrc.</strong> systemd never reads it, so the guard would have been off exactly at boot. The settings live in each project&#39;s own .env on that machine; machines without the disk simply leave the lines out.</li><li><strong>Trusting </strong><strong>Restart=on-failure on a oneshot Compose unit as supervision.</strong> It only retries the up command. It does not watch the containers afterwards.</li><li><strong>docker compose up --force-recreate is not all-or-nothing.</strong> In our rehearsal, with the disk unmounted, it recreated the database and three other services, then failed on the backend&#39;s missing folder and stopped, leaving the stack half torn down. Our Compose helper scripts now run a check first: if any bind source lies under an fstab mount that is not mounted, they refuse before touching anything. On machines without such disks the check does nothing.</li></ul><h3>Limits</h3><ul><li><strong>Surprise unplugging still loses in-flight writes.</strong> These layers limit the damage to what was being written in that second; they cannot make pulling the cable safe.</li><li><strong>A disk that turns read-only or returns I/O errors without disappearing does not stop anything.</strong> The next start is refused, but a running stack keeps failing writes until someone looks.</li><li><strong>With </strong><strong>restart: &quot;no&quot;, a crashed container stays down</strong> until the stack is restarted.</li><li><strong>Raw </strong><strong>docker compose commands bypass the preflight.</strong> create_host_path: false and the immutable mountpoint still prevent writes to the wrong disk, but a half-recreated stack is possible.</li><li><strong>Proven on one host and one disk so far.</strong> The guards are generic (nothing in them names an app), and each further service only adds its own settings, but every new service should still get its own rehearsal.</li></ul><h3>Checklist</h3><ol><li>Move only data you can regenerate, and rehearse each service on its development copy first.</li><li>ext4 by UUID in fstab: nofail,x-systemd.device-timeout=10s,x-systemd.device-bound,errors=remount-ro.</li><li>chattr +i on the empty mountpoint before the first mount.</li><li>Compose long bind syntax with create_host_path: false.</li><li>restart: &quot;no&quot; for services on the disk, and one owner (systemd) that starts them.</li><li>A drop-in with RequiresMountsFor, BindsTo and After on the mount unit, plus a preflight that checks the UUID, read/write and the bind sources.</li><li>A catch-all guard that stops any container using the disk when the mount stops.</li><li>Tell a human: wall, plus a shell warning installed in /etc/bash.bashrc as well as /etc/profile.d/.</li><li>USB autosuspend off for that disk.</li><li>Pull the cable once, on an empty disk, before you trust any of it.</li></ol><h3>Get the code</h3><p>Everything above, ready to install, is in <a href="https://github.com/rnmanhon/docker-usb-fail-closed"><strong>docker-usb-fail-closed</strong></a>: host/install.sh --mount /mnt/your-disk installs the guard, the shell warning and (optionally) the USB power rule; stack/storage-preflight.sh and the drop-in example guard each stack; tools/dc-storage-check protects your own helper scripts. Its README walks through install, testing and recovery.</p><h3>How we tested</h3><p><strong>Host.</strong> Ubuntu 24.04 (aarch64), systemd 255, Docker Engine with Compose v2, internal NVMe SSD.</p><p><strong>Disk.</strong> A 6 TB bus-powered USB 3 disk (an SMR drive), reformatted ext4 -m 0, plugged directly into a rear port, no hub.</p><p><strong>Loss tests.</strong> A soft unmount (systemctl stop of the mount unit) and one real cable pull, each with a throwaway Alpine container appending a timestamp to a file on the disk every second and calling sync. Times are from the systemd journal and the kernel log. Then the same soft test with the real development stack on the disk.</p><p><strong>Copies.</strong> rsync -aHAX --numeric-ids, a rehearsal on the development data first, then production with the procedure above. Verification: file counts, total bytes and owners compared, then the copy was evicted from the page cache and compared by checksum with rsync -anc.</p><p><strong>Other machine.</strong> The same repositories were checked on a second machine without the USB disk: configuration resolves to the old paths, every check is a silent no-op, and its services restarted unchanged.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d8cd8fff1f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serving Qwen3-ASR: llama.cpp vs vLLM on an NVIDIA GB10]]></title>
            <link>https://medium.com/@rnmanhon/serving-qwen3-asr-llama-cpp-vs-vllm-on-an-nvidia-gb10-1d90f85277a8?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d90f85277a8</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[llama-cpp]]></category>
            <category><![CDATA[cantonese]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 00:44:43 GMT</pubDate>
            <atom:updated>2026-11-10T00:44:43.501Z</atom:updated>
            <content:encoded><![CDATA[<p><em>For a shared Cantonese speech-recognition server, llama.cpp’s 8-bit model made fewer errors than vLLM, answered faster, handled more requests at once in our tests, and used a fraction of the GPU memory.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbQ6HB533aNYMfUaTYUNrg.jpeg" /></figure><p>In our <a href="https://medium.com/@rnmanhon/qwen3-asr-vs-whisper-for-cantonese-accuracy-and-speed-on-gpu-and-cpu-be63776ea243">first article</a>, Qwen3-ASR made about half as many errors as Whisper large-v3 on 500 Cantonese clips. We served it with <a href="https://github.com/vllm-project/vllm">vLLM</a>, the usual choice for serving models to several users. In the <a href="https://medium.com/@rnmanhon/cantonese-speech-recognition-on-a-windows-pc-nvidia-an-unsupported-amd-card-and-the-cpu-907904d02fca">second</a>, <a href="https://github.com/ggml-org/llama.cpp">llama.cpp</a> ran the same model on a Windows PC, about three times faster than PyTorch.</p><p>That raised a question for our own setup. We run one speech server on an NVIDIA GB10 that several of our apps share. Should it be vLLM or llama.cpp?</p><p><strong>Short answer, on our machine and our clips:</strong></p><ul><li><strong>Accuracy:</strong> llama.cpp’s 8-bit model made <strong>6.6%</strong> character errors on 500 clips; vLLM with the full BF16 model made <strong>7.1%</strong>.</li><li><strong>One request at a time:</strong> llama.cpp answered in <strong>0.24 seconds</strong> (median); vLLM in 0.42.</li><li><strong>Several at once:</strong> with four requests in flight, llama.cpp served <strong>11.1 clips per second</strong>; vLLM 9.2.</li><li><strong>Memory:</strong> llama.cpp used <strong>4 to 7 GB</strong> of GPU memory; vLLM reserved about <strong>24 GB</strong>, as we had configured it.</li><li><strong>Start-up:</strong> llama.cpp was ready in <strong>14 seconds</strong>, vLLM in about 2 minutes.</li></ul><p>We switched our shared server to llama.cpp. Below is what we measured, and where the comparison is not as even as that list makes it sound.</p><h3>What we compared</h3><ul><li><strong>The machine:</strong> an NVIDIA GB10, whose ARM CPU and Blackwell GPU share 128 GB of memory.</li><li><strong>The model:</strong> <a href="https://huggingface.co/Qwen/Qwen3-ASR-1.7B">Qwen3-ASR-1.7B</a>.</li><li><strong>vLLM 0.29.0</strong>, serving the original BF16 weights, with the settings from our first article:</li></ul><pre>vllm serve Qwen/Qwen3-ASR-1.7B --served-model-name qwen3-asr \<br>  --gpu-memory-utilization 0.20 --max-model-len 8192 --max-num-seqs 4</pre><ul><li><strong>llama.cpp’s </strong><strong>llama-server</strong>, build b12211, from the official CUDA container image, serving the 8-bit (Q8_0) file from <a href="https://huggingface.co/ggml-org/Qwen3-ASR-1.7B-GGUF">ggml-org/Qwen3-ASR-1.7B-GGUF</a>. -np sets how many requests it handles at once (its &quot;slots&quot;); -c is the context they share:</li></ul><pre>llama-server -m Qwen3-ASR-1.7B-Q8_0.gguf --mmproj mmproj-Qwen3-ASR-1.7B-Q8_0.gguf \<br>  --alias qwen3-asr -ngl 99 -np 4 -c 16384 --host 0.0.0.0 --port 8000</pre><p>Both speak the same OpenAI-style /v1/audio/transcriptions API, so the same client and the same scoring work for both.</p><ul><li><strong>Accuracy:</strong> all 500 clips of our first article’s sample from <a href="https://huggingface.co/datasets/ASLP-lab/WSYue-ASR-eval">WSYue-ASR-eval</a>, scored the same way.</li><li><strong>Speed under load:</strong> 120 of those clips (10 minutes of audio), sent 1, 2, 4 and 8 at a time.</li></ul><h3>Accuracy: 8-bit didn’t hurt</h3><figure><img alt="Character error rate on 500 Cantonese clips: llama.cpp 8-bit on the GPU 6.58%, llama.cpp 8-bit on the CPU 6.63%, Transformers BF16 6.56%, vLLM BF16 7.10%." src="https://cdn-images-1.medium.com/max/1024/1*sABWE1S7L0ZIEeV5ylJ9gA.png" /></figure><p>We expected the 8-bit model to lose a little accuracy. It didn’t: llama.cpp’s 8-bit file made <strong>6.58%</strong> character errors on the GPU and 6.63% on the CPU, against 6.56% for the full model through Transformers, Hugging Face’s own Python library. vLLM, also with the full model, made <strong>7.10%</strong>, mostly from more substituted characters.</p><p>We don’t know why vLLM came out half a point worse with the same weights; differences in audio preprocessing between the two serving stacks are one possibility. All three kept about 97% of written-Cantonese characters such as 嘅, 咗 and 喺, so none of them drifted into standard written Chinese.</p><h3>Speed: faster alone, and faster together</h3><figure><img alt="Clips per second against requests in flight: vLLM 2.1, 4.7, 9.2 and 10.3 at 1, 2, 4 and 8 requests; llama.cpp with 4 slots 2.9, 6.3, 11.1 and 13.2; llama.cpp with 8 slots 2.8, 9.1 at 4 and 16.1 at 8." src="https://cdn-images-1.medium.com/max/1024/1*y9VjoJYuWuQLGUKbB_Awhw.png" /></figure><p><strong>One request at a time</strong>, llama.cpp took a median of <strong>0.27 seconds</strong> per clip in this test and vLLM 0.44 (0.24 and 0.42 in the 500-clip run). For a single user, that is the difference between a line appearing at once and a short pause.</p><p><strong>Several requests at once</strong>, both got faster in total, because each serves requests side by side:</p><ul><li>With <strong>4 in flight</strong>, llama.cpp with 4 slots served <strong>11.1 clips per second</strong>, vLLM 9.2. Each request still took about a third of a second with llama.cpp and 0.39 with vLLM.</li><li>With <strong>8 in flight</strong>, llama.cpp with 8 slots served <strong>16.1 clips per second</strong>, vLLM 10.3. But this comparison is unfair to vLLM: we had set it to run at most 4 requests at once (--max-num-seqs 4), so the other 4 waited. We haven&#39;t yet re-run vLLM with 8.</li><li>More slots aren’t free for llama.cpp: with 8 slots it was slower at 4 in flight (9.1 clips per second) than with 4 slots. Set -np to the load you expect.</li></ul><h3>Memory: the biggest difference</h3><ul><li><strong>llama.cpp</strong> used <strong>4.2 GB</strong> of GPU memory with 4 slots and <strong>6.5 GB</strong> with 8 (the model files are 2.5 GB). With one slot it used 3.6 GB on the Windows graphics cards in our previous article.</li><li><strong>vLLM</strong> reserved about <strong>24 GB</strong>: 20% of the GB10’s memory, because we told it to (--gpu-memory-utilization 0.20). vLLM reserves memory up front for its cache. It would probably run in less, and we haven&#39;t measured the smallest setting that keeps its speed.</li></ul><p>On a GB10 with 128 GB, 24 GB is affordable. On a 16 or 24 GB graphics card that you’d like to share with other models, it decides whether the speech server fits at all.</p><p>Two smaller practical differences:</p><ul><li><strong>Start-up:</strong> from starting the container to answering requests, llama-server took <strong>14 seconds</strong> and vLLM about <strong>2 minutes</strong> (125 seconds, the same on a second start). vLLM spends a minute of that capturing CUDA graphs, which is what makes it fast later. Both had the model files already in the operating system’s cache.</li><li><strong>Install:</strong> llama.cpp’s official CUDA image is 4.2 GB. Our vLLM image, built for the GB10’s ARM CPU and CUDA 13, was 16 GB.</li></ul><h3>Quirks to handle with llama.cpp</h3><p>llama.cpp’s support for Qwen3-ASR is recent, and it serves the model a little more “raw” than vLLM does:</p><ul><li><strong>WAV only.</strong> llama-server decodes WAV, MP3 and FLAC, not the WebM or MP4 a browser records. Convert first.</li><li><strong>A prefix on every reply.</strong> Replies start with the model’s own language Cantonese&lt;asr_text&gt; tag, which vLLM removes. Strip it. It&#39;s also useful: it tells you what language the model thought it heard.</li><li><strong>Send the language.</strong> Without it, 54 of 500 fragments of 0.8 seconds were guessed as Malay, Thai, English, Korean or others. With language=yue, the fragments we re-checked came back as Cantonese.</li><li><strong>Silence and hiss.</strong> Given 1.5 seconds of silence or quiet hiss, it sometimes answered 「粤语。」 (the language’s name), 「嗯。」, or its own instruction, “Transcribe audio to text.” Skip near-silent clips before sending them, and drop those replies.</li><li><strong>Pin the version.</strong> We pinned build b12211 and the model file’s revision, and we re-run the 500 clips before changing either.</li></ul><h3>What we’d recommend</h3><ul><li><strong>For one or a few users,</strong> llama.cpp with the 8-bit model and -np set to the number of requests you expect at once. It is smaller, starts faster, answers faster and was at least as accurate.</li><li><strong>On a CPU,</strong> llama.cpp too: 0.93 seconds per clip on the GB10’s CPU, against 3.1 for PyTorch, with the same accuracy.</li><li><strong>vLLM</strong> is still worth testing if you expect many requests at once. It is built for heavy batching, and we didn’t push it past 8 requests or tune it for this test.</li></ul><h3>What this doesn’t show</h3><ul><li><strong>One machine.</strong> The GB10’s CPU and GPU share memory; a separate graphics card may favour either engine differently.</li><li><strong>Up to 8 requests at once,</strong> with vLLM capped at 4. Heavier load is untested.</li><li><strong>Different precision.</strong> vLLM ran the full BF16 model and llama.cpp an 8-bit file. llama.cpp with BF16 was slower than its 8-bit file (0.49 against 0.24 seconds per clip) but still about as fast as vLLM.</li><li><strong>Short clips.</strong> Speech recognition writes 20 to 40 tokens per clip, so these results say little about chat models.</li><li><strong>vLLM’s memory</strong> at a smaller reservation.</li></ul><h3>Reproduce it</h3><p>The <a href="https://github.com/rnmanhon/qwen3-asr-vs-whisper-cantonese">benchmark repository</a> from our first article covers both servers:</p><pre>python benchmark.py prepare --data data --n 500<br>python benchmark.py qwen --data data --url http://127.0.0.1:8000 --wav --name llama_cuda_q8_0<br>python benchmark.py score --data data<br>python benchmark.py perf --data data --engine qwen --url http://127.0.0.1:8000 --wav --tag llama_np4 --concurrency 1 2 4 8</pre><p>--wav converts the clips for llama-server and strips its prefix; leave it out for vLLM. Download WSYue-ASR-eval yourself and accept its licence; no audio is included.</p><p><em>Measured in November 2026 on an NVIDIA GB10.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d90f85277a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cantonese Speech Recognition on a Windows PC: NVIDIA, an “Unsupported” AMD Card, and the CPU]]></title>
            <link>https://medium.com/@rnmanhon/cantonese-speech-recognition-on-a-windows-pc-nvidia-an-unsupported-amd-card-and-the-cpu-907904d02fca?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/907904d02fca</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[amd]]></category>
            <category><![CDATA[cantonese]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 08:29:40 GMT</pubDate>
            <atom:updated>2026-11-09T13:38:25.840Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Qwen3-ASR ran on an 8 GB Radeon that ROCm doesn’t support, as fast as on our NVIDIA GB10, through llama.cpp and Vulkan. On the same NVIDIA card, and on the CPU alone, llama.cpp was about three times faster than PyTorch.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8hNUVbpbWX08lRPhidixA.jpeg" /></figure><p>In our <a href="https://medium.com/@rnmanhon/qwen3-asr-vs-whisper-for-cantonese-accuracy-and-speed-on-gpu-and-cpu-be63776ea243">previous article</a>, Qwen3-ASR made about half as many errors as Whisper large-v3 on 500 Cantonese clips, on an NVIDIA GB10. The GB10 is an unusual machine, though. Most people who might run speech recognition at home have an ordinary desktop PC with Windows, and often no NVIDIA card at all.</p><p>So we took one such PC and asked three questions:</p><ol><li>How fast is Qwen3-ASR on a <strong>mid-range NVIDIA card</strong> under Windows?</li><li>Can an <strong>AMD card</strong> run it at all, when AMD’s own GPU software (ROCm) doesn’t support that card?</li><li>How slow is the <strong>CPU</strong> alone, on a processor without the BF16 instructions that made the GB10’s CPU usable?</li></ol><p><strong>Short answer:</strong></p><ul><li><strong>AMD: yes, and fast.</strong> Through <a href="https://github.com/ggml-org/llama.cpp">llama.cpp</a>’s Vulkan build, a 2019 Radeon RX 5700 (8 GB) transcribed a clip in <strong>0.33 seconds</strong> (median), about as fast as the GB10, with the same accuracy, using 3.6 GB of video memory.</li><li><strong>NVIDIA:</strong> an RTX A2000 took <strong>1.11 seconds</strong> per clip with PyTorch inside Docker, but only <strong>0.30 seconds</strong> with llama.cpp on the same card.</li><li><strong>CPU only:</strong> an 8-core Ryzen 7 3700X took <strong>9.4 seconds</strong> per clip with PyTorch, about two and a half times the length of the speech. llama.cpp’s 8-bit model took <strong>3.0 seconds</strong>, 0.7 times the length of the speech, using a quarter of the memory. Fine for dictation, still too slow for live captions.</li><li><strong>Accuracy did not change</strong> with the hardware: the PyTorch runs gave the same text on every device, and llama.cpp differed by about one character in 500.</li></ul><h3>The PC and what we ran</h3><ul><li><strong>CPU:</strong> AMD Ryzen 7 3700X, 8 cores, 64 GB of RAM. Its Zen 2 cores have <strong>no BF16 instructions</strong>.</li><li><strong>GPUs, one at a time in the same PC:</strong> NVIDIA RTX A2000 12 GB, then AMD Radeon RX 5700 8 GB.</li><li><strong>Windows 11 24H2</strong>, with Docker Desktop 4.95 using WSL2 (Windows’ built-in Linux virtual machine).</li></ul><p>We used the same model as before, <a href="https://huggingface.co/Qwen/Qwen3-ASR-1.7B">Qwen3-ASR-1.7B</a>, in two ways:</p><ul><li><strong>PyTorch (Transformers)</strong>, the Python route, inside Docker on WSL2. This needs an NVIDIA card (CUDA) for the GPU, or runs on the CPU.</li><li><strong>llama.cpp’s </strong><strong>llama-server</strong>, build b12211, running natively on Windows with its <strong>Vulkan</strong> backend, which works on AMD, Intel and NVIDIA cards alike. It used the GGUF files from <a href="https://huggingface.co/ggml-org/Qwen3-ASR-1.7B-GGUF">ggml-org/Qwen3-ASR-1.7B-GGUF</a>, in BF16 and in 8-bit (Q8_0). For the CPU we also ran llama.cpp’s CPU build, in Docker and natively.</li></ul><p>The test was the first 30 clips of the previous article’s sample, from the <a href="https://huggingface.co/datasets/ASLP-lab/WSYue-ASR-eval">WSYue-ASR-eval</a> benchmark: 142.7 seconds of Cantonese in clips of 2 to 11 seconds. Clips were sent one at a time, after one warm-up request.</p><h3>The results</h3><figure><img alt="Median seconds per clip on the GPU: RTX A2000 with llama.cpp Q8_0 0.30 s; RX 5700 with llama.cpp Q8_0 0.33 s; RTX A2000 with llama.cpp BF16 0.40 s; RX 5700 with llama.cpp BF16 0.56 s; RTX A2000 with PyTorch BF16 1.11 s; GB10 with PyTorch BF16 0.40 s for reference." src="https://cdn-images-1.medium.com/max/1024/1*U6RtQgZgRwsG-ft8kl8EnQ.png" /></figure><figure><img alt="Full results table: for each device and runtime, median and 95th-percentile seconds per clip, time divided by audio length, character error rate on the 30 clips, and video memory. llama.cpp on both cards 0.30 to 0.56 s and 6.58% CER; PyTorch on the A2000 1.11 s; the Ryzen CPU with llama.cpp 2.96 s in Q8_0 and 4.58 s in BF16, with PyTorch 9.36 s in FP32 and 11.22 s in BF16; GB10 references 0.40 s on the GPU and 3.11 s on the CPU, all PyTorch rows 6.38% CER." src="https://cdn-images-1.medium.com/max/1024/1*YSy6nMqU0WJk_nkkAg1X2Q.png" /></figure><h3>An AMD card that ROCm doesn’t support</h3><p>AMD’s answer to NVIDIA’s CUDA is ROCm. Under WSL2, ROCm supports only the newest Radeon generations (RX 7000 and 9000). The RX 5700 isn’t supported by ROCm at all. For PyTorch, that card might as well not exist.</p><p>Vulkan is different: it is a general graphics and compute interface that almost every GPU driver supports. llama.cpp can run models through it, and it supports Qwen3-ASR’s audio input and the same /v1/audio/transcriptions endpoint as other speech servers.</p><p>On the RX 5700, the 8-bit model took <strong>0.33 seconds per clip</strong>: 8% of the audio’s length, slightly better than the GB10 managed overall. In BF16 it took 0.56 seconds. The card has no BF16 arithmetic, which is one more reason to use the 8-bit file there.</p><p><strong>Memory is the thing to watch.</strong> The 8-bit model used <strong>3.6 GB</strong> of video memory, and BF16 used 5.4 GB. On an 8 GB card that also drives the Windows desktop, BF16 left the card at 7.75 of 8 GB, too tight for comfort. With Q8_0 the whole card sat at 5.7 GB. <strong>An 8 GB card is enough with the 8-bit model.</strong></p><p>It also has room for more than one user. With four slots (-np 4 -c 16384), the RX 5700 served <strong>6.1 clips per second</strong> with four requests in flight, against 2.6 one at a time, for 0.9 GB more video memory (4.4 GB). Two requests at once took no longer each than one alone.</p><p>One setting matters: start llama-server with <strong>-c 8192 -np 1</strong>. Without them, it sizes its context window to fill the card and takes nearly all the video memory, though a clip of speech needs only a few hundred tokens.</p><pre>llama-server -m Qwen3-ASR-1.7B-Q8_0.gguf --mmproj mmproj-Qwen3-ASR-1.7B-Q8_0.gguf ^<br>  --alias qwen3-asr -ngl 99 -c 8192 -np 1 --host 127.0.0.1 --port 8090</pre><p>Four details if you call it from your own code:</p><ul><li>llama-server reads only WAV, MP3 and FLAC, so convert other formats (such as the WebM or MP4 a browser records) to WAV first.</li><li>Its replies start with the model’s raw language Cantonese&lt;asr_text&gt; prefix, which other servers remove. Strip it before showing the text.</li><li><strong>Send the language</strong> (language=yue in the request). Without it, short fragments of Cantonese, such as the first 0.8 seconds of a sentence, were often guessed as another language: 54 of 500 came back as Malay, Thai, English, Korean and others. With it, the fragments we re-checked came back as Cantonese.</li><li><strong>Check the loudness before sending.</strong> Given very quiet hiss (about −54 dBFS, a quiet room), the model sometimes answers with its own instruction, “Transcribe audio to text.”, even with the language set. We skip clips whose loudest 100 ms is below −45 dBFS, and drop that reply if it still appears.</li></ul><h3>On the same NVIDIA card, llama.cpp was about three times faster</h3><p>We expected the RTX A2000 to be the comfortable option, and with PyTorch it was fine: <strong>1.11 seconds</strong> per clip, about 30% of the audio’s length. But llama.cpp on the same card took <strong>0.40 seconds in BF16 and 0.30 seconds in 8-bit</strong>, 2.8 to 3.7 times faster, matching the GB10.</p><p>Be careful with what this comparison shows. The PyTorch runs were inside Docker on WSL2, and llama.cpp ran natively on Windows, so it compares two whole setups, not just two runtimes.</p><p>The obvious suspect is WSL2. In an <a href="https://medium.com/@rnmanhon/same-pc-same-gpu-a-small-cuda-sync-took-68-%C2%B5s-on-windows-and-15-%C2%B5s-on-linux-74a4b4a930fb">earlier article</a> we found that a tiny GPU synchronisation took 68 µs on native Windows and about 110 µs under WSL2 on this PC, against 15 µs on Linux. Inside Docker on WSL2 it took about <strong>150 µs</strong> this time. But speech recognition writes only 20 to 40 tokens for a short clip, so that adds a few milliseconds, not most of a second. Whatever the reason, it isn’t that.</p><p>Docker Desktop itself cost almost nothing: PyTorch inside Docker Desktop and inside a plain Docker install in WSL2 were within 10% of each other (1.11 and 1.21 seconds).</p><h3>The CPU alone: llama.cpp made it usable</h3><p>Without a usable GPU, PyTorch on the Ryzen 7 3700X took a median of <strong>9.4 seconds</strong> per clip in FP32. That is 2.5 times the audio’s length, so a five-second sentence comes back about 12 seconds later.</p><p>llama.cpp’s CPU build with the 8-bit model took <strong>2.96 seconds</strong>, 3.2 times faster, at 0.71 times the audio’s length: a five-second sentence comes back in about 3.5 seconds. It used <strong>1.8 GB</strong> of memory against about 7 GB for PyTorch, with the same accuracy as llama.cpp on the GPUs. That is comfortable for dictation, one sentence at a time, though still not fast enough for live captions while someone speaks.</p><p>What mattered on the CPU:</p><ul><li><strong>Threads: one per physical core.</strong> With llama.cpp, 8 threads were fastest; 4 were 12% slower, and 16 (counting each core’s second hardware thread) were <strong>2.8 times slower</strong> (8.3 seconds). Don’t default to the number of logical processors.</li><li><strong>The 8-bit model, not BF16.</strong> llama.cpp’s BF16 file took 4.58 seconds on this CPU without BF16 instructions, 55% slower than 8-bit, though still twice as fast as PyTorch.</li><li><strong>Docker cost nothing.</strong> llama.cpp in Docker Desktop (2.96 seconds) and natively on Windows (2.99 seconds) were the same.</li><li>With PyTorch, BF16 without BF16 hardware was only 20% slower than FP32 (11.2 seconds), and four threads were about as fast as eight (10.1 against 9.9 seconds in a repeat run).</li></ul><p>For comparison, the GB10’s ARM CPU, which does have BF16 instructions, took 3.1 seconds per clip with PyTorch on the same clips.</p><h3>Accuracy didn’t change</h3><p>Hardware should change speed, not words, and it mostly didn’t:</p><ul><li><strong>PyTorch gave identical transcripts</strong> on the A2000, the Ryzen CPU and both GB10 processors: 30 of 30 clips, character for character.</li><li><strong>llama.cpp’s transcripts differed in places</strong>, with a character, an extra particle such as 啦, or punctuation. 25 of 30 were identical after normalising punctuation and script.</li><li>Character error rate on the 30 clips: <strong>6.38% for PyTorch and 6.58% for llama.cpp</strong>, on both cards, on the CPU, and in both BF16 and 8-bit. That is one character in 517.</li></ul><p>Thirty clips is a small sample. It can show that llama.cpp and 8-bit weights didn’t make accuracy noticeably worse; it can’t rank them precisely. The 500-clip accuracy from the previous article (7.1% character error rate) was measured with vLLM on the GB10.</p><h3>What we would recommend</h3><ul><li><strong>NVIDIA card:</strong> either route works. If speed matters, try llama.cpp; it was much faster on our card.</li><li><strong>AMD or Intel card, including ones ROCm doesn’t support:</strong> llama.cpp’s Vulkan build with the 8-bit model and -c 8192 -np 1. An 8 GB card is enough.</li><li><strong>No usable GPU:</strong> llama.cpp’s CPU build with the 8-bit model and one thread per physical core. Expect about three seconds per sentence. Design for the wait: for example, have the user hold a button while speaking and show that the text is on its way.</li></ul><h3>How we tested</h3><ul><li><strong>Clips:</strong> the first 30 clips of the 500-clip sample from our previous article (WSYue-ASR-eval <em>Short</em>, revision 0f0596e, random seed 42), re-encoded as webm/opus like a browser recording. For llama.cpp they were converted to 16 kHz WAV, as an application would (before timing here; the public script&#39;s --wav converts inside the timer, adding about 10 ms).</li><li><strong>Timing:</strong> wall time per request, one request at a time, after one warm-up request. PyTorch timings include decoding the audio; llama.cpp timings include the HTTP round trip.</li><li><strong>Accuracy:</strong> character error rate against the dataset’s labels, normalised as in the previous article (converted to Simplified characters, numerals as Chinese numerals, punctuation removed).</li><li><strong>Software:</strong> Transformers 5.18.0 with PyTorch 2.13.0 (CUDA 13 build) in Docker Desktop 4.95 on WSL2; llama.cpp b12211 (llama-b12211-bin-win-vulkan-x64 on the GPUs; on the CPU the ghcr.io/ggml-org/llama.cpp:server-b12211 image in Docker Desktop and llama-b12211-bin-win-cpu-x64 natively, -c 8192 -np 1 -t 8); NVIDIA driver 597.30; AMD driver 32.0.21045.11001; Windows 11 24H2.</li><li><strong>Video memory:</strong> from nvidia-smi on the A2000 and Windows’ GPU process memory counters on the RX 5700, with -c 8192 -np 1. CPU memory for llama.cpp: the peak of docker stats.</li><li><strong>Several requests at once:</strong> the public script’s perf mode, 30 clips at 1, 2 and 4 in flight, RX 5700 with -np 4 -c 16384.</li></ul><h3>What this does not show</h3><ul><li><strong>One PC, one card of each kind.</strong> Other cards, drivers and CPUs will differ.</li><li><strong>Thirty clips.</strong> Enough for speed and for a gross accuracy change, not to rank accuracy.</li><li><strong>Several users at once</strong> only on the RX 5700, and only up to four requests.</li><li><strong>llama.cpp’s CUDA build.</strong> On the NVIDIA card we only tried Vulkan; the CUDA build might be faster still.</li><li><strong>Newer AMD cards with ROCm</strong>, and PyTorch on AMD, were not tested.</li><li><strong>Native Linux on this PC.</strong> All PyTorch runs went through WSL2.</li></ul><h3>Reproduce it</h3><p>The <a href="https://github.com/rnmanhon/qwen3-asr-vs-whisper-cantonese">benchmark repository</a> from the previous article now covers llama-server too:</p><pre>python benchmark.py prepare --data data --n 500<br>python benchmark.py qwen --data data --url http://127.0.0.1:8090 --wav --limit 30 --name llama_vulkan_q8_0<br>python benchmark.py qwen-local --data data --device cuda --dtype bfloat16 --limit 30<br>python benchmark.py score --data data</pre><p>--wav converts the clips for llama-server and strips its reply prefix; --limit 30 runs the first 30 clips, as here. Download WSYue-ASR-eval yourself and accept its licence; no audio is included.</p><p><em>Measured on 8–9 November 2026 (CPU llama.cpp and four-slot runs added on 9 November) on a Windows 11 desktop (Ryzen 7 3700X, RTX A2000 12 GB, Radeon RX 5700 8 GB), with an NVIDIA GB10 for reference.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=907904d02fca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qwen3-ASR vs Whisper for Cantonese: Accuracy and Speed on GPU and CPU]]></title>
            <link>https://medium.com/@rnmanhon/qwen3-asr-vs-whisper-for-cantonese-accuracy-and-speed-on-gpu-and-cpu-be63776ea243?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/be63776ea243</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[benchmarking]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[cantonese]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 12:45:51 GMT</pubDate>
            <atom:updated>2026-11-07T12:56:07.619Z</atom:updated>
            <content:encoded><![CDATA[<p><em>We hoped faster-whisper could replace a vLLM-served model for Cantonese speech recognition. On 500 labelled clips, Qwen3-ASR made about half as many errors, on a GPU and on a CPU. On the CPU it was also faster on short clips.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogEKoPHx6LTwZL_jiNbNEw.jpeg" /></figure><p>In our <a href="https://medium.com/@rnmanhon/whisper-large-v3-on-gb10-cpu-gpu-and-int8-compared-for-cantonese-ff2a5a9b476e">previous article</a>, faster-whisper transcribed Cantonese large-v3 in about half a second per clip on an NVIDIA GB10 GPU. That raised an obvious question for one of our own speech-to-text uses: <strong>could faster-whisper replace Qwen3-ASR?</strong></p><p>The appeal was operational. Qwen3-ASR needs a model server such as <a href="https://github.com/vllm-project/vllm">vLLM</a>, which reserves a fixed share of GPU memory and takes minutes to start. faster-whisper is a Python library that loads in seconds and uses a few gigabytes.</p><p>The previous article measured speed on two recordings. Choosing a recogniser needed accuracy as well, measured on many speakers, so we ran both models on the same 500 hand-labelled Cantonese clips.</p><p><strong>Short answer: no.</strong> On this test set, Qwen3-ASR made about half as many character errors. It kept spoken Cantonese wording that Whisper often rewrote into standard written Chinese. Single requests took about the same time, but with several simultaneous requests Qwen3-ASR stayed under a second while Whisper’s median time grew roughly in line with the queue.</p><p>That raised a second question: what if a machine has no GPU? We ran all three on the CPU as well:</p><ul><li><strong>Qwen3-ASR</strong> still made about half as many errors as the best Whisper setting (6.6% against 13.1%). On these short clips it was also faster, at 3.1 seconds per clip against 5.3, without vLLM.</li><li>The previous article recommended faster-whisper over OpenAI Whisper purely on speed. That speed is not paid for in accuracy: faster-whisper was slightly <em>more</em> accurate than OpenAI Whisper, and INT8 cost nothing.</li></ul><p>The details are in “If you only have a CPU” below.</p><h3>The results (GPU)</h3><figure><img alt="Character error rate on 500 Cantonese clips: Qwen3-ASR 1.7B 7.1%, Whisper large-v3 INT8 beam 5 with VAD 13.1%, Whisper FP16 beam 5 with VAD 13.4%, Whisper FP16 greedy 14.8%" src="https://cdn-images-1.medium.com/max/1024/1*AYLeAeuQS-ENoYSfYCOVEA.png" /></figure><figure><img alt="Accuracy table: Qwen3-ASR 7.1% CER, 4.5% on 21 elderly-speaker clips, 97.2% of Cantonese characters kept; Whisper variants 13.1–14.8% CER, 8.4–8.7% elderly, 77–84% Cantonese characters kept." src="https://cdn-images-1.medium.com/max/1024/1*Crz0dzw6IBf6COmH3WPBcA.png" /></figure><p><strong>Character error rate (CER)</strong> counts the characters you would have to substitute, delete or insert to turn the recogniser’s output into the reference transcript, as a share of the reference length. Lower is better.</p><p>Qwen3-ASR’s 7.1% compares with 13.1–14.8% for the three Whisper configurations. The gap is not a quirk of a few clips:</p><ul><li>Qwen3-ASR was better on <strong>291</strong> clips, worse on <strong>63</strong>, and tied on <strong>146</strong> (against Whisper FP16, beam 5 + VAD).</li><li>A bootstrap over clips puts Whisper’s extra error at <strong>5.3 to 7.2 percentage points</strong> (95% interval) for that configuration.</li><li>Only 21 clips in our sample are labelled as speakers aged 60 or over. Both models did better on that small group, and the ratio between them stayed about the same: 4.5% against 8.4–8.7%.</li></ul><p>INT8 did not cost accuracy: Whisper INT8 scored 13.1% against FP16’s 13.4%, consistent with the previous article’s small observation. Quantisation is not why Whisper trails here.</p><h3>What kind of mistakes?</h3><p>The error breakdown shows where the gap comes from:</p><ul><li><strong>Deletions:</strong> Whisper dropped about <strong>3.0%</strong> of reference characters; Qwen3-ASR dropped <strong>0.7%</strong>. In one case, a 21-character sentence about vegetables came back from Whisper as just 「大白菜菜膽」.</li><li><strong>Substitutions:</strong> 9.0–10.2% for Whisper against 5.2% for Qwen3-ASR. Some were plain mishearings, such as 大興土木 heard as 「大興討盟」.</li><li><strong>Insertions</strong> were similar for both, at 1.1–1.2%.</li></ul><p>The substitutions matter more than the numbers suggest, because many of Whisper’s were <strong>register changes</strong>: it replaced spoken Cantonese with standard written Chinese. One clip of 唔該 (“thank you”) came back as 「麻煩了」.</p><p>We measured this directly. Written Cantonese uses characters such as 嘅, 咗, 喺, 唔, 哋 and 佢 that standard Chinese does not. Of those in the references, Qwen3-ASR’s output kept <strong>97.2%</strong>. Whisper kept <strong>77.0%</strong> with greedy decoding, and 83–84% with beam search.</p><p>We also counted characters typical of standard Chinese, such as 的, 了 and 是, appearing beyond what the reference contained. There were 3 such extra characters in Qwen3-ASR’s output, and 51–80 in Whisper’s.</p><p>If your users speak Cantonese and expect to read what they said, this difference may matter more than the headline CER.</p><p>Qwen3-ASR’s worst clips were mostly proper names and Cantonese–English code-switching (for example, a short English product name heard as 「for you two」). Both models struggled with those.</p><h3>Silence and half-finished speech</h3><p>Two failure modes do not show up in a CER on clean clips, but they matter for live transcription.</p><p><strong>Silence and background noise.</strong> We sent 12 clips of digital silence, low hiss and louder noise, from 0.5 to 6 seconds long:</p><ul><li><strong>Whisper with greedy decoding</strong> returned text for 11 of 12, usually the phrase 「字幕由 Amara.org 社群提供」 (“subtitles provided by the Amara.org community”). That is a well-known Whisper hallucination, learned from subtitled video. One noise clip produced 唔好 repeated dozens of times.</li><li><strong>Whisper with its VAD filter</strong> (Silero voice-activity detection, built into faster-whisper) returned nothing for all 12. The filter removes non-speech before decoding.</li><li><strong>Qwen3-ASR</strong> returned a single character for 9 of 12, such as 「係。」 or 「嗯。」. That is harmless compared with a fake subtitle credit, but still worth filtering.</li></ul><p><strong>The first 1.5 seconds of speech.</strong> Live-captioning systems often transcribe an utterance before it has finished. We cut 60 clips to their first 1.5 seconds and counted output characters that appear nowhere in the full reference sentence. For Qwen3-ASR, 4.3% of output characters were invented this way. For Whisper it was 24–25%, in all three configurations: given a fragment, Whisper tends to complete it with plausible-looking words.</p><h3>Speed: similar alone, very different together</h3><figure><img alt="Median time per clip against simultaneous requests: Qwen3-ASR 0.44, 0.39, 0.39 and 0.76 seconds at 1, 2, 4 and 8 requests; Whisper FP16 0.56, 1.07, 2.19 and 4.48 seconds; Whisper INT8 0.51, 0.96, 1.96 and 4.03 seconds" src="https://cdn-images-1.medium.com/max/1024/1*cvMeVx8AzGTOxGzGykgamA.png" /></figure><figure><img alt="Speed table: one request p50 0.44 s Qwen3-ASR vs 0.51–0.56 s Whisper; four at once 0.39 s vs 1.64–2.19 s; maximum throughput 10.3 clips per second vs 1.8–2.2; GPU memory about 15.2 GB reserved by vLLM vs 2.4–5.6 GB for Whisper." src="https://cdn-images-1.medium.com/max/1024/1*MwNnTRB3CQ8IhWj4lKbeyw.png" /></figure><p>We sent 120 clips (9.6 minutes of audio, 4.8 seconds per clip on average) with 1, 2, 4 and 8 requests in flight at once.</p><p><strong>One request at a time</strong>, the two were close: a median of 0.44 seconds for Qwen3-ASR against 0.51–0.56 seconds for Whisper. Both finished in about a tenth of the audio’s duration.</p><p><strong>With several requests at once</strong>, they behaved very differently:</p><ul><li><strong>vLLM batches</strong> simultaneous requests through the model together. Qwen3-ASR’s median stayed at 0.39 seconds with four requests in flight. It rose to 0.76 seconds at eight, because our server was configured to run at most four sequences at a time.</li><li><strong>faster-whisper with one model handles one clip at a time</strong> on the GPU. Throughput stayed at about 1.8 clips per second whatever the load, so each additional request waited for the ones ahead of it. The median grew to 2.2 seconds with four requests and 4.5 seconds with eight.</li></ul><p>CTranslate2’s num_workers option, which allows parallel transcriptions sharing one set of weights, helped only a little: 2.2 clips per second with four workers, against 1.8 with one. Peak throughput was <strong>10.3 clips per second for Qwen3-ASR against 1.8–2.2 for Whisper</strong>.</p><p><strong>Whisper does win on footprint.</strong> One faster-whisper large-v3 model peaked at 4.2 GB of GPU memory in FP16 and 2.4 GB in INT8. Our vLLM server for Qwen3-ASR held about 15 GB, because vLLM reserves a fixed fraction of memory up front (0.20 here) for its cache. A smaller reservation may well work for this 1.7-billion-parameter model; we did not tune it.</p><p>Start-up differed too. faster-whisper loaded in about two seconds with the weights already cached. vLLM took roughly three to four minutes before answering, even with its compilation cache warm.</p><h3>If you only have a CPU</h3><p>The previous article found faster-whisper INT8 4.1–5.1× faster than OpenAI Whisper on the GB10’s ARM CPU. A faster library only helps if it is not less accurate, and the GPU results raise a further question: can Qwen3-ASR itself run without a GPU? vLLM is built around GPUs, but the model also runs in plain Hugging Face Transformers on a CPU. So we scored all three on the same 500 clips and probes, and timed each on its own on the same 30 clips.</p><figure><img alt="CPU table: Qwen3-ASR BF16 6.6% CER, 97.2% Cantonese characters kept, 3.1 s median per clip; faster-whisper INT8 beam 5 + VAD 13.1%, 83.9%, 5.3 s; faster-whisper INT8 greedy 14.4%, 78.9%, 4.9 s; faster-whisper FP32 greedy 14.9%, 77.0%, 8.8 s; OpenAI Whisper FP32 greedy 16.2%, 74.0%, 15.5 s." src="https://cdn-images-1.medium.com/max/1024/1*VXcQ2_akF-4WYR6uKzZ6-w.png" /></figure><h3>Qwen3-ASR on a CPU</h3><p><strong>Accuracy held.</strong> In BF16 on the CPU, Qwen3-ASR scored <strong>6.6% CER</strong> and kept 97.2% of Cantonese characters. The best Whisper setting on the same CPU scored 13.1%.</p><ul><li>Against faster-whisper INT8 with beam 5 + VAD, Qwen3-ASR was better on <strong>296</strong> clips, worse on <strong>55</strong>, and tied on <strong>149</strong>.</li><li>A bootstrap puts Whisper’s extra error at <strong>5.7 to 7.5 points</strong> (95% interval).</li><li>It added only 2 extra standard-Chinese characters, against 51–80 for Whisper.</li></ul><p>It even scored slightly better than our GPU server’s 7.1%: the interval for the difference is 0.2 to 0.9 points, and 359 of the 500 transcripts were identical after normalisation. The two runs differ in more than the device. The GPU server ran a real-time variant of the model architecture under vLLM, while the CPU run used the Transformers version of the checkpoint in BF16. We did not separate those effects. The safe reading is that moving to a CPU did not cost accuracy.</p><p><strong>It was faster than Whisper on these clips.</strong> The median was <strong>3.1 seconds per clip</strong>, about 0.83× the audio length, against 4.9–5.3 seconds for faster-whisper INT8. At the 95th percentile it took 8.4 seconds, against 9.1 for faster-whisper with beam 5 + VAD.</p><p>BF16 matters here. In FP32, Qwen3-ASR took 5.4 seconds per clip, about the same as faster-whisper INT8. The GB10’s ARM cores have BF16 instructions, and CPUs without them may not see the same gain.</p><p>Part of the reason is Whisper’s fixed 30-second window, explained below. Qwen3-ASR’s time grows with the length of the audio and of the text it writes, so short utterances are cheap. Longer recordings may narrow the gap; our clips were at most 11 seconds long.</p><p><strong>One catch: silence.</strong> On the CPU, Qwen3-ASR returned text for all 12 silence and noise probes, against 9 of 12 on the GPU. Usually it was 「係。」 (“yes”). On the 6-second clips it grew to 「係啊！係」, and once to 「係啊！」 four times. On 1.5-second fragments it invented 5.2% of its output characters, close to its GPU figure of 4.3% and far below Whisper’s 24–25%. For live use, put a voice-activity check in front of it.</p><h3>faster-whisper against OpenAI Whisper</h3><p><strong>faster-whisper was not less accurate. It was slightly more accurate.</strong></p><ul><li>With matched greedy decoding, OpenAI Whisper scored 16.2% CER against 14.4% (INT8) and 14.9% (FP32) for faster-whisper.</li><li>A bootstrap puts OpenAI Whisper’s extra error at <strong>0.9 to 2.8 points</strong> (95% interval) against faster-whisper INT8 greedy.</li><li>Clip by clip, faster-whisper INT8 was better on 90, worse on 56, and tied on 354.</li></ul><p><strong>Where it comes from.</strong> On some clips, OpenAI Whisper rewrote the whole sentence in standard written Chinese, even with the Cantonese language setting. For one clip:</p><ul><li><strong>Reference</strong> (the dataset’s label, in Simplified characters): 件事究竟系点嘅啫啊点解无啦啦对住阿兰发咁大火得噶</li><li><strong>OpenAI Whisper:</strong> 事情到底是怎樣的? 為甚麼無緣無故 對著阿蘭發這麼大火?</li><li><strong>faster-whisper:</strong> 件事究竟係點㗎啫? 點解無啦啦對住阿蘭發咁大火得㗎?</li></ul><p>Ten such clips account for about two-thirds of OpenAI Whisper’s extra errors. Without them, the two libraries score 15.5% and 15.0%. The two implementations differ in details such as timestamp handling and token suppression. We did not trace which one causes this, so treat it as an observation, not an explanation.</p><p><strong>INT8 did not cost accuracy on CPU either.</strong> INT8 greedy scored 14.4%, against 14.9% for FP32.</p><p><strong>CPU or GPU made no difference to Whisper’s words.</strong></p><ul><li>OpenAI Whisper produced identical transcripts on CPU (FP32) and GPU (FP32 and FP16) for all 60 clips we checked.</li><li>faster-whisper FP32 on CPU matched its GPU FP16 output on 496 of 500 clips.</li></ul><p><strong>The best Whisper setting on CPU is INT8 with beam 5 + VAD.</strong> It scored 13.1%, the same as on the GPU. It returned nothing on silence or noise, and it took about 9% longer than greedy decoding.</p><p><strong>Speed on short clips.</strong> By median, faster-whisper INT8 was 3.2× faster than OpenAI Whisper (4.9 against 15.5 seconds per clip). On these clips, averaging 4.8 seconds, it took about as long as the audio itself (1.09× the audio length). That is slower than the previous article’s 0.73–0.84× for 6–9 second recordings.</p><p>Whisper always encodes a 30-second window, padding shorter audio. A 4-second clip therefore costs nearly as much as a 9-second one, which makes short utterances relatively expensive on a CPU. The previous article also found an x86 desktop CPU (Core i7–12700) about 1.7–1.9× faster than this ARM CPU for faster-whisper INT8.</p><h3>Our recommendation</h3><ul><li><strong>With a GPU, use Qwen3-ASR.</strong></li><li><strong>With only a CPU, Qwen3-ASR in BF16 is still the better choice for short Cantonese utterances.</strong> It had half the error rate and was faster on our clips. Add a voice-activity check to drop its 「係」 on silence.</li><li><strong>If you need Whisper on a CPU,</strong> use faster-whisper INT8 with beam 5 + VAD rather than OpenAI Whisper.</li></ul><p>We timed one request at a time. On a CPU, simultaneous requests compete for the same cores with either model, so plan for one request at a time per set of cores.</p><h3>How we tested</h3><p><strong>Test set.</strong> <a href="https://huggingface.co/datasets/ASLP-lab/WSYue-ASR-eval">WSYue-ASR-eval</a> is a Cantonese benchmark from ASLP-lab with transcripts labelled by hand over several rounds. We used its <strong>Short</strong> subset (clips of 0–10 seconds) at revision 0f0596e. From its 7,060 clips we took a fixed sample of 500 (random seed 42):</p><ul><li>every clip labelled as an elderly, teenage or child speaker (29 in total)</li><li>471 randomly chosen clips from the two adult age groups</li></ul><p>Clips ranged from 2.0 to 10.9 seconds, with a median of 4.1. The dataset is licensed <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>. Transcript excerpts quoted above come from it.</p><p><strong>Is it really Cantonese?</strong> We checked the spoken language of every sampled clip with a separate model, <a href="https://huggingface.co/FunAudioLLM/SenseVoiceSmall">SenseVoice-Small</a>, in automatic language-detection mode. It heard <strong>492 of the 500 clips as Cantonese</strong>. The other eight were:</p><ul><li>four sung lyrics, written in standard-Chinese wording</li><li>a sound effect</li><li>an exclamation</li><li>two clips of a second or two</li></ul><p>Leaving those eight out changed every model’s CER by less than 0.1 point, and no ranking changed.</p><p><strong>Audio format.</strong> Every clip was re-encoded to <strong>webm/opus at 48 kHz and 32 kbit/s</strong>, similar to what a web browser’s MediaRecorder produces. Both models received exactly the same files.</p><p><strong>Qwen3-ASR.</strong> <a href="https://huggingface.co/Qwen/Qwen3-ASR-1.7B">Qwen/Qwen3-ASR-1.7B</a> (Apache-2.0, revision 7278e1e) served by vLLM 0.29.0 (Transformers 5.18.0.dev0, PyTorch 2.13.0+cu130). Server settings:</p><ul><li>--gpu-memory-utilization 0.20 --max-model-len 8192 --max-num-seqs 4</li><li>--hf-overrides &#39;{&quot;architectures&quot;: [&quot;Qwen3ASRRealtimeGeneration&quot;]}&#39;</li></ul><p>Requests went to the OpenAI-compatible /v1/audio/transcriptions endpoint with language=yue.</p><p><strong>Whisper.</strong> faster-whisper 1.2.1 with CTranslate2 4.8.5, built from source with CUDA 13 because the ARM wheel has no GPU support (see the previous article). The model was <a href="https://huggingface.co/Systran/faster-whisper-large-v3">Systran/faster-whisper-large-v3</a> at revision edaa852, with language=&quot;yue&quot; and previous-text conditioning off. We tested three configurations:</p><ul><li><strong>greedy:</strong> beam size 1, temperature 0, no VAD filter (the previous article’s setting)</li><li><strong>beam 5 + VAD:</strong> faster-whisper’s default beam size and temperature fallback, with vad_filter=True</li><li>the same in <strong>INT8</strong> (compute_type=&quot;int8_float16&quot;)</li></ul><p>On CPU, we ran greedy decoding in INT8 and FP32, and beam 5 + VAD in INT8 (compute_type=&quot;int8&quot; or &quot;float32&quot;), across all 500 clips and the probes.</p><p><strong>Qwen3-ASR on CPU.</strong> <a href="https://huggingface.co/Qwen/Qwen3-ASR-1.7B-hf">Qwen/Qwen3-ASR-1.7B-hf</a>, the Transformers version of the same model (revision bcd2b5b), with Transformers 5.18.0.dev0 and PyTorch 2.13.0 on the CPU. It was loaded in BF16 with AutoModelForMultimodalLM, prompted through the processor&#39;s apply_transcription_request with language=&quot;yue&quot;, and decoded greedily with up to 256 new tokens. The full set and probes ran in BF16. A 100-clip FP32 check scored 6.2%, in line with BF16.</p><p><strong>OpenAI Whisper.</strong> The openai-whisper package 20231117 with PyTorch 2.9.1, using OpenAI&#39;s own large-v3 checkpoint, greedy decoding (temperature 0, no fallback) and previous-text conditioning off, matching faster-whisper&#39;s greedy setting. Both libraries received the same decoded 16 kHz audio. CPU inference at about four times the audio length made 500 clips slow, so we ran the full set in FP32 on the GPU, and confirmed on 60 clips that FP32 on the CPU gave identical transcripts.</p><p><strong>Scoring.</strong> Before comparing, we normalised both sides the same way:</p><ul><li>converted to Simplified characters with OpenCC, since the labels are Simplified and both models mix scripts</li><li>lower-cased Latin letters</li><li>spelled out Arabic numerals as Chinese numerals</li><li>removed punctuation and spaces</li></ul><p>The CER is pooled over all characters, not averaged per clip.</p><p><strong>Timing.</strong> End-to-end wall time per request from a client on the same machine, including audio decoding and, for vLLM, the HTTP round trip. Each configuration had one warm-up request. faster-whisper’s lazy segment iterator was consumed inside the timer. Peak GPU memory was sampled once a second with nvidia-smi. The GB10 shares one memory pool between CPU and GPU, so &quot;GPU memory&quot; here means memory allocated by the CUDA process.</p><p>The accuracy runs used the full 500 clips and 72 probes. The GPU speed runs used the first 120 clips. Other GPU services on the machine were idle during timing, though a large language model stayed loaded in memory.</p><p>The CPU speed runs used the first 30 clips (143 seconds of audio), with eight threads as in the previous article. Each configuration ran on its own, one after another, while other services on the machine were idle. Each run had one warm-up clip, and audio decoding was outside the timer.</p><h3>What this does not show</h3><ul><li><strong>This is not our users’ speech.</strong> WSYue-ASR-eval is mostly read and broadcast-style Cantonese, recorded with good microphones. Spontaneous speech on a phone, with background noise, may change both numbers, and possibly the gap. Only 21 clips came from speakers aged 60 or over.</li><li><strong>Possible home advantage.</strong> ASLP-lab also published WenetSpeech-Yue, a large Cantonese training corpus. We do not know whether Qwen3-ASR was trained on it, so an in-domain advantage for Qwen3-ASR cannot be ruled out. The test clips themselves are a separate evaluation set.</li><li><strong>Some labels use standard Chinese wording</strong> (for example 的 or 了) where the speaker used Cantonese. That penalises any model that writes what was actually said, including both of these.</li><li><strong>Single runs</strong> on one shared machine. The speed differences are large, but the exact timings would move between runs.</li><li><strong>One Whisper model.</strong> We did not test Cantonese fine-tuned Whisper checkpoints, larger beam sizes, or prompts. A fine-tuned model could narrow the gap.</li><li><strong>No concurrency or memory figures on CPU.</strong> The CPU timings are one request at a time, and we did not measure CPU memory use.</li><li><strong>Short clips only.</strong> Every clip was under 11 seconds. Qwen3-ASR’s CPU speed advantage comes partly from Whisper padding short audio to 30 seconds, so it may shrink on longer recordings.</li><li><strong>One CPU.</strong> The CPU timings come from the GB10’s ARM cores, which support BF16. As the previous article showed, an x86 desktop CPU can be considerably faster for Whisper, and a CPU without BF16 support may not give Qwen3-ASR the same speed-up.</li></ul><h3>When we would still choose Whisper</h3><p>Whisper still makes sense for jobs where its strengths matter more than these accuracy differences:</p><ul><li><strong>Tight memory or no model server.</strong> A 2.4 GB INT8 model that starts in seconds is much easier to fit next to other workloads.</li><li><strong>One request at a time.</strong> For batch jobs or a single user, the latency difference largely disappears.</li><li><strong>Silence handling built in.</strong> faster-whisper’s VAD filter returned nothing on every silence and noise probe, with no extra component.</li><li><strong>CPUs without BF16.</strong> Qwen3-ASR’s CPU speed relied on BF16. On older CPUs, faster-whisper INT8 may be the faster option; measure on your own hardware.</li><li><strong>Checking audio you generated yourself.</strong> When the text is known in advance and you only need to confirm it was spoken, Whisper’s gaps in Cantonese wording matter less.</li></ul><p>For live Cantonese transcription where the exact wording matters, we are staying with Qwen3-ASR.</p><h3>Reproduce it</h3><p>The <a href="https://github.com/rnmanhon/qwen3-asr-vs-whisper-cantonese">benchmark script and setup guide</a> cover the whole run:</p><ul><li>sampling and re-encoding the clips</li><li>generating the silence and partial-clip probes</li><li>Qwen3-ASR (through vLLM, or Transformers on a CPU), faster-whisper and OpenAI Whisper, on GPU or CPU</li><li>scoring, with the error breakdown</li><li>the concurrency test</li></ul><p>No audio is included. Download WSYue-ASR-eval yourself and accept its licence. The script runs prepare, whisper, openai, qwen or qwen-local, score and perf in turn.</p><p>If you repeat it, keep the audio format, language setting and scoring rules matched, and record your server settings. In our results, vLLM’s concurrency limit and Whisper’s decoding options each changed the answer noticeably.</p><p><em>Measured on 7 November 2026 on an NVIDIA GB10 (GPU and ARM CPU).</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be63776ea243" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Whisper large-v3 on GB10: CPU, GPU, and INT8 Compared for Cantonese]]></title>
            <link>https://medium.com/@rnmanhon/whisper-large-v3-on-gb10-cpu-gpu-and-int8-compared-for-cantonese-ff2a5a9b476e?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff2a5a9b476e</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[cantonese]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 11:44:08 GMT</pubDate>
            <atom:updated>2026-11-07T00:51:08.611Z</atom:updated>
            <content:encoded><![CDATA[<h3>Whisper large-v3 on GB10 and x86: CPU, GPU, and INT8 Compared for Cantonese</h3><p><em>Our first test found an 18× CPU/GPU gap. Then we tried faster-whisper — and discovered that the language setting deserved attention too.</em></p><p><em>Updated 7 November 2026: we repeated the CPU tests on an x86 desktop processor and compared it with the GB10’s GPU and ARM CPU. The CPU results changed substantially; see “Does the CPU architecture matter?” below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDuLGuUwkDJZ8Y6a65pjeQ.jpeg" /></figure><p>How much faster is Whisper large-v3 on GPU than CPU, and how much does the inference runtime change the answer?</p><p>Our first small benchmark suggested a substantial tradeoff: standard OpenAI Whisper took about nineteen seconds to transcribe six seconds of Cantonese audio on CPU, versus about one second on GPU.</p><p>Then we extended the test to faster-whisper, INT8 inference, and the model’s specific Cantonese language token. The more useful finding was that <strong>the runtime and language settings mattered as well as the device</strong>. A later repeat on an x86 desktop CPU showed that the choice of CPU mattered too: the GB10 GPU’s lead fell from roughly 8–18× over the GB10’s ARM CPU to roughly 4–6× over the x86 CPU.</p><h3>The expanded results</h3><p>We tested two fixed Cantonese recordings on an NVIDIA GB10 machine. Every row below uses large-v3 with the Cantonese language setting, <strong>yue</strong>.</p><p>Transcription time in seconds, lower is better. Each value is the mean of two measured passes after a warm-up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c73Phme16FSC1SLEqOo23w.png" /></figure><p>For these recordings on the GB10’s ARM CPU, faster-whisper with CPU INT8 was <strong>4.1–5.1× faster than the OpenAI CPU path</strong>. It finished each recording in less time than playing it would take. On an x86 desktop CPU, that advantage was about half as large; we cover the x86 results later.</p><p>On GPU, faster-whisper FP16 was about <strong>1.9–2.0× faster than OpenAI Whisper’s FP16 decoding path</strong>. Adding INT8 reduced faster-whisper’s GPU transcription time by another 19%.</p><p>These comparisons include implementation and precision differences. They do not isolate the effect of CPU quantisation alone.</p><h3>First, a language-setting discovery</h3><p>Our first benchmark used the language setting <strong>zh</strong>, meaning Chinese. But <a href="https://huggingface.co/openai/whisper-large-v3">large-v3 includes a specific Cantonese language token</a>, <strong>yue</strong>.</p><p>We tested both. Part of the first recording’s reference text was:</p><blockquote><em>天使同壞天使嘅交戰</em></blockquote><p>The OpenAI Whisper results contained:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*VuIQFN_VbiUqjTv3ettS0g.png" /></figure><p>With yue, the transcript retained the expected Cantonese <strong>同</strong> and <strong>嘅</strong>. On the second recording, it also retained wording such as <strong>佢哋</strong> and <strong>睇唔見</strong>.</p><p>On these recordings, yue preserved more of the original Cantonese wording. It did not fix everything: the first recording mentions 彌爾頓嘅失樂園, and the recogniser still wrote 米爾頓嘅失落完.</p><p>Choosing a language token is not a guarantee of a faithful transcript. But it is a meaningful experiment, and it changes the words and token sequence being generated. We therefore reran the OpenAI CPU and GPU baselines with yue before comparing runtimes.</p><h3>What happened to the original 18× result?</h3><p>It remains a valid record of the earlier zh experiment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*z95pM2emrgzinCNufiXH2g.png" /></figure><p>The expanded table uses yue throughout. Comparing its numbers directly with a zh row would change two things at once: runtime configuration and language setting.</p><p>We also saved faster-whisper zh control runs. Both experiments are retained so the original measurements remain distinguishable from the follow-up.</p><h3>What we actually measured</h3><p>The two inputs were <strong>human-recorded Cantonese clips</strong>, 6.04 and 9.06 seconds long. Fixed recordings gave both runtimes exactly the same audio. Two short recordings provide a useful latency comparison, but cannot establish accuracy across different speakers, accents, or recording conditions.</p><p>The host has 20 ARM CPU cores and an NVIDIA GB10 GPU. We used:</p><ul><li>OpenAI Whisper package 20231117, with PyTorch 2.9.1+cu130.</li><li>faster-whisper 1.2.1, using CTranslate2 4.8.5.</li><li>Eight CPU threads, without thread-count tuning.</li><li>Large-v3 in both runtimes. The faster-whisper model is the <a href="https://huggingface.co/Systran/faster-whisper-large-v3">converted large-v3 checkpoint</a>, stored in FP16, rather than byte-identical FP32 weight storage.</li></ul><p>OpenAI Whisper’s GPU path used FP16 decoding with its model weights stored in FP32. faster-whisper used the requested computation type: FP16, CPU INT8/FP32, or GPU INT8/FP16. INT8 here is mixed computation; it does not mean every operation uses eight-bit integers.</p><p>Both paths used temperature zero and disabled previous-text conditioning. We explicitly set faster-whisper’s beam size to one to match the OpenAI greedy baseline; faster-whisper normally defaults to five. Its <a href="https://github.com/SYSTRAN/faster-whisper#comparing-performance-against-other-implementations">comparison guidance</a> calls out this distinction. We disabled VAD filtering and word timestamps.</p><p>Each configuration had one warm-up pass over both clips, followed by two measured passes. Audio decoding, resampling, model loading, and device transfers were outside the timer. GPU work was synchronised around timed calls.</p><p>One easy mistake matters here: faster-whisper returns a lazy segment iterator. We consumed that iterator <strong>inside the timer</strong>, so the measurement includes the transcription work:</p><pre>start = time.perf_counter()<br>segments, info = model.transcribe(<br>    audio,<br>    language=&quot;yue&quot;,<br>    beam_size=1,<br>    best_of=1,<br>    temperature=0,<br>    condition_on_previous_text=False,<br>    vad_filter=False,<br>    word_timestamps=False,<br>)<br>text = &quot;&quot;.join(segment.text for segment in segments)<br>elapsed = time.perf_counter() - start</pre><p>This excerpt assumes a loaded, warmed model and preprocessed audio. The complete worker also records versions, checksums, loading time, actual computation type, and GPU synchronisation.</p><h3>An ARM setup detail worth knowing</h3><p>The prebuilt CTranslate2 ARM wheel was CPU-only. We confirmed that it supported CPU INT8, but reported no CUDA devices despite GPU access in the container. The <a href="https://opennmt.net/CTranslate2/installation.html#nvidia-jetson-aarch64-cuda">upstream ARM installation notes</a> describe this limitation.</p><p>For the GPU rows, we built CTranslate2 with CUDA 13 and cuDNN in a disposable container, targeting the GB10’s compute capability 12.1. CMake’s older architecture parser also needed a small correction to accept a two-digit architecture number.</p><p>We then repeated CPU INT8 with that same source build; that repeat supplies the main table’s CPU INT8 row. No compilation ran during timed tests.</p><h3>Did INT8 change the transcripts?</h3><p>Each configuration produced the same transcript across its own three passes.</p><p>With yue, OpenAI Whisper on CPU and GPU, and faster-whisper GPU FP16, produced identical transcripts for each recording. The INT8 paths changed some punctuation and Simplified/Traditional character choices. GPU INT8 inserted a comma in the first recording; both INT8 paths used more Traditional characters in the second.</p><p>We did not see an obvious additional content error caused by INT8 in these two clips. That is a small observation, not evidence of equal accuracy across Cantonese speech. Names were still misheard, and we did not measure error rates on a larger dataset.</p><h3>Can transcription keep up with the audio?</h3><p>Real-time factor is processing time divided by audio duration. Below 1.0 means processing finishes before the audio would finish playing.</p><p>On the GB10 with yue, OpenAI CPU recognition had real-time factors of <strong>3.47 and 3.73</strong>. faster-whisper CPU INT8 brought those to <strong>0.84 and 0.73</strong>. GPU INT8/FP16 reached <strong>0.082 and 0.089</strong>.</p><p>CPU INT8 finished both recordings faster than their playback duration, while GPU inference had substantially more spare capacity. These are sequential transcription timings with a loaded model, not a demonstration of live streaming or performance under concurrent requests.</p><p>A stronger follow-up would add longer passages, more speakers, and varied recording conditions, then compare transcription error rates as well as latency. The current results do not establish sustained throughput on long recordings.</p><h3>Does the CPU architecture matter?</h3><p>The GB10’s CPU uses ARM cores. To check whether the CPU results carried over to another architecture, we repeated the two CPU rows on an x86 desktop processor: an Intel Core i7–12700 with 12 cores and 20 threads. The benchmark container had no GPU attached.</p><p>Everything else stayed matched: the same two recordings (confirmed by checksum), the same model files, yue, eight threads without pinning or tuning, and greedy decoding. The runtime versions were also the same. On x86, the standard CTranslate2 package from PyPI supports CPU INT8 directly, so no source build was needed. We ran each configuration twice, as separate processes, and each run had a warm-up followed by two measured passes.</p><p>The table below puts the x86 CPU next to both GB10 devices. Each cell shows transcription time for the <strong>6.04-second / 9.06-second</strong> recordings, lower is better. All rows use yue; CPU rows use eight threads:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2WjIkNkXpAjkamYqXQWsA.png" /></figure><p>Each x86 value shows the range between the two runs’ means. GPU and CPU rows use their device’s normal precision, as in the main table, so each row compares the same runtime, not identical arithmetic.</p><p>How much faster was the GB10 GPU than each CPU, using the same runtime?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*fCwEbRq2x0vBeL9Bl3lVbQ.png" /></figure><p>Three findings changed on x86:</p><ul><li><strong>Standard OpenAI Whisper was 2.8–3.8× faster than on the GB10’s CPU.</strong> Its real-time factor was 0.98–1.22, close to the length of the audio itself, rather than 3.5–3.7.</li><li><strong>faster-whisper’s CPU advantage was smaller.</strong> CPU INT8 was 2.3–2.5× faster than the OpenAI CPU path, compared with 4.1–5.1× on the GB10.</li><li><strong>faster-whisper CPU INT8 was 1.7–1.9× faster than on the GB10’s CPU,</strong> with a real-time factor of 0.39–0.49.</li></ul><p>The x86 transcripts were character-for-character identical to the GB10 transcripts for the same configuration, including the INT8 paths’ punctuation and character choices. Both machines therefore did the same transcription work; only the speed differed.</p><p>The large CPU/GPU gap in our first test therefore says as much about this particular CPU as about the GPU. Against the x86 CPU, the GB10 GPU’s lead shrank from roughly 8–18× to roughly 4–6×, although the GPU was still clearly faster. Readers on x86 hardware should not assume the GB10 CPU numbers apply to them.</p><p>The GB10 GPU and the x86 CPU belong to two different machines. The second table compares hardware choices, not the same system. We did not run GPU tests on the x86 machine.</p><p>This is one desktop processor compared with one ARM system, not a controlled ARM-versus-x86 study. The i7–12700 boosts to 4.9 GHz and mixes performance and efficiency cores. We did not pin threads to particular cores, and we did not profile where the difference comes from. These x86 results came from our application’s existing x86 inference image, run offline in a disposable container, not from the standalone GB10 recipe below.</p><h3>Reproduce and extend it</h3><p>We retained both the original zh run and the follow-up yue matrix, including transcripts and clip checksums. The <a href="https://github.com/rnmanhon/whisper-cpu-gpu-benchmark">public benchmark repository</a> provides the standalone code, setup guide and a <a href="https://github.com/rnmanhon/whisper-cpu-gpu-benchmark/blob/main/RESULTS.md">summary of the original results</a>.</p><h3>Build a benchmark-only Docker image</h3><p>Readers should not need our original container to repeat the method. We have therefore added a <a href="https://github.com/rnmanhon/whisper-cpu-gpu-benchmark/blob/main/standalone/README.md">standalone GB10 Docker recipe</a> with a Dockerfile, CUDA build script, model downloader and benchmark worker. It contains only inference dependencies and benchmarking code. It starts from Python 3.11, installs the runtime versions listed above, and builds CTranslate2 with CUDA support for the GB10’s ARM architecture.</p><p>The published measurements came from our original container. The standalone recipe was prepared afterwards: it matches the main runtime versions and test settings, but is not an exact copy of that environment. Results from it should be recorded as a new run. We checked that the independent image builds on GB10 and runs OpenAI GPU FP16, faster-whisper GPU FP16, and CPU INT8 transcription.</p><p>On a GB10 host with Docker GPU access configured, clone the public repository and build the image from its standalone/ directory:</p><pre>git clone https://github.com/rnmanhon/whisper-cpu-gpu-benchmark.git<br>cd whisper-cpu-gpu-benchmark/standalone<br>docker build -f Dockerfile -t whisper-benchmark:gb10 ..</pre><p>Put WAV recordings in an audio/ directory and prepare the two model formats in a separate models/ directory. This download runs once, outside the timer:</p><pre>mkdir -p models audio<br>docker run --rm --entrypoint python \<br>  -v &quot;$PWD/models:/models&quot; \<br>  whisper-benchmark:gb10 /download-models.py</pre><p>Then run one configuration at a time. For example, faster-whisper GPU FP16:</p><pre>docker run --rm --gpus all --network none \<br>  -e HF_HUB_OFFLINE=1 \<br>  -v &quot;$PWD/models:/models:ro&quot; -v &quot;$PWD/audio:/audio:ro&quot; \<br>  whisper-benchmark:gb10 faster cuda float16 yue &gt; faster-gpu.jsonl</pre><p>The worker arguments are runtime, device, computation type, and language. The <a href="https://github.com/rnmanhon/whisper-cpu-gpu-benchmark/blob/main/standalone/README.md">setup guide</a> includes the GPU check and all five configurations in the table. Model and audio mounts are read-only during inference; no packages or models are downloaded in timed runs. Use the same recordings across configurations, and compare audio checksums if repeating an existing test. Different recordings will produce different results.</p><p>The sample is small: two short clean recordings, two measured passes, fixed configuration order, and no CPU tuning. Other services remained running, although the local speech-processing queues were empty. We did not measure power, memory use, cost, or concurrent throughput.</p><p>If you repeat the test, keep the model, language token, beam size, audio, and timed work matched. Those details can change the answer just as much as the CPU-versus-GPU label suggests.</p><p><em>GB10 results measured on 6 November 2026; x86 CPU results measured on 7 November 2026. Benchmark code, setup instructions and the results summary are available in the </em><a href="https://github.com/rnmanhon/whisper-cpu-gpu-benchmark"><em>GitHub repository</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff2a5a9b476e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Same PC, Same GPU: A Small CUDA Sync Took 68 µs on Windows and 15 µs on Linux]]></title>
            <link>https://medium.com/@rnmanhon/same-pc-same-gpu-a-small-cuda-sync-took-68-%C2%B5s-on-windows-and-15-%C2%B5s-on-linux-74a4b4a930fb?source=rss-1dcdd4b7032c------2</link>
            <guid isPermaLink="false">https://medium.com/p/74a4b4a930fb</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[gpu]]></category>
            <dc:creator><![CDATA[Raymond Ng, MH]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 06:16:54 GMT</pubDate>
            <atom:updated>2026-11-04T06:16:54.541Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why our speech model ran slower than real time on a capable PC, and the short script that showed where the time goes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1B6coPENgN_tJnY15AnyQ.jpeg" /></figure><p>We assumed our text-to-speech service was slow on a Windows PC because of WSL, or an old CPU, or a modest 12 GB graphics card. So we booted the same machine into Linux from a USB stick and ran the same benchmark.</p><p>A tiny GPU-to-CPU sync dropped from 68 µs on native Windows, and about 110 µs under WSL, to 15 µs on native Ubuntu. Same CPU, same GPU, same PyTorch.</p><p>Per-call cost in µs, lower is better (median of 3 runs, PyTorch 2.9.1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*kQZgndweBp_x44LKxRlwbA.png" /></figure><p>If your workload makes thousands of tiny GPU calls per second, your operating system may matter more than your GPU. Here is how we tested it, what we can and can’t conclude, and the code to try it yourself.</p><h3>The problem: a GPU that sat waiting</h3><p>Our app, Voxlector, turns documents into speech with WSYue, a Cantonese model based on CosyVoice2. We measure speed as the real-time factor (RTF): seconds of compute per second of speech. Below 1.0, generation keeps up with playback.</p><p>On a small NVIDIA GB10 machine, RTF is about 0.4. On this PC it was 2.44, under WSL 2 in Docker. Windows “Best Performance” mode and NVIDIA’s “Prefer maximum performance” setting brought it to 1.85, still too slow for live listening.</p><p>The PC isn’t weak: a Ryzen 7 3700X, 64 GB of RAM, and an RTX A2000 12 GB on PCIe 4.0 x16. And the GPU wasn’t the limit. During the model’s token-by-token loop:</p><ul><li>One CPU thread sat at 100%.</li><li>The GPU was only 20–40% busy, at about 30 W of its 70 W limit.</li><li>The GPU clock fell to around 550 MHz of 2100 MHz.</li></ul><p>So the GPU was waiting for the host. A token loop issues a stream of very small GPU operations and regularly reads results back to the CPU for sampling. That made the cost of each small call the thing to measure.</p><h3>The test</h3><p>The whole benchmark is one script. It times four small operations, 5,000 calls each, after a warm-up:</p><pre>&quot;&quot;&quot;Per-call cost of tiny CUDA ops (what CosyVoice&#39;s token loop is made of). Run inside the WSYue container:<br>    docker exec -i voxlector-dev-x86-wsyuetts python - &lt; launch_overhead.py&quot;&quot;&quot;<br>import time, torch<br><br>dev = &quot;cuda&quot;<br>x = torch.randn(1, 1024, device=dev, dtype=torch.float16)<br>w = torch.randn(1024, 1024, device=dev, dtype=torch.float16)<br><br>def bench(name, fn, n=5000):<br>    for _ in range(200):<br>        fn()<br>    torch.cuda.synchronize()<br>    t0 = time.perf_counter()<br>    for _ in range(n):<br>        fn()<br>    torch.cuda.synchronize()<br>    print(f&quot;{name:42s} {(time.perf_counter() - t0) / n * 1e6:7.1f} us/call&quot;)<br><br>bench(&quot;tiny add (pure launch cost)&quot;, lambda: x.add_(0))<br>bench(&quot;matvec 1x1024 @ 1024x1024&quot;, lambda: x @ w)<br>bench(&quot;add + .item() (GPU-&gt;CPU sync, like sampling)&quot;, lambda: x.sum().item())<br>bench(&quot;CPU-only python loop body (reference)&quot;, lambda: sum(range(50)))<br>print(torch.cuda.get_device_name(0), &quot;torch&quot;, torch.__version__)</pre><ul><li><strong>Launch</strong> is the cost of sending the GPU almost no work.</li><li><strong>Matvec</strong> adds a small real computation.</li><li><strong>Sync</strong> forces a round trip: .item() makes the CPU wait for the GPU&#39;s answer.</li><li><strong>CPU loop</strong> involves no GPU at all. It’s a reference for the Python and CPU side.</li></ul><h3>All the results</h3><p>We changed one thing at a time on the same PC. The GB10 row comes from a different machine, running the same script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*3YY2EkSuR5Vlpt_mmw-L6Q.png" /></figure><p>PyTorch builds: 2.3.1+cu121 and 2.9.1+cu128 on the PC, 2.9.1+cu130 on the GB10. “CPU” is the CPU-only Python loop.</p><p>Here is what we read from that:</p><p><strong>Leaving Windows gave the biggest gain.</strong> With the same PyTorch, Ubuntu (E) beat native Windows (D) by 4.4× on syncs, 2.7× on matvecs and 2.5× on launches.</p><p><strong>WSL 2 adds a cost on top, mostly on syncs.</strong> With the same PyTorch, WSL was about 1.6–1.7× slower on syncs than native Windows (A vs C, B vs D). Against native Ubuntu, WSL (B) was 7× slower on syncs and 3.7× slower on launches.</p><p><strong>The PyTorch version made no useful difference.</strong> 2.3.1 and 2.9.1 were within about 10% on syncs, and the newer version was no faster on launches or matvecs.</p><p><strong>The CPU governor made no difference.</strong> Ubuntu’s default powersave and performance gave the same results within noise.</p><p><strong>The Python-side CPU cost stayed the same.</strong> The CPU loop took 0.4 µs in both WSL and native Ubuntu, both on Python 3.12. Windows showed 0.6 µs, but it ran Python 3.10, which has a slower interpreter.</p><p><strong>Linux didn’t close the gap to the GB10 completely.</strong> The PC stayed 1.5–2.4× behind. The CPU loop shows a 2× gap, so the CPU probably explains part of that, but the two machines have different GPUs too, so we can’t split it further.</p><h3>Why? Most likely the Windows driver model</h3><p>On Windows, a CUDA card driving a display uses the Windows Display Driver Model (WDDM). WSL 2 goes through it as well: <a href="https://docs.nvidia.com/cuda/wsl-user-guide/index.html">NVIDIA’s WSL guide</a> says GPU acceleration is available in WDDM mode and not on Quadro GPUs in TCC mode, the compute-only alternative.</p><p>This cost has been discussed for years on NVIDIA’s developer forums, and those posts line up with our numbers:</p><ul><li>A <a href="https://forums.developer.nvidia.com/t/cudalaunch-overheads/64508">2018 reply</a> puts minimal launch overhead at “around 5 usec” on Linux and on Windows with the TCC driver. It says launches on WDDM are “batched to mitigate the massive overhead imposed by the WDDM driver model”. We measured 5.5 µs on Linux.</li><li>A <a href="https://forums.developer.nvidia.com/t/very-slow-kernel-launches/37345">2015 thread</a> explains that on WDDM the driver holds work back until the batch reaches a set size or “until you request the work to complete”.</li><li>A <a href="https://forums.developer.nvidia.com/t/tesla-compute-cluster-driver/18286">2010 reply</a> says batching hides much of the cost, but for iterative algorithms with short kernels the driver model “can make a major performance difference”.</li></ul><p>That batching may explain why our sync column shows the largest gap. Launches can be grouped, but .item() asks for the answer now, so the work has to be submitted and waited on. A token loop that samples every token can&#39;t avoid that for long.</p><p>Treat this explanation as well supported, but not proven. These posts are old, and they come from forum users rather than formal NVIDIA documentation. We also didn’t test WDDM in isolation. And a slow operation isn’t always the driver’s fault: <a href="https://janeasystems.com/blog/pytorch-matrix-multiplication-cuda-bug">Janea Systems traced one Windows matrix-multiplication slowdown</a> to a code path in PyTorch’s CUDA implementation. To isolate WDDM, the next test would be Windows with TCC on a card that supports it and isn’t driving a display.</p><h3>What this test doesn’t show</h3><p><strong>We haven’t measured the speech model itself on native Linux.</strong> This is a micro-benchmark. A live USB session isn’t a practical place to run our full Docker stack and 14 GB of models, so we don’t yet know the real RTF on Ubuntu, or whether it drops below 1.0. Per-call costs fell by 2.5–4.4×, but RTF also depends on work that doesn’t change, so it won’t simply scale by those numbers.</p><p>There is one encouraging pointer. In an earlier test, under native Ubuntu in another PC, the same card reached 100% GPU use at 68 W on this model, about as fast as the GB10. But that used a different CPU and possibly different text, so it’s only a hint.</p><p><strong>The runs weren’t perfectly matched.</strong> These differences could affect the numbers, and we didn’t test each one:</p><ul><li><strong>Driver:</strong> 597.30 on Windows and WSL, 580.178.04 on Ubuntu.</li><li><strong>Display:</strong> on Windows the A2000 was driving the desktop. On Ubuntu, nvidia-smi showed 0 MiB in use and no processes before the runs, so the desktop wasn&#39;t using the card&#39;s compute memory.</li><li><strong>GPU load:</strong> on rows A–D our speech model was loaded but idle in GPU memory and the app stack was running. Row E had an empty GPU.</li><li><strong>Python:</strong> 3.10 on Windows, 3.11 in the container, 3.12 in the WSL venv and on Ubuntu.</li><li><strong>Kernel:</strong> 6.18 under WSL 2, 7.0 on Ubuntu.</li></ul><p><strong>The sample is small.</strong> This is one PC, with three runs per configuration. Run-to-run spread was small on most rows, though row B’s launch and matvec numbers were noisier (launch 14.5–22.2 µs). The full ranges are in the appendix.</p><h3>What you can do</h3><p><strong>Measure before you buy hardware.</strong> Run the script on your own machine. It takes seconds, and a large gap between launch and sync on Windows tells you more than a GPU spec sheet.</p><p><strong>Check your GPU use.</strong> If a CPU thread is pinned and the GPU is well below full use with its clock falling, your bottleneck may be call overhead, and a faster GPU may not help.</p><p><strong>Try Linux for this kind of workload.</strong> You can test it without touching your disks, using a live USB as we did.</p><p><strong>Reduce the number of small calls.</strong> Fewer .item() calls and fewer launches per step help on every platform, but most where each call costs most. We plan to try CUDA graphs and torch.compile for the decode step, though we have no results to report yet.</p><p><strong>Set expectations for Windows users.</strong> Our app’s Windows users will need to generate audio ahead of time rather than listen live, at least on mid-range cards like this one.</p><h3>Run it yourself</h3><p>Save the script as launch_overhead.py. Then, on Linux or WSL 2:</p><pre>python3 -m venv torchtest<br>torchtest/bin/pip install torch==2.9.1 --index-url https://download.pytorch.org/whl/cu128<br>torchtest/bin/python launch_overhead.py</pre><p>On Windows, in PowerShell:</p><pre>py -m venv torchtest<br>torchtest\Scripts\pip install torch==2.9.1 --index-url https://download.pytorch.org/whl/cu128<br>torchtest\Scripts\python launch_overhead.py</pre><p>You may see a harmless “Failed to initialize NumPy” warning. Stop anything else that’s using the GPU first, and use the same power settings for every run.</p><p>To test native Ubuntu without installing it, we used Ubuntu 24.04.5 on a USB stick made with Rufus, with a persistent partition so that installs survive a reboot. We picked “Try Ubuntu”, never “Install”:</p><ol><li>At the boot menu, press e and add modprobe.blacklist=nouveau to the linux line.</li><li>Install the driver with sudo apt install linux-headers-$(uname -r) nvidia-driver-580, then run sudo modprobe nvidia.</li><li>Install python3-venv with apt, then follow the Linux steps above.</li></ol><p>If you run it, we’d like to hear your numbers, especially from a different CPU or from Windows with TCC.</p><h3>Appendix: run details</h3><p>Row E, per run, from the logs (µs):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*qqyVnXYAl-C_ssWCl7Mxtg.png" /></figure><p>Rows A–D, median and range over three rounds, run back to back with the GPU otherwise idle (µs):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*3NLs3D9Hg2sv01g8G-KeQw.png" /></figure><p>Test machine: AMD Ryzen 7 3700X, 64 GB RAM, ASUS PRIME B550M-A, NVIDIA RTX A2000 12 GB. Windows 11 Pro 24H2 with WSL 3.0.3, Power Mode “Best Performance” and NVIDIA “Prefer maximum performance”. Ubuntu 24.04.5 live USB, kernel 7.0.0–31, Python 3.12.3. We discarded one set of early row A runs because a large download was running at the same time.</p><h3>References</h3><ul><li>NVIDIA, <a href="https://docs.nvidia.com/cuda/wsl-user-guide/index.html">CUDA on WSL User Guide</a></li><li>NVIDIA Developer Forums, <a href="https://forums.developer.nvidia.com/t/cudalaunch-overheads/64508">cudaLaunch overheads</a> (2018)</li><li>NVIDIA Developer Forums, <a href="https://forums.developer.nvidia.com/t/very-slow-kernel-launches/37345">Very slow kernel launches</a> (2015)</li><li>NVIDIA Developer Forums, <a href="https://forums.developer.nvidia.com/t/tesla-compute-cluster-driver/18286">Tesla Compute Cluster driver</a> (2010)</li><li>NVIDIA Developer Forums, <a href="https://forums.developer.nvidia.com/t/tf-and-pytorch-are-slower-on-windows-than-on-linux/77064">TF and Pytorch are slower on Windows than on linux</a> (2019)</li><li>Janea Systems, <a href="https://janeasystems.com/blog/pytorch-matrix-multiplication-cuda-bug">Diagnosing a matrix multiplication performance issue in PyTorch</a> (2024)</li></ul><h3>All the results</h3><p>We changed one thing at a time on the same PC. The GB10 row comes from a different machine, running the same script.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74a4b4a930fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>