Skip to content

hyperloom: the engine as a --framework custom workload, retire the 1.0.0 patch route - #660

Merged
bong-water-water-bong merged 6 commits into
mainfrom
1bit/hyperloom-custom
Oct 30, 2026
Merged

bong-water-water-bong merged 6 commits into
mainfrom
1bit/hyperloom-custom

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

What

Makes the engine a Hyperloom custom workload on upstream's supported --framework custom
(scriptable) path, and retires the route that patched an installed Hyperloom 1.0.0.

Upstream 1.1 now knows this board (--gpu-type radeon8060s = gfx1151, 40 CU) and takes the
entrypoint, the lever grid and the correctness gate from the operator, so nothing here patches
Hyperloom itself any more.

Files

File What it is
tools/hyperloom/custom/custom_radeon8060s.sh The name upstream resolves (custom_<runner-type>.sh), forwards to the workload.
tools/hyperloom/custom/custom_strixhalo.sh Entrypoint: takes one claim on the box's GPU FIFO (gpu-hold -l hyperloom -t 20), builds nothing, runs one measurement.
tools/hyperloom/custom/benchmark.py Stdlib measurement: llama-bench pp512/tg128, 1bit serve code/prose/short tok/s (median of 3), KLD gate, greedy-text gate, score = geomean, writes the InferenceX-shaped result.
tools/hyperloom/custom/levers.json 14 declared variants: -ub, -b, -fa, KV cache types, --mtp-max 3/6/8, --dflash, --parallel 2/4, GGML_HRX_Q8_PREFILL_RELAX, GGML_HRX_GRAPH_PROGRAM_CACHE.
tools/hyperloom/custom/README.md Launch line, out-of-tree build recipe, gate semantics, box etiquette.

Retired

hl_patch_strixhalo.py, hl_cli_login.py, launch.sh, lemonade_bench.sh, the old
custom_strixhalo.sh and the ZAYA1 reference. Nothing else in the repository referenced them
(git grep on main). hrx2kineto.py and hrx-tracelens.sh are unchanged: they are the TraceLens
bridge and the profile leg uses them.

Gate

Fail-closed, two halves, both required: mean KLD against base logits recorded at the baseline
(llama-perplexity, wiki.test.raw, 512x8 — scripts/hw-gate.sh's recipe) and byte-identical greedy
replies on the three prompts. The first measurement records the references (reference_established);
every later one must pass. References live outside the framework checkout, because Hyperloom runs
git clean -fd there when it integrates a patch.

Verified

  • levers.json through Hyperloom's own load_declared_levers(): 14/14 executable.
  • Entrypoint resolution through Hyperloom's own _custom_script_path('radeon8060s').
  • A standalone measurement and one bounded optimize run on the Strix Halo box.

bong-water-water-bong added 3 commits October 30, 2026 11:23
…e 1.0.0 patch route

Hyperloom 1.1 knows this board (--gpu-type radeon8060s = gfx1151) and has a
supported scriptable path, so tools/hyperloom/custom/ carries the whole adapter:
an entrypoint that takes the box's GPU FIFO and runs one measurement, a stdlib
benchmark that reports llama-bench pp512/tg128, 1bit serve code/prose/short and a
two-half correctness gate (KLD vs base logits, greedy text identity), the lever
grid EXPLORE sweeps, and the launch line.

The 1.0.0 patch route (hl_patch_strixhalo.py, hl_cli_login.py, launch.sh) is
deleted: nothing here patches Hyperloom itself any more. hrx2kineto.py and
hrx-tracelens.sh stay as the TraceLens bridge.
Measured on the Strix Halo box against main 76e3bbd, not assumed:

* IREE_HAL_AMDGPU_LIBHSA_PATH must be exported or the HRX backend registers no
  device at all ("Available devices: (none)") and every leg fails; the entrypoint
  now defaults it to the TheRock copy, HL_LIBHSA overrides.
* A GGUF that carries its own MTP head drafts with it *by default* (serve says so
  at startup and pins draft length 3 by its recipe), so HL_MTP_MAX now means
  relative to that: unset keeps serve's default, 0 is --no-mtp, N is --mtp-max N.
  Adds mtp_off to the grid.
* On this pin the MTP draft graph has one node (the head's PAD) off HRX and strict
  placement aborts the server, so the serve leg runs GGML_HRX_STRICT=0 with
  GGML_HRX_REPORT=2, the same policy scripts/hw-gate.sh uses for its server, and
  records the placement counts in the report.
serve has its own argument parser and rejects -lv, which killed the serve leg.
Placement evidence is best-effort: the counts need the library's INFO level, and
serve exposes no passthrough for it. GGML_HRX_STRICT=0 is the part that matters
and it stays.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY (posted as a comment: GitHub refuses --request-changes/--approve on a PR owned by the same account). One count in the description is off; nothing else found.

Checked against the installed Hyperloom's own code, not against the description. In ~/hyperloom-ws/.venv-2026-10-30, with HYPERLOOM_BYPASS_SCRIPTS_DIR pointed at this PR's tools/hyperloom/custom:

$ python -c 'load_declared_levers(); _custom_script_path("radeon8060s")'
levers file: .../tools/hyperloom/custom/levers.json
load_declared_levers -> 15 entries
names: ['mtp_off', 'ub1024', 'ub2048', 'b2048', 'fa_off', 'kv_k_q8', 'kv_kv_q8',
        'mtp_3', 'mtp_6', 'mtp_8', 'dflash', 'parallel_2', 'parallel_4',
        'q8_prefill_relax_off', 'graph_cache_unbounded']
_custom_script_path(radeon8060s) -> .../tools/hyperloom/custom/custom_radeon8060s.sh
_custom_script_path(gfx1151)     -> (empty)

load_declared_levers() raises DeclaredLeversError for any variant is_executable() would reject, so a clean load is the "all executable" assertion — but the count is 15, not 14 (the body and custom/README.md both say 14; mtp_off is the one missing from the prose list, which enumerates --mtp-max 3/6/8 but not the 0 arm). Worth fixing in both places, since the lever count is what an operator checks when deciding the sweep is the one they wrote.

The CLI side matches the README: hyperloom optimize on this box offers --framework {sglang,vllm,atom,xdit,custom}, --gpu-type … radeon8060s, --framework-path, --benchmark-scripts-dir, and the CLI exports --benchmark-scripts-dir into HYPERLOOM_BYPASS_SCRIPTS_DIR (inference_optimizer/cli/__init__.py:193,238), which is exactly the variable declared_levers_path() and _custom_script_path() read. python -m hyperloom --help works from that venv, so the README's launch form is valid.

Nothing patches Hyperloom. hl_patch_strixhalo.py, hl_cli_login.py, launch.sh, lemonade_bench.sh, the old custom_strixhalo.sh and the ZAYA1 reference are deleted, and the remaining mentions are prose saying they are gone (tools/hyperloom/README.md:33, custom/README.md:26). git grep over tools/ and scripts/ for git apply, --patch, sed -i on hyperloom, and site-packages paths finds nothing but the TheRock libhsa-runtime64.so.1 read path. The new code writes only to $RESULT_DIR (out_dir, per-name .log/.json) and $HL_STATE (the two reference files) — both deliberately outside --framework-path, which matters because Hyperloom runs git clean -fd there when it integrates a KEEP.

Entrypoints, dry-run style: bash -n clean on both scripts, shellcheck -S warning silent, python3 -m py_compile benchmark.py clean, and with no model the measurement fails closed before touching anything:

$ env -u HL_MODEL -u MODEL RESULT_DIR=/tmp/hl-dry python3 benchmark.py
neither HL_MODEL nor MODEL names a model                              exit 1
$ MODEL=/nonexistent.gguf … python3 benchmark.py
model file not found: /nonexistent.gguf                               exit 1

The GPU wiring is by inspection: custom_radeon8060s.sh exec bashes the workload, and the workload execs gpu-hold -l hyperloom -t "$HOLD_MIN" -- python3 benchmark.py, so one measurement is one claim, nothing builds inside it, and a candidate that fails the gate exits 0 with quality_gate.passed=false (the documented Hyperloom contract) while an infrastructure failure is non-zero.

I did not take a GPU claim: the standalone measurement and the bounded optimize run in the body are yours, and the GPU is shared tonight. Nothing here needs the device to be reviewable, which is the point of the split.

bong-water-water-bong and others added 3 commits October 30, 2026 12:34
A run on a shared box is sandboxed on HOME (upstream's preflight writes the API key
into the ~/.claude of whatever HOME it sees). Two paths assumed $HOME was the box
user's: gpu-hold, which then did not exist, and the build/weights/state defaults.
gpu-hold now resolves through PATH and the password database, and benchmark.py
defaults through pwd.getpwuid() with HL_REAL_HOME as an override.
…y takes

Measured on the box, four of the six batch levers were invalid:

* 1bit serve has its own argument parser and rejects -b/-ub/-ctk/-ctv as unknown
  options (it sets batching per route; it does take -fa). So those levers now move
  llama-bench and the KLD leg only, and serve gets just the flags it accepts.
* A quantized KV cache needs flash attention: with -ctk q8_0 alone, llama-bench
  dies in ggml_backend_sched_graph_compute_async error -1 during warmup. Asking
  for one now implies -fa on.
* -fa off reaches serve and then fails at decode (Compute error, HTTP 500): kept as
  a lever, reported as a rejected candidate rather than silently dropped.
@bong-water-water-bong
bong-water-water-bong merged commit 65cf71a into main Oct 30, 2026
7 of 8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hyperloom-custom branch October 30, 2026 17:17
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The bounded run (2026-10-30, Strix Halo)

--framework custom --gpu-type radeon8060s, Qwen3.8-27B UD-Q4_K_XL on HRX0, --max-hours 4, 4 h budget:
39 measurements, upstream's own verdict KEEP, +13.64 % (baseline 46.09 → 52.38, both gate halves green: mean KLD
0.000e+00, three greedy texts byte-identical). Best measured 52.62.

What the run found, all of it measured:

  • The DFlash drafter is the win: serve code tok/s 21.41 → 28.7 (+34 %) at unchanged pp512. Turning serve's built-in
    MTP drafting off halves it (11.8). Draft length beyond serve's default, --parallel, and the two GGML_HRX_* knobs
    add nothing measurable.
  • The batch levers carry +4-5 % and the 1e-4 KLD bar rejects every one of them (UB=1024 48.38, B=2048 48.23,
    UB=2048 46.44; all KLD 0.000403 > 0.0001). With the gate's own default (0.01) they would have been kept. That is
    an operator decision about the bar, not an engine limit, and it is the one number in this adapter worth revisiting.
  • MTP_MAX=8 is rejected by the greedy-text half (prose differs) — the second gate half earning its keep.
  • -fa off fails at decode on this pin (Compute error, HTTP 500) and -ctk q8_0 fails in llama-bench even with the
    -fa on implication; both are reported as rejected candidates rather than dropped.
  • Noise floor on this shared box is ~4.5 %, so a KEEP has to clear ~5 %.

Numbers, the full candidate table, the two source patches the framework agent proposed (both left in its session
worktree, neither applied — they go to the fork only through this repository's PR process) and the caveats are in
~/briefs/THL-ADAPTER-STATE.md.

KEEP commits: none. Nothing was committed into the framework checkout (--framework-path) — upstream only
commits there for accepted source patches, and it accepted none.

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.

1 participant