Repository navigation
lemond-onebit: the *-HRX rows ran upstream's hrx-b99 - point that recipe at the payload's own HRX backend - #3472
Conversation
…ipe at the payload's own HRX backend Lemonade's stock llamacpp-hrx recipe (upstream's, not our onebit recipe) is what the *-HRX catalogue rows name. Nothing in the release package pointed it at a local build, so lemond's BackendManager downloaded llamacpp-hrx/hrx (version.txt hrx-b99) on first use and ran that. On 1bit OS it registers no GPU: llama-server --list-devices printed "Available devices: (none)" under lemond's environment, and a load failed with 'error while handling argument "--device": invalid device: HRX0' (engine#3399, measured on v2026.48; the appliance's live catalogue lists 29 of those rows). The stock recipe's build_server_environment() adds only GGML_DISABLE_VULKAN to the child (third_party/lemonade src/cpp/server/backends/hrx/hrx_server.cpp), and the running lemond's environment carries the save-area trio + LD_LIBRARY_PATH but no IREE_HAL_AMDGPU_LIBHSA_PATH - the state scripts/hrx-env.sh:24-28 measures as "the system ROCr, which with HSA_USE_SVM=0 registers no HRX0". The payload already ships an HRX llama-server built from our pins (1bit/hrx/llama/bin, scripts/package-linux.sh:59) and the shim that gives it serve's HRX environment (1bit/lemonade-hrx, scripts/package-linux.sh:202). The one place that should have wired the two together is the launcher every appliance start goes through (os/v3/puppy/embed/etc/init.d/10lemonade -> /opt/1bit-package/lemond-onebit), and it did not: - scripts/lemond-onebit.sh: export LEMONADE_HRX_HRX_BIN to $here/1bit/lemonade-hrx unless the caller set it. Lemonade reads that name before hrx.hrx_bin in config.json (backend_utils.cpp:319-381 get_bin_config_value builds "LEMONADE_" + section + "_" + bin_key), and a path makes find_external_backend_binary return it before install_from_github's needs_install check (backend_utils.cpp:332-368, :540-548), so the upstream download stops happening too. A caller's value wins and `builtin` is the documented opt-out to Lemonade's own download. - tests/lemond_onebit.sh (+ ctest row lemond_onebit): the launcher's environment and argv as a fake payload's bin/lemond records them; no build, no device, no engine. - os/mini/release-check.sh: row hrx-recipe reads the RUNNING lemond's environment (lemond_environ, the listener found by socket inode as lemond_key does) and fails when it names no payload backend, or a path that does not exist or is not executable; skips when the image starts lemond without the package launcher, the catalogue has no -HRX row, or the environment cannot be read. hrx_recipe_verdict is pure and --self-test drives six cases including the empty value (the v2026.48 state). - docs/lemonade.md: the appliance/package wiring next to the Ubuntu PPA one. Evidence (host, this branch): $ ctest --test-dir build -R 'lemond_onebit|release_check_selftest' 1/2 Test #45: lemond_onebit .................... Passed 0.06 sec 2/2 Test #50: release_check_selftest ........... Passed 0.66 sec Control - the same test against origin/main's launcher, in a throwaway copy with only the new test: $ bash tests/lemond_onebit.sh # branch ... PASS: tests/lemond_onebit.sh (rc 0) $ git show origin/main:scripts/lemond-onebit.sh > prefix/scripts/lemond-onebit.sh $ bash prefix/tests/lemond_onebit.sh FAIL LEMONADE_HRX_HRX_BIN names the payload's lemonade-hrx FAIL the named path is the executable the payload ships FAILED: tests/lemond_onebit.sh (rc 1) $ scripts/pre-pr-checks.sh --tree-only --base origin/main pre-pr-checks: all 16 check(s) green, 2 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only) (the two skips are tools/ci/hip_f16_audit.py and tools/ci/kernel_id_selftest.py finding no gpu-kernels tree on this host - environment, not the diff) NOT RUN: the on-device control. The strixhalo box was queue-deep (one holder plus about ten box-hold tickets from other lanes), so the running lemond's environ and a -HRX load on HRX0 were NOT measured. The staged one-ticket script is /home/bcloud/l3399/run.sh on the box (re-copy scripts/lemond-onebit.sh to /home/bcloud/l3399/lemond-onebit-new first): ssh strixhalo "BOX_HOLD_WHO=<who> box-hold both 'sudo -n timeout 900 bash /home/bcloud/l3399/run.sh'" It prints the stock --list-devices matrix, the OLD launcher's lemond load of Qwen3-4B-Instruct-2507-HRX (expected to fail with invalid device: HRX0) and the NEW launcher's load + chat completion on HRX0. Without it this commit claims the wiring the fork's code and the host row assert, not that a -HRX model answers. Refs #3399
12f9dfe to
ff8ca9d
Compare
PR Reviewer Guide 🔍(Review updated until commit de2263d)Here are some key observations to aid the review process:
✅ Resolved findingsscripts/lemond-onebit.sh:41Default value may not be portable The default value for os/mini/release-check.sh:1227-1244Incorrect environment variable handling The |
… --port literal the row feeds the stub (engine#3399)
|
Persistent review updated to latest commit de2263d |
What was wrong
Lemonade's stock
llamacpp-hrxrecipe (upstream's, not ouronebitrecipe) is what all 29*-HRXcataloguerows name. Nothing in the release package pointed it at a local build, so lemond's BackendManager downloaded
llamacpp-hrx/hrx(version.txt=hrx-b99) on first use and ran that. On 1bit OS it registers no GPU —issue #3399 measured
llama-server --list-devices→Available devices: (none)under lemond's environment, anda load failing with
error while handling argument "--device": invalid device: HRX0— so every-HRXrow wasunloadable on the appliance (unaffected: the engine's own
onebitroute).Mechanism, read from the pinned fork and the box:
build_server_environment()adds onlyGGML_DISABLE_VULKANto the child(
third_party/lemonade/src/cpp/server/backends/hrx/hrx_server.cpp), and the running lemond's environment(measured on strixhalo,
/proc/<lemond>/environ) carries the save-area trio +LD_LIBRARY_PATHbut noIREE_HAL_AMDGPU_LIBHSA_PATH. That is the statescripts/hrx-env.sh:24-28records as "the system ROCr,which with
HSA_USE_SVM=0registers no HRX0" (engine#674/hrx: gfxhub permission page faults (UTCL2 client CPF) on the rebuilt box with the TheRock nightly libhsa — the no-SVM env trio is the only fault-free arm #715) — so--list-devicesprints(none)and therecipe's hardcoded
--device HRX0is rejected.llama-serverbuilt from our pins(
1bit/hrx/llama/bin,scripts/package-linux.sh:59) and1bit/lemonade-hrx, the shim that starts it in theenvironment
1bit serve --print-backend-envbuilds for an HRX backend (strict placement, TheRock HSA runtime,CWSR, trio;
scripts/package-linux.sh:202).os/v3/puppy/embed/etc/init.d/10lemonade→/opt/1bit-package/lemond-onebit— and it did not.The change
scripts/lemond-onebit.sh:export LEMONADE_HRX_HRX_BINto$here/1bit/lemonade-hrxunless the caller setit. Lemonade reads that name before
hrx.hrx_bininconfig.json(
backend_utils.cpp:319-381,get_bin_config_valuebuilds"LEMONADE_" + section + "_" + bin_key), and apath makes
find_external_backend_binaryreturn it beforeinstall_from_github'sneeds_installcheck(
backend_utils.cpp:332-368,:540-548) — so the upstream download stops happening too. A caller's value wins,and
LEMONADE_HRX_HRX_BIN=builtinis the documented opt-out back to Lemonade's own download.tests/lemond_onebit.sh+ ctest rowlemond_onebit: runs the launcher over a fake payload whosebin/lemondrecords its environment and argv; asserts the new variable, the path it names, the argv, thecaller-wins and
builtinarms, and carries a control arm that rebuilds the pre-fix launcher and shows it handslemond no variable. No build, no device, no engine.
os/mini/release-check.sh: a newhrx-reciperow reads the running lemond's environment(
lemond_environ, the listener found by socket inode aslemond_keydoes) and FAILs when it names no payloadbackend, or a path that does not exist / is not executable; SKIPs when the image starts lemond without the
package launcher, the catalogue offers no
-HRXrow, or the environment cannot be read. The verdict is a purefunction and
--self-testdrives six cases, including the empty value that is the v2026.48 state.docs/lemonade.md: the appliance/package wiring, next to the existing Ubuntu-PPA section.Evidence — host side
Control — the same new test against
origin/main's launcher (throwaway copy, new test file only), i.e. thepre-fix tree:
Gate:
The two skips are
tools/ci/hip_f16_audit.pyandtools/ci/kernel_id_selftest.pynot finding a gpu-kernelstree on this host (
GPU_KERNELS_DIRunset) — environment, not the diff.NOT verified — the on-device control
The strixhalo box was queue-deep (one holder plus ~10
box-holdtickets from other lanes), so the on-devicecontrol was not run: neither the running lemond's environ showing
LEMONADE_HRX_HRX_BIN, nor a-HRXmodelloading and answering on HRX0. This PR therefore claims the wiring that the fork's own code and the host-side row
assert — not that a
-HRXmodel answers.One ticket, already staged on the box (
/home/bcloud/l3399/run.shcontains a read-only stock-backend env matrix,the OLD launcher's lemond load of
Qwen3-4B-Instruct-2507-HRX— expected to fail withinvalid device: HRX0—and the NEW launcher's load + chat completion on HRX0):
That control would prove what the host-side row cannot: that lemond, in the appliance's own environment, actually
starts the payload's
lemonade-hrxand that the resultingllama-serverregisters HRX0 and answers — the closurecriterion in #3399. The host row only proves that the environment names an existing executable.
Review risk
LEMONADE_HRX_HRX_BIN=builtin(documented indocs/lemonade.md).hrx-reciperelease-check row will FAIL on any image whose lemond was not started throughlemond-onebit(e.g. started by hand asbin/lemond); that is intended, but it is the row most worth a secondlook before it ships.
1bit/lemonade-hrxis a script, and Lemonade'svalidate_bin_pathonly requires the path to exist; the row andthe ctest test check
-x, andscripts/package-linux.shnormalises modes, so a non-executable shim is notexpected — but if a packaging change ever drops the execute bit,
-HRXloads fail with a config error ratherthan silently downloading upstream's bundle.
Refs #3399
Rebased onto main
c18d690(24 Nov, 08:50Z). The branch was 11 commits behind and conflicted only with #3437's NPU idle-eviction row: main addednpu_idle_evict_verdictand its self-test cases exactly where this PR addshrx_recipe_verdictand its own, so both sides are kept - the rebase drops nothing (5 files, +202/-0, the same diff as before). Re-ran on the rebased tree:tests/lemond_onebit.shPASS,os/mini/release-check.sh --self-testPASS,scripts/pre-pr-checks.sh --base origin/main16 green, 4 skipped, 0 cannot-tell.mergeableis now MERGEABLE; the pending checks are this push's run.