Repository navigation
os: efivarfs and efibootmgr in the image, and the installer registers the disk's boot entry (#709) - #726
os: efivarfs and efibootmgr in the image, and the installer registers the disk's boot entry (#709)#726bong-water-water-bong wants to merge 8 commits into
Conversation
…ence, not a feature) (#687) * onnx: dynamic int8 probe - +43-51% prefill, -5% decode, KL 0.28 (not shippable) The arithmetic in BENCHMARK-PARITY.md round 3 says the CPU path can only improve by changing precision: prefill is FLOP-bound at ~760 GFLOP/s, decode re-reads 2.4 GB of fp32 per token. This measures the obvious candidate. It delivers on half of it. int8 dynamic weights: prefill 1141 -> 1628 tok/s at 512 and 567 -> 860 at 2048, peak RSS 6.60 -> 4.68 GB, but decode is 5% slower and greedy output changes at the second token (mean KL 0.28 nats, top-1 1/4). The numbers and the three variants that were worse are in the script docstring, so the next person does not repeat them. The accurate route is static QDQ with calibration or int4 MatMulNBits, both bigger than this file. * onnx: add the Apache-2.0 per-file notice to quantize_cpu.py tools/copyright.py --check is the first thing CI runs and it was failing on the new file. * onnx: quantize_cpu.py carries both boxes' numbers in the two cells that do not reproduce pi-prs blocked this at `25914e3` on the evidence table, not the code: `prefill 2048` and `peak RSS` were one box's numbers presented as the result, and on strixhalo they differ -- +51 % becomes +24 % (the int8 figures agree, 860 vs 841; the fp32 baselines do not, 567 vs 680), and RSS flips sign (6.60 -> 4.68 GB on ryzen, 7537 -> 8011 MB here). Both cells now carry both boxes, and peak RSS is stated as a non-result: the weight file shrinking 4x is the durable part and it is not what that row measures (the plausible cause of the growth is the per-call quantise/dequantise buffers dynamic quantisation allocates at 2048 prefill). The conclusion that depends on them is rewritten to say where the percentages come from, and nothing else in the file moves -- it still says "not shippable", which is the point of keeping it. --------- Co-authored-by: bong-water-water-bong <[email protected]>
25d035a to
a4689c8
Compare
…NPU serve (engine#682) (#716) Every GPU step was wrapped in `flock ~/npu.lock`, so with an NPU serve up the gate queued behind it: flock is not first-come-first-served, waits ran 10-60 minutes, and c16's gate was cut three times by its own 20-minute hold while it waited. The premise for taking the lock is gone - engine#673 measured NPU and GPU running concurrently with no FCLK hazard and ~87 % of the NPU stream's bandwidth kept while the GPU is busy (7.40 GB/s against 8.2-8.5 idle, 10.5-10.9 ms -> 12.0 ms per launch, 160/160 byte-exact, zero resets), and the fleet rule that came out of it is that an NPU run takes the NPU device lock and nothing else. So gpu() no longer takes it. The NPU phase still does, because an NPU dispatch must not overlap another NPU dispatch, and the GPU token, the cool-down, mem-guard and coder-llm idling are untouched. rc 75 (flock's lock-timeout code) is no longer produced by a GPU step, so the three callers that treated 75 and 76 alike now treat 76 only (the memory pre-check's refusal), and the summary says "running the step" instead of "holding ~/npu.lock". tests/hw_gate_test.py grows a script invariant that reads scripts/hw-gate.sh: gpu() must not contain flock, the NPU phase must. Verified both ways - it FAILs with the old line put back. Measured on this box: bash -n, shellcheck -S warning (clean), tests/hw_gate_test.py PASS. No GPU or NPU claim was taken; the on-device proof is the next gate run (c19), where the gate should no longer wait for the NPU lock line in its summary. Co-authored-by: bong-water-water-bong <[email protected]>
… region (TZEROCOPY target 1) (#714) * serve: hybrid prefill without a state file, over the decoder's own KV region (target 1) ONEBIT_KV_SHARE=1 turns the file handoff into an fd handoff. Per request the engine listens on a unix socket inside the slot directory, POSTs /slots/0?action=share {"socket": ...} so the decoder exports its KV buffers and sends {fd, offset, size, layout} per region, receives them, writes the header next to the fds and runs the provider with --layout <file> --fds <n[,n...]>; the provider maps those fds as its own KV tensors and prefills the prompt into them; then /slots/0?action=adopt {"tokens": [...]} gives the decoder the cells with no data movement. The provider never writes a state file and the request never reads one back. The file route is untouched and stays the default; a shared handoff that fails says why once per request and the request is forwarded as it came (the backend prefills it itself), exactly like the file route. Measured on strixhalo (logs in the state file): identical greedy text to --device hrx on 3 prompts, and the handoff is 0.02-0.05 ms flat in prompt length where the file route is tens to hundreds of ms. Docs: docs/hybrid.md gets the second provider contract (--layout/--fds) and the reason the fds have to travel over a socket (no dma-buf reopen from /proc/<pid>/fd). * serve: quote the share_id in the adopt (the decoder refuses cells no export produced) --------- Co-authored-by: pi-zerocopy <[email protected]>
… (#718) * hyperloom custom: every measurement runs HRX with SVM off (engine #715) The nightly libhsa page-faults on an HRX allocation unless HSA_USE_SVM=0, HSA_USERPTR_FOR_PAGED_MEM=0 and HRX_ALLOW_NO_SVM=1 are set, so the entrypoint defaults all three before it claims the GPU FIFO. An explicit setting still wins, which leaves the lever available to a candidate. * hyperloom custom: the measurement joins the real GPU FIFO, not the sandbox's Hyperloom runs the entrypoint under a fresh HOME (its preflight writes into ~/.claude/config.json), and gpu-hold defaults GPU_TOKEN_FILE/GPU_QUEUE_DIR to $HOME. Under that sandbox the claim was therefore taken on a private token in a private queue -- outside the box's fair queue, which is exactly what the claim exists to guarantee. Pin both paths to the password database's home, still overridable from the environment. * hyperloom custom: measure serve at a bounded context (HL_CTX, default 8192) Without -c, 1bit serve sizes the KV cache for the model's own context (262144 on Qwen3.8-27B: 16.1 GiB of KV) and then aborts on its own fit check unless the box is nearly idle. With another lane holding GTT that check rejected every candidate of the 2026-10-31 run for a reason unrelated to the lever under test. Pin the context so a measurement is reproducible; HL_CTX overrides it and is echoed into the report with the other levers. --------- Co-authored-by: bong-water-water-bong <[email protected]>
d6f220f to
6b755e1
Compare
a4689c8 to
1969c94
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At a4689c8c (+121 −6, 4 files). Verified against the kernel rather than the comment, and built the image.
efivarfs is really there, and the conditional staging takes the good branch on this kernel:
$ grep CONFIG_EFIVAR_FS /boot/config-7.3.0-rc4-1bit-perfopt+ -> CONFIG_EFIVAR_FS=m
$ modprobe -S 7.3.0-rc4-1bit-perfopt+ --show-depends efivarfs
insmod /lib/modules/…/kernel/fs/efivarfs/efivarfs.ko.xz
$ ./os/mini/mkimage.sh … -> "== efivarfs.ko for 7.3.0-rc4-1bit-perfopt+: staged (the installer can write a boot entry)"
image assembled, 110 modules, signer gate still clean
So the mechanism the installer needs (modprobe efivarfs + mount -t efivarfs) is available in the shipped kernel, and the "cannot write boot entries" branch is the fallback rather than the normal case.
The failure paths are the right ones. install.sh: fail 9 "efibootmgr is missing from this image" when the binary is absent, a distinct "no efivarfs in this kernel: firmware fallback" outcome when the module is missing (logged, not an install failure), and only then the efibootmgr write. vmtest.sh mirrors that: it probes modprobe efivarfs + mount first, checks the entry exists and is first in BootOrder, and SKIPs with an explicit line when the image's kernel has no efivarfs instead of failing an otherwise complete install. That pairing — a hard failure for a broken image, a stated skip for an incapable kernel — is exactly right.
The new build-time gate (refuse to build when a needed module is missing from the kernel tree, with efivarfs explicitly exempted and named) is a good addition too: it turns the silent pipefail abort it describes into a message that names the module.
bash -n clean on all four files.
Not verified: the boot-entry write and the OVMF boot-order assertion need the QEMU install gate (vt/ovmf varstore) — deferred while another lane's VM is live, and it is #727's subject anyway, so the two should share one gate run.
tprs-ready applied.
PR Reviewer Guide 🔍(Review updated until commit 0ebc88f)Here are some key observations to aid the review process:
|
…eck reads the backend argv (#737) The --gpu path could not work on Strix Halo. On 2026-10-31, with the shipped package (lemond 2026.46.0~5.ef0f3b49, engine 1bit/ from rc-2026-10-31c): == lemond listed: Check-HRX llamacpp-hrx [Info] (Process) 1bit serve: memory: need 1.31 GiB ... at ctx 4096, free 35.42 GiB [Error] (Process) error while handling argument "--device": invalid device: HRX0 [Error] (WrappedServer) llama-server process has terminated Two separate bugs, both in the harness: 1. --group-add puts the host render GID (990 here) on the container main process, but the script starts lemond with runuser -u lemonade, and runuser resets the supplementary groups to the image /etc/group - where stock ubuntu:26.04 has no render group at all. Measured in the container: --group-add 990,44: id -> groups=0(root),44(video),990(990) runuser -u lemonade -- id -> groups=1001(lemonade) setpriv --reuid lemonade --regid 1001 --groups 990,44 -- id -> groups=1001(lemonade),44(video),990(990) So lemond and its llama-server ran without GID 990, could not open /dev/kfd (crw-rw---- root:render), HSA never came up, libggml-hrx registered no device and llama-server rejected --device HRX0. The --gpu branch now passes the host render and video GIDs into the container and starts lemond with setpriv (without --init-groups: setpriv refuses it together with --groups). The no-GPU path still uses runuser. 2. The final check grepped /tmp/lemond.log for HRX0, but 1bit serve logs the memory it checked and not the device, so the check failed on a run that had in fact reached HRX0. It now reads the backend argv (/proc/<pid>/cmdline) and requires --device HRX0 there. Proven on this box, same command, after the patch: reply: 2 + 3 equals **5**. /opt/1bit/hrx/llama/bin/llama-server -m ... --ctx-size 4096 --device HRX0 --port 8001 --jinja --metrics --parallel 1 -ngl 99 --cache-reuse 256 GGML_HRX_REPORT=1 GGML_HRX_STRICT=1 IREE_HAL_AMDGPU_LIBHSA_PATH=/opt/rocm-therock/.../libhsa-runtime64.so.1 Inference completed: model=Check-HRX, tokens=33 (in=19, out=14), ttft=0.26s, tps=114.57 PASS and the no-GPU path (CPU stand-in) still passes. Co-authored-by: bong-water-water-bong <[email protected]>
b140507 to
bbbdeed
Compare
1b1f937 to
0ebc88f
Compare
…e docs say the device leg is done (#731) Two things #702 left behind, found while answering pi-ortep's question about which designs our |d| = 0 gate actually covers. The proof configured `full_i8_D_K3072_N1024.elf` in every device gate and no case ever used it, so a defect in that design could only have surfaced on a real model run. New case `quark-d`, 5x3072x1024 -- down_proj's own shape, next to the o_proj one that has had a case since the device leg landed: host: case quark-d: 0 of 5120 int8 values differ, worst |d|=0 LSB, path=fused device: case quark-d: 0 of 5120 int8 values differ, worst |d|=0 LSB, path=fused (ONEBIT_EP_NPU_ELFS=128x2048x1024=…O_K2048_N1024.elf,128x3072x1024=…D_K3072_N1024.elf, no `npu_qdq_fallback k=3072 n=1024` in the trace, so the array ran it) The fused-case floor goes 7 -> 8 so the new case cannot silently stop fusing. docs/onnx-pack.md said "Not done: the device leg of the fused path ... runs on the host today", which stopped being true when #702 merged. It is now a "Works" bullet with its measured gate (0 LSB on both shapes, no fallback line) and its two limits: an ELF is needed per (K, N) and only two Qwen3-0.6B projections have one (56 of 197 MatMuls on a real graph run on the array), and it is a correctness result, not a speed one -- the designs are M=128, so a decode step hands the kernel one real row. The two sentences downstream that leaned on the old bullet are corrected the same way. docs/onnx.md gains the paragraph the QDQ device path was missing: `gemm_q8` beside `gemm_f32`, `ONEBIT_EP_NPU_ELFS`, no `packB`/`amax/127`, the shared epilogue, and the fact that `qdq rows=` is written by both paths so the absence of a fallback line is what makes a run a device run. Co-authored-by: bong-water-water-bong <[email protected]>
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 0ebc88f9. The head has moved several times as the stack is reordered (its base is now #724's head and its author scope is the whole os/mini set), so this is a fresh check at the current tree rather than a patch-id carry.
Built an image at this head (36 s, EC_MODULE=skip AMDXDNA_KO=skip KVER=$(uname -r) LEMONADE=<prebuilt>):
== efivarfs.ko for 7.3.0-rc4-1bit-perfopt+: staged (the installer can write a boot entry)
signer: 109 Build time autogenerated kernel key
signer: 1 strixhalo Secure Boot Kernel
== 1bit-os.efi … == 1bit-os.img … (no UNSIGNED, no missing module, exit 0)
All six changed scripts parse (1bit-menu, init.sh, install.sh, mkimage.sh, prepare-stick.sh, vmtest.sh), and tools/copyright.py --check is rc 0.
The substance is what I verified on the PR's own head: CONFIG_EFIVAR_FS=m is real on this kernel, the module is staged and the build says so out loud, install.sh has a hard fail 9 when efibootmgr is missing and a distinct "no efivarfs in this kernel: firmware fallback" outcome, and vmtest.sh SKIPs the boot-order assertion with a stated line instead of failing an otherwise complete install.
Not verified: the boot-entry write and the OVMF BootOrder assertion need the QEMU install gate, deferred while another lane's VM is live. That run now covers several stacked PRs at once, so it is worth doing once at the top of the stack.
tprs-ready applied.
|
Persistent review updated to latest commit 0ebc88f |
…a and its check (engine#712) (#732) * os/v3: the install seed - the pinned medium, the autoinstall user-data and its check The first slice of the v3 build (docs/os-v3.md, engine#712), and the part that can be proven with no device: - os/v3/pin.txt: the server ISO pinned whole - ubuntu-26.04.1-live-server-amd64.iso, 2,927,861,760 bytes, sha256 cc8a95cd..., volume label 'Ubuntu-Server 26.04.1 LTS amd64' read out of the ISO's primary volume descriptor (block 16), because casper matches that label and nothing else. v3 has no snapshot timestamp to pin: the installed base is unpacked from this ISO's own pool. - os/v3/seed.sh render: writes /1bit/autoinstall.yaml and /1bit/identity (0600) from the stick's inputs - the target disk by *serial* (a stick cannot wipe a machine it was not written for), the user onebit, a keys-only ssh, the storage table (1 GiB ESP, 64 GiB root, 1BIT-DATA = the rest with preserve: true, which is also the v2 -> v3 path), the twelve stock packages, the step hooks. The password is read from a file or minted and printed once, never argv; the salt is derived from the seed's own identity, so two renders of the same inputs are byte-identical and a stick is reviewable. - os/v3/seed.sh check: validates a rendered seed - field formats, the 0600 mode, no unsubstituted placeholder, every substituted value, and the document's structure with PyYAML (not a grep) - and refuses a file:// apt source, which would outlive the stick. - os/v3/seed-selftest.sh: 31 checks, no device: a good seed is accepted, 15 bad ones are refused with the right message, and six structure regressions are caught by breaking the template on purpose. The account is onebit and not 1bit: a Linux user name starts with a letter (adduser's default NAME_REGEX is ^[a-zA-Z][a-zA-Z0-9_-]*$, measured in /etc/adduser.conf, and the installer applies the same rule), and the selftest pins that refusal. * os/v3/seed: the three things the QEMU autoinstall run measured A server-ISO smoke run (2.93 GB pinned ISO, ds=nocloud;s=/cdrom/1bit/ with user-data+meta-data) drove subiquity unattended through our seed and found three defects, all fixed here: - match: {serial: ...} is not a curtin disk match: it answers 'matched no disk'. The config now matches size: largest, and the serial the seed names is enforced before curtin runs, by /1bit/steps in early-commands (the guard refuses when the serial does not land on exactly the largest disk). check asserts 'size: largest' instead of the serial. - flag: boot alone is not a bootloader partition: curtin stops with 'autoinstall config did not create needed bootloader partition'. The ESP partition now carries grub_device: true as well, and check refuses a seed without it (measured: with both, block-meta partitions the disk and all three partitions cleanly). - late-commands ran curtin in-target on /cdrom/1bit/postinstall, but the target chroot has no /cdrom. postinstall now runs in the live environment - where the medium and the console are - and drives the target itself with curtin in-target per step, which is also what makes its step lines visible on tty1 and ttyS0 while subiquity is up (#710). selftest 32/32 (the ESP tamper case is new), shellcheck rc=0, copyright rc=0. --------- Co-authored-by: bong-water-water-bong <[email protected]>
…705 #706 #707 #708 #709 #710 #711) The whole reviewed os/v2 set as one commit on origin/main, as asked: main has not touched os/mini since this work started, so the diff is exactly these six files. It carries every reviewed change plus both review fixes — os/mini/init.sh replays the ring buffer into ttyS0 and follows /dev/kmsg where the kernel has no per-console level (#703), and the release identity reports the recorded HRX gitlink instead of walking up to the engine commit (#704) — and the three changes whose PRs were merged into their base branches instead of main (#705, #710, #711). Files: os/mini/{mkimage.sh,init.sh,1bit-menu,install.sh,prepare-stick.sh,vmtest.sh}
0ebc88f to
08fa706
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 08fa7060. The author patch has grown since my last verdict — this branch now carries the whole os/mini stack on top of its own efivarfs work (1bit-menu gained #727's bootdev(), init.sh has #719's kmsg replay and #727's 1bit.data lookup, install.sh #725's step screen, prepare-stick.sh #724's grow, mkimage.sh #720's identity file). Every one of those I have reviewed and verdicted in its own PR; this is the combined tree, so I checked the combination rather than re-reading it.
At this head:
- all six changed scripts parse (
1bit-menu,init.sh,install.sh,mkimage.sh,prepare-stick.sh,vmtest.sh); tools/copyright.py --checkrc 0;- an image builds (this time into
/home/bcloud/tmpimg/726, not/tmp— that filesystem is a RAM-backed tmpfs and I filled it earlier):== efivarfs.ko for 7.3.0-rc4-1bit-perfopt+: staged (the installer can write a boot entry) signer: 109 Build time autogenerated kernel key signer: 1 strixhalo Secure Boot Kernel == 1bit-os.efi … == 1bit-os.img … (no UNSIGNED, no missing module, exit 0)
The substantive checks from earlier still stand at this tree: CONFIG_EFIVAR_FS=m is real, the module is staged and the build says so; install.sh has a hard fail 9 for a missing efibootmgr and a distinct "no efivarfs in this kernel: firmware fallback" outcome; vmtest.sh SKIPs the boot-order assertion with a stated line rather than failing an otherwise complete install.
Not verified: the boot-entry write, the OVMF BootOrder assertion and the stacked PRs' screen/boot behaviour all need the QEMU install gate — deferred while another lane's VM is live. It now covers the entire stack in one run, which makes it worth doing once, at this head.
tprs-ready stands.
Fixes #709. Measured on this kernel:
CONFIG_EFIVAR_FS=mand the module was not in the initramfs, somount -t efivarfsanswered "No such device";efibootmgrwas not shipped at all. So the first real installcould only tell the owner to edit the firmware, and the next boot tried the wiped Ubuntu's stale entry, failed,
and fell through to the stick.
Now: the module goes into the image and init mounts efivarfs once;
efibootmgrships;1bit-installcreates a1bit OSentry for the target disk's ESP (\EFI\BOOT\BOOTX64.EFI), puts it first in BootOrder, sets BootNext,removes entries whose loader file is gone from that disk (matched by the ESP's partition GUID, so other disks are
never touched), and logs the resulting BootOrder. The QEMU install gate asserts the entry exists and is first.
PR-READY.