Skip to content

strix-halo: ROCm Whisper, pinned Gufo and the gfx1151 deployment - #155

Open
smfworks wants to merge 16 commits into
jayleaton:mainfrom
smfworks:amd-split/3-strix-whisper-gufo
Open

smfworks wants to merge 16 commits into
jayleaton:mainfrom
smfworks:amd-split/3-strix-whisper-gufo

Conversation

@smfworks

@smfworks smfworks commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Part 3 of 5 (split from #152).

Stacked: this branch is Part 1 plus a merge of Part 2, then 4 commits of its own (whisper ROCm venv, Gufo, the profile and deploy kit, and the review fixes in b46deec). Until Parts 1 and 2 merge, the diff here includes them; review the commits after the merge commit.

The ROCm Whisper venv, Gufo in rootless Podman, and the strix-halo-gfx1151 profile with its deploy kit. Fixes from the review of #152:

  • Torch wheel hash: tools/speech/whisper/rocm/uv.lock now carries the wheel's sha256 (2ad8066c…52f0) and size. tools/install/check_hashes.py rejects any uv.lock or requirements*.txt artifact that isn't pinned by sha256 (7 tests); CI runs it over the whole checkout.
  • Pinned downloads:
    • tools/gufo/IMAGE = ghcr.io/gufo-org/toolboxes/gufo-runtime:0.34.0@sha256:49b1fce40cb43e33c46d91595e300cb320cdec768fcd976f8c8da24b402fc133. serve.sh refuses a reference without a digest unless GUFO_ALLOW_UNPINNED=1.
    • Hugging Face weights come from deploy/strix-halo/pins/*.json (revision plus every file's size and sha256) through tools/install/hf_pinned.py (download / verify / files / pin, standard library only, 12 tests). A step counts as done only after a full sha256 check; later checks compare sizes.
  • GUFO_IMAGE reaches the workers: start.sh passes GUFO_IMAGE (plus GUFO_ALLOW_UNPINNED / GUFO_STOP_TIMEOUT when set) into the transient unit. deploy/strix-halo/test_start.sh checks this with stub systemd-run, systemctl, curl and podman (11 checks; 3 pass on the old start.sh).
  • diagnose is a GPU step: the image pull and digest check form one step, and gufo-diagnose is a separate step with gpu: true, so --no-gpu skips it.
  • CI: bash -n covers deploy/strix-halo/*.sh and tools/gufo/*.sh; new steps run the hash check, test_hf_pinned and test_start.

On gfx1151 (Radeon 8060S): the unit's environment carried the pinned image, the Gufo containers ran that digest, and transcription options behaved as in Part 2 (temperature 0.7 → Gufo's own 400 "supports temperature 0 only"; word → 400 from the worker; segment → one whole-clip segment; default → 200).

Checks run locally: zig build test, zig build test-unit (26/26), test_amd, audio, check_hashes (9/9 lock files), test_check_hashes, test_hf_pinned, test_start, syntax, git diff --check.

lib.sh: when nvidia-smi sees no GPU, hw_gpu/hw_driver/hw_vram/hw_summary read the
first amdgpu card (sysfs) and rocminfo (marketing name, gfx target), hw_rocm the ROCm
version, hw_gtt/hw_gtt_used the GTT pool an APU's GPU maps. hw_match gains optional
hardware.min_rocm, hardware.gfx and hardware.min_gtt_gib. The NVIDIA and macOS paths
are unchanged.

doctor.sh: the free-memory warning reads hardware.min_free_gib (default 88, as before)
and, on AMD, shows GTT in use and AMD-side hints; a deploy.service of
"systemd-transient" (systemd-run --user) is checked by is-active instead of a unit file.
…he CPU

tools/install/test_amd.sh runs lib.sh's detection against four recorded hosts in
tests/fixtures/amd (a sysfs tree, rocminfo output, ROCm's version file and
nvidia-smi answers; no GPU needed):
- strix-halo: Radeon 8060S (gfx1151) APU, 96 GiB GTT, a 4 GiB carve-out that is not
  VRAM, connector entries (card1-DP-1) beside the card
- discrete: an Intel CPU and iGPU beside a Radeon RX 7900 XTX with real VRAM
- nvidia: an NVIDIA GPU and an AMD card on one box; the NVIDIA path wins and says
  what it said before AMD detection existed (checked against main's lib.sh)
- none: no GPU

The fixtures caught one bug: amd_name took the first rocminfo Marketing Name that
was not an AMD CPU, so an Intel CPU agent named the GPU. It now takes the first
agent whose Device Type is GPU. LR_SYSFS (default /sys) points the sysfs reads at
a fixture. CI runs the script.
…rver

tools/speech/openai_audio/worker.py serves speech (POST /v1/audio/speech, raw PCM
streamed into speech.wav) and transcription (POST /v1/audio/transcriptions ->
transcript.json) through a model's own server, which it starts from options.server
({port}, {id}, {weights}) and stops on exit, as openai_server does for chat; or an
existing options.url. Standard library only. Server 4xx -> invalid_request_error,
503/unreachable -> service_unavailable; 64-bit seeds are folded to 32 bits.
test_worker.py runs it against a fake server (no GPU).
Review of 944f585: transcription replaced the requested temperature with 0 and
ignored timestamp granularity, so temperature=0.7 with timestamps=word succeeded
with no words.

- temperature, language and prompt go to the server as asked. A server that cannot
  honour one refuses it, and the caller gets that 400 with the server's reason
  (Gufo's Qwen3-ASR: "supports temperature 0 only").
- options.timestamps lists the granularities the server returns ([] by default).
  A request for a listed one asks for verbose_json with that
  timestamp_granularities[] (word also asks for segment when listed), and a reply
  without them is a server_error, never a transcript missing what was asked.
- word not listed is refused (invalid_request_error) before the server is asked.
  segment not listed keeps the whole clip as one segment, since the daemon asks for
  segments for every verbose_json, srt and vtt reply.

The fake server now records each request's form fields: 23 checks (was 8),
covering forwarding, refusals and both timestamp configurations. CI runs them.
…Strix deployment runs)

# Conflicts:
#	.github/workflows/ci.yml
tools/speech/whisper/rocm/{pyproject.toml,uv.lock}: the same worker and pins as the
Spark, with torch and triton-rocm from PyTorch's ROCm 7.2 index for x86_64 Linux AMD
GPUs. The existing lock is untouched. Measured on gfx1151: WER 4.09% on 73
LibriSpeech clips, 17x real time.
serve.sh NAME PORT [podman opts] -- gufo serve ...: foreground, loopback-only, stops
the container on SIGTERM and waits so GPU memory is free; --replace clears leftovers;
video/render groups by name (keep-groups needs crun).
AMD Strix Halo (Radeon 8060S, gfx1151, 96 GiB GTT): Qwen3.8 Flash-Next chat via Gufo
(Q4 + MTP) and llama.cpp (Q3 + MTP) as openai_server tools, Qwen3-TTS and Qwen3-ASR via
Gufo behind openai_audio, Whisper on ROCm. budget_bytes = GTT less 2 GiB. The daemon
runs as a transient systemd user unit (render/start/stop/status.sh); site files
override env.sh. Tested end to end: /v1 chat, /v1/audio, and the voice loop
(voice_e2e.py --smoke) passing with 1.2-1.4 s first audio on warm turns.
…as a GPU step

Review of 944f585:
- Torch wheel unhashed (whisper/rocm/uv.lock): PyTorch's index publishes no digest,
  so the wheel's sha256 (2ad8066c..., 6227849000 bytes) is added by hand. uv sync
  --locked refuses other bytes (checked with a one-digit change: "Hash mismatch").
  tools/install/check_hashes.py refuses any uv.lock or requirements*.txt artifact
  without a sha256; CI runs it over the checkout, and its tests.
- Gufo pinned by digest: tools/gufo/IMAGE is gufo-runtime:0.34.0@sha256:49b1fce4...
  (engine 2845939b, the build measured here). serve.sh refuses a reference without a
  digest unless GUFO_ALLOW_UNPINNED=1; the profile's step checks the pulled digest.
- Hugging Face weights by commit, every file by size and sha256: pins/*.json for
  Flash-Next Q4 and Q3 (f5d175de), Qwen3-TTS CustomVoice (0c0e3051) and Qwen3-ASR
  (7278e1e7). tools/install/hf_pinned.py downloads the manifest's files at its
  revision through hf (resumable) and verifies them; done is a stamp of the manifest
  plus a size check. The local copies on the test box verify against all four.
- GUFO_IMAGE reaches the workers: start.sh passes it (and GUFO_ALLOW_UNPINNED,
  GUFO_STOP_TIMEOUT when set) into the transient unit; env.sh defaults it from
  tools/gufo/IMAGE. deploy/strix-halo/test_start.sh runs start.sh with a stub
  systemd-run that gives the daemon only --setenv values and a stub podman that
  records the image: default, exported and site-file overrides, a digest-less
  refusal (11 checks; 3 pass against the old start.sh).
- gufo diagnose is its own step, gpu: true, so --no-gpu skips it; the image step only
  pulls and checks the digest.
- CI: bash -n over deploy/strix-halo/*.sh and tools/gufo/*.sh; the hash check,
  hf_pinned tests and the unit test.

@jayleaton jayleaton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the earlier pinning, environment and GPU-step findings are all addressed:

  • The Torch ROCm wheel has a SHA-256 and size.
  • Gufo is pinned by digest, and the wrapper rejects unpinned references by default.
  • The HF manifests carry revisions, sizes and hashes, and first downloads are fully verified.
  • GUFO_IMAGE reaches the transient unit, and the 11 regression checks pass.
  • gufo-diagnose has gpu: true.
  • CI now runs the new suites and the script syntax checks.

Blocking, inherited from #154 (tools/speech/openai_audio/worker.py:147). This branch carries #154's detached model server, so a daemon abort can SIGKILL the worker and leave the server running on the GPU. Please bring #154's lifecycle fix and its test into this branch. #155's own commits have no other blockers.

Merge order: #154, then this one.

The model's server no longer gets a session of its own (start_new_session):
it stays in the worker's process group, so the daemon's SIGKILL of that group
on abort or timeout takes it down too, and PR_SET_PDEATHSIG (SIGTERM) covers
the worker dying alone. Before, a hard kill left the server, and a Gufo
container behind it, holding the GPU. An unload now signals the server and
every process below it (/proc children) instead of its group.

Seed 0 was dropped by a truthiness check: a request's seed is sent whenever it
has one and send_seed is on.

Tests: SIGKILL of the worker's group mid-generation, the server is gone
(fails on the old worker: the server outlived it); the server receives seed 0;
no seed, none sent; send_seed false, none sent.
With the openai_audio worker's server now in the worker's process group, the
daemon's SIGKILL of that group (abort, timeout) kills serve.sh and the podman
client, but not the container: conmon runs it outside the group, and the
SIGTERM trap never runs. serve.sh starts a watcher in its own session that
removes this run's container, by its --cidfile id (never a later run's of the
same name), once the script is gone.

test_serve.sh (8 checks, stub podman whose container is outside the group):
SIGKILL of the group removes the container, by id, and the watcher cleans up;
SIGTERM still stops it through the trap; a run started right after a killed
one keeps its container. 3 of them fail on the old serve.sh. CI runs it.
@smfworks

Copy link
Copy Markdown
Contributor Author

Review fixes pushed (new commits, no force-push):

— SMF Works

@jayleaton jayleaton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2: thanks, the openai_audio lifecycle and seed fixes are in (#154 is merged as f902361). One blocker is left:

Blocking: tools/gufo/serve.sh:33. kill -0 counts a zombie as alive. If a subreaper keeps serve.sh around unreaped, a SIGKILL of the whole group leaves the container running even after the worker has been reaped, because cleanup only starts after waitpid(serve.sh). Please use an exit check that recognises zombies, such as polling a pidfd or reading the State: line in /proc/<pid>/status. Please also add a test that deliberately delays reaping.

Please also merge main in again now that #154 has landed.

ci.yml: keep this branch's steps after main's openai_audio step.
…cannot keep the container

The watcher polled serve.sh with kill -0, which succeeds on a zombie. If a
subreaper left serve.sh unreaped after a SIGKILL of the worker's group, the
container kept running until the reap. The watcher now reads the State:
line in /proc/<pid>/status and stops waiting on Z (or X); kill -0 remains
only where /proc is not mounted.

test_serve.sh: a parent that does not reap serve.sh for 60 s; after the
group SIGKILL serve.sh is a zombie and the container must be removed (by
its id) while it still is. 3 new checks; the old watcher fails 2 of them.
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 19, 2026
…ts a zombie serve.sh as gone) into amd-split/5-minimax-workflows
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 19, 2026
…to this branch

# Conflicts:
#	tools/gufo/test_serve.sh
@smfworks

Copy link
Copy Markdown
Contributor Author

Round 2 fix in 555c77c. The watcher now reads the State: line in /proc//status and treats Z (or X) as gone, so a parent that's slow to reap no longer keeps the container running. It only falls back to kill -0 where /proc isn't mounted. New check in test_serve.sh: a parent that doesn't reap serve.sh for 60 s; after the group SIGKILL, the container has to be removed by its id while serve.sh is still a zombie. That's 3 new checks, and the old watcher fails 2 of them. main (#154) was already merged in at fe1ebe5.

@jayleaton jayleaton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 3: the zombie fix is verified. The old watcher failed both delayed-reap checks, and this head passes all 11 Gufo checks, including removing the container by ID while serve.sh is a zombie. One blocker:

Blocking: .github/workflows/ci.yml:35. This conflicts with #156, which is now on main as a3c28f6. Please rebase onto main and keep both the ComfyUI worker check and the Gufo/Strix checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants