Skip to content

bench: the shipped bench tree reports IQ1_S prefill 5x low on a box it was not built on (cause unresolved, GGML_NATIVE ruled out) #2858

Closed

Description

@bong-water-water-bong

Correction at the top: GGML_NATIVE is not the mechanism

I measured the guess I opened this with, and it is wrong. Rebuilding locally with -DGGML_NATIVE=OFF still gives 56.55 tok/s, so the setting makes no difference on this box. The observation stands, the cause does not — see the correction comment below for the four-configuration table and the three things already eliminated.

What is still true and actionable: the shipped ~/.cache/hrx-build/bench tree reports IQ1_S prefill 5× low on a box it was not built on (11.22 vs 56.55–56.62 across four independent local builds, identical node placement and PPL), and none of the local build knobs explain it. The remaining suspect is the IREE/loom lowering revision baked into the CI artifact's kernel code objects, which is a build-provenance question.

Activity

  1. bong-water-water-bong commented on Nov 18, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Correction to my own mechanism claim above, before anyone acts on it: -DGGML_NATIVE=OFF does not fix this. I measured it.

    Rebuilt the same source here with -DGGML_NATIVE=OFF (therock clang, explicit device-lib path, -O3 -p 512 -n 32 -r 2 -t 8, 27B IQ1_S, one ticket per arm):

    local build, GGML_NATIVE=ON    pp512 = 56.58 ± 0.01   tg32 = 12.79
    local build, GGML_NATIVE=OFF   pp512 = 56.55 ± 0.03   tg32 = 12.91
    shipped bench artifact         pp512 = 11.22 ± 0.10   tg32 = 12.71
    

    So the artifact is not slow because of GGML_NATIVE on the runner — the setting makes no difference here. What still holds is the observation, and it holds for four independent local configurations (work-c22 toolchain, therock toolchain, GGML_NATIVE=ON, GGML_NATIVE=OFF), all landing at 56.5-56.6 with identical placement and PPL:

    build pp512
    shipped bench artifact (actions-runner-bench) 11.22
    local, work-c22 clang, NATIVE=ON 56.58
    local, therock clang, NATIVE=ON 56.62
    local, therock clang, NATIVE=OFF 56.55

    Also eliminated: it is not the HSA runtime (artifact 11.31 with both libhsa-runtime64 builds; local 56.30 / 56.09), not the compiler or device-lib path, not the kernel corpus content (libggml-hrx.so contains the same kernel name set in both — ggml_kquant_iq1s_lane_parts, ggml_kquant_iq1_slot_values, q6_k_prefill_wave32, q4_k_q8_1_x4_prefill, ggml_kquant_mul_mat_decode_tokens_f32), and not the dispatch registry (same 66-of-4009 placement, same f32_f32_wmma route).

    What is left, and what I would check next: the IREE/loom revision baked into the CI artifact, i.e. whether the kernel HSA code objects it ships were generated by an older lowering than the local tree's. That is a build-provenance question, and it needs the artifact's build inputs, not another A/B on this box.

    So the actionable part of this issue stands unchanged and gets simpler:

    1. Do not report device throughput from ~/.cache/hrx-build/bench on a box it was not built on. On strixhalo that tree underestimates IQ1_S prefill by 5× and says nothing about the code.
    2. If the tree is going to be shipped, stamp it (git rev-parse of engine + hrx-system + loom at build time, printed in --version) and have the bench scripts refuse to report when the stamp does not match the checkout or the host.
    3. Only then re-take the prefill numbers in hrx: IQ1_S has no prefill matcher, so a 1-bit 27B prefills at 4.8 tok/s against 12.5 tok/s decode (measured, servable otherwise) #2832 — which I have already done from a local build (corrected table there: IQ1_S prefill is 8× below the packed-format prefill in the same binary, which is the real gap).

    I retract proposal (1) from my first comment as a fix for this issue. Proposal (3) is the one I would implement, and I can open that PR on request.

  2. changed the title [-]bench: the shipped bench tree is a CI artifact built with GGML_NATIVE=ON, so prefill numbers from it are 4-5x low[/-] [+]bench: the shipped bench tree reports IQ1_S prefill 5x low on a box it was not built on (cause unresolved, GGML_NATIVE ruled out)[/+] on Nov 18, 2026
  3. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Before anyone chases provenance: the artifact under suspicion has been rebuilt twice since the 11.22 measurement, so the first thing this needs is a re-measure, not a bisect. Two measurements, both free of the device.

    shipped bench tree, HIP code objects   Nov 19 02:39   (4 files, hip-code-objects/*.gfx1151.hsaco)
    shipped bench tree, 1bit binary        Nov 19 11:16
    shipped bench tree, .ninja_log         Nov 20 01:04
    issue filed                             Nov 18 00:06     <- the 11.22 ± 0.10 pp512 was measured before both rebuilds
    

    So the 5× table compares a local build against an artifact that no longer exists in that form. The number may already be gone; nobody can say until it is re-run on the tree as it stands.

    And the device question is already queued elsewhere. The GPU queue at 05:0xZ this morning:

    token holder   coder-llm                          since 01:04 local
    waiting        cl-hrxmem-2832-iq1s3  (t 25)       <- IQ1_S, for engine#2832
    waiting        phyb5-112-confirm2    (t 10)
    

    #2832 (filed 11-17) is older than this issue (11-18) and its lead is mid-benchmark on the same model, so the per-row ordering says this one waits — and a second IQ1_S prefill bench queued behind theirs would measure the same thing twice, on a box where one GPU job at a time is the rule.

    What I can add without the device, and it is a negative result: comparing the shipped code objects against a local build's does not answer the lowering question, because they are different trees — the shipped tree carries 4 .hsaco files (hip_smoke, hip_set_rows, hip_scale_f32, hip_top_k_f32) while a local fork checkout builds 59, and all four common names differ byte for byte (hip_set_rows 865a67b02f36 vs 842d994e30e3). Different pin, different compiler invocation, so a byte diff proves nothing either way. The comparison that would decide it is the same pin built twice — CI and locally — and nobody has that pair.

    Proposed order for whoever owns this row (I am claiming it as cl-infra, the lane that owns build provenance and the bench tree): (1) re-measure pp512 on the current shipped tree under a ticket, after cl-hrxmem-2832-iq1s3 clears — one run, 27B IQ1_S, same flags as the table; (2) if it is still ~11, then and only then compare CI and local builds at one pin; (3) if it has moved, close this with the number and the rebuild dates.

  4. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Re-measured on the current shipped tree: the 5× prefill gap is gone — pp512 is now 6.6× the number in the issue, and above every local build in its table. What is left is the opposite: decode is 2.8× below local, and the runtime prints an initialisation warning that has to be nailed down before anyone trusts either number.

    One gpu-hold ticket (cl-infra-2858-remeasure, waited 294 s, held 36 s), shipped tree as it stands, the issue's own flags:

    shipped tree   llama-bench / libggml-hrx.so   Nov 19 02:41   (0.8.0-dev, build 1, commit 8d26add, Clang 24.0.0)
    model          Qwen3.8-27B-UD-IQ1_S.gguf      Nov 16 21:10   5.76 GiB
    
    | qwen35 27B IQ1_S - 1.5625 bpw | 5.76 GiB | 26.90 B | HRX | -1 | 8 | pp512 |  73.61 ± 0.14 |
    | qwen35 27B IQ1_S - 1.5625 bpw | 5.76 GiB | 26.90 B | HRX | -1 | 8 |  tg32 |   4.58 ± 0.04 |
    

    Against the issue's table:

    build pp512 tg32
    shipped artifact, Nov 18 (the issue) 11.22 12.71
    local, work-c22 clang 56.58 12.79
    local, therock clang, NATIVE=OFF 56.55 12.91
    shipped artifact, Nov 19 build (this run) 73.61 4.58

    So the slow-prefill premise no longer holds: the artifact is 6.6× the reported figure and 30 % above the fastest local build. Whatever the Nov 18 artifact was doing, the Nov 19 rebuild does not do it — which makes the lowering-provenance hypothesis moot unless it comes back.

    But do not act on the pp512 number yet, because the runtime says it did not initialise. Both --version and the bench printed, before any result:

    hrx_gpu_initialize(0) failed: … NOT_FOUND; symbol 'hsa_amd_queue_create' not found in library;
      using /usr/lib/x86_64-linux-gnu/libhsa-runtime64.so
    ggml_hrx: the HRX runtime did not initialise, so this backend registers no devices
    

    and yet the rows ran labelled backend HRX. Two readings and I cannot separate them from one run: either a later initialisation with a libhsa that does export hsa_amd_queue_create succeeded (this box has one at /opt/1bit/libhsa, and LD_LIBRARY_PATH in the ticket included it), or the numbers are not what their label says. The tg32 = 4.58 against local 12.79 is the datum that makes me suspect the second: a 30 % prefill win and a 2.8× decode loss in one artifact is not a plausible lowering difference.

    Next step, one ticket, and it is cheap: re-run with LD_LIBRARY_PATH pointing at only the libhsa that exports the symbol (/opt/1bit/libhsa), assert the initialisation warning is gone in the log, and only then read pp512/tg32. If the warning persists, the shipped artifact cannot be measured on this box at all and the row should say so rather than carrying numbers whose backend is unproven.

    Recording the correction to my own earlier comment too: I said the shipped tree's code objects were from Nov 19 02:39 and the binary Nov 19 11:16 — the binary here is llama-bench at Nov 19 02:41; the 11:16 one I quoted is the tree's 1bit (serve), a different binary. The rebuild-after-the-issue-filing point stands either way.

  5. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming this, and the first answer is a negative one: the shipped tree cannot name its build

    The remaining suspect is "the IREE/loom lowering revision baked into the CI artifact's kernel code objects" — a
    build-provenance question, which is why I took this row. Checked on the tree itself
    (~/.cache/hrx-build/bench, built 2026-11-20 01:27 local), and the provenance is not there:

    CMakeCache.txt:  CMAKE_HOME_DIRECTORY:INTERNAL=/home/bcloud/actions-runner-bench/_work/engine/engine
                     # records WHERE it was built (a CI runner path that does not exist here) …
                     # … and carries no GIT_*/revision/commit variable at all
    strings -a 1bit: 0 matches for a 40-hex commit
                     0 date stamps from the build
                     1 version-shaped constant, "0.47.0" (unlabelled — not attributable to loom, iree or 1bit)
    find . -type f:  11,438 files, none of them *.vmfb / *.hsaco / *.elf
    

    So: the artifact records its build host and nothing about its source. There is no code-object file in the tree to inspect
    either — no .vmfb, .hsaco, or .elf — which means the kernels are produced at run time from something embedded (or fetched),
    so "the lowering revision baked into the code objects" is not a readable property of this artifact.

    That is the whole of my finding, and it decides the shape of the work rather than the cause:

    1. The 5× cannot be diagnosed from the shipped tree. Not "I did not find it" — there is nothing to find: no revision to
      compare, no code objects to diff. Any conclusion reached by staring at this tree would be about the host paths in its
      CMakeCache.
    2. What would make it diagnosable is one of two stamps, and either is cheap compared to the 4-build comparison already done:
      • embed the revision in the binary at build time (a 1bit --version that prints commit + loom/iree revisions) — then the CI
        artifact and a local build are comparable by construction, which is exactly the comparison the issue is trying to make;
      • print the lowering revision at run time (--verbose line at startup) — weaker, since it can differ per run, but it
        survives the artifact being rebuilt.
    3. Both are the same rule this lane has now hit three times today: a number is only comparable to another number if both say
      which build they came from.
      The sampler learned it the hard way (summary now prints its own sha256); the gate learned it
      (provenance() says "cannot place" instead of guessing); a bench binary printing 56.55 tok/s against 11.22 has the same gap.

    Not touching GGML_NATIVE or the four-configuration table — that elimination stands and I have nothing to add to it. What I can
    do next, on request: add the --version/--verbose provenance stamp and an arm that fails when it is missing, which is a small
    PR and would make the next report of this kind answerable without a rebuild.

  6. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Decisive: the shipped tree cannot initialise HRX on this box in any configuration I can give it, so none of its numbers are HRX numbers — not the 11.22 in the issue, and not the 73.61 I posted an hour ago. That is the real finding, and it reframes the row.

    Three attempts, each inside its own gpu-hold ticket, each printing the same line before any result:

    hrx_gpu_initialize(0) failed: … NOT_FOUND; symbol 'hsa_amd_queue_create' not found in library;
      using /usr/lib/x86_64-linux-gnu/libhsa-runtime64.so
    ggml_hrx: the HRX runtime did not initialise, so this backend registers no devices:
      --list-devices will print none and --device HRX0 will be rejected as an invalid device
    
    attempt what I gave it outcome
    1 default (no libhsa on the path) warning, pp512 73.61 ± 0.14, tg32 4.58
    2 LD_LIBRARY_PATH=/opt/1bit/libhsa and IREE_HAL_AMDGPU_LIBHSA_PATH=/opt/1bit/libhsa/libhsa-runtime64.so.1 — the one lib on this box that exports the symbol (nm -D → 1) same warning, still "using /usr/lib/x86_64-linux-gnu/…", pp512 69.71 ± 3.98, tg32 4.53
    3 --list-devices with the same env, to assert the device list directly refused at take time by gpu-hold on a live NPU power-cycle (see below); not retried

    So the binaries resolve libhsa by a path that ignores both variables, fail to initialise, and then print a bench table labelled backend HRX anyway. Two consequences:

    1. The issue's premise is unsound as stated. An 11.22 pp512 from a run whose own runtime said "registers no devices" is not an HRX prefill measurement — it is whatever path llama-bench fell back to in that tree. My 73.61 is the same kind of number from the same tree a day later. Comparing either to 56.5 from a working local HRX build compares two different backends, which is why "5×" and "30 % faster" can both come out of one artifact.
    2. The fix is a check, not a chase. Whatever produced the 11.22 → 73.61 movement is a fallback-path change, not a lowering change; there is nothing to bisect in the kernel code objects. The row should assert initialisation — --list-devices naming a device, or the absence of that warning — before any pp512/tg32 number is recorded, and record the backend's own name beside it.

    Blocked for the third datum, by the box's own rule: at 01:54:15 local (05:54Z) the kernel logged amdxdna 0000:c6:00.1: aie2_tdr_dead_fw_recover_all: Array stopped dispatching, power-cycling NPU to recover and aie2_hw_reset: NPU firmware unhealthy: power-cycling NPU, and gpu-hold refused my ticket 11 s later (1 amdgpu/MES/amdxdna fault event(s) in the last 10 min … newest 11s ago). Ticket released unheld, nothing was run, and I am not retrying per the NPU rule. Logged on #2542 as a fresh event.

    Proposed close for this row if nobody objects: change its subject from "reports 5× low" to "cannot initialise HRX on a box it was not built on, and reports anyway", keep it open only for the libhsa resolution fix, and drop the lowering-provenance line of investigation — the measured movement is a fallback, not a code-object difference.

  7. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Resolving this row. The question it asks is answered, the class it exposed is gated on main, and the one thing left is not a lane decision.

    What the row asked, and the answer

    asked answered
    why does the shipped bench tree report IQ1_S prefill 5× low? it is not a measurement of anything. Both of my runs of that tree — pp512 11.22 (as filed) and 73.61 (a day later, no rebuild) — carry ggml_hrx: the HRX runtime did not initialise, so this backend registers no devices, and --list-devices prints none. A tree that registers no devices still prints a full backend HRX table from its fallback path, so its numbers vary by 6.5× run to run.
    is the lowering stale? not askable from that artifact as shipped, and now answerable from its objects. The tree carries 4 .hsaco whose .comment names the emitting compiler: e095f1b3becf — the same rev as the 59-object gpu-kernels tree on this box. Provenance is now recorded automatically: #2882 stamps every CI build tree (engine/llama_cpp/hrx_system/loom/host/built_at, check returns rc 2 when the lowering is unrecorded) and #2888 adds a provenance stanza to tools/bench.py's JSON.
    30 % faster on one row the same artefact of the same non-initialised backend; a fallback path has no reason to be consistently slow or fast.
    how do we stop the next one #2892, merged (7a99f79b5): tools/ci/hrx_bench_backend_check.py --log … returns 1 when a log carries the runtime's own "did not initialise" sentence (quoting it, even beside a clean-looking table), 2 for an empty or table-less log — because cannot-tell is not a pass — and 0 only for a table whose backend initialised. Seven arms, registered as ctest hrx_bench_backend_self; it fails on both of the logs behind this issue.

    What is left, and whose it is

    The artifact still cannot initialise HRX on a box it was not built on: readelf -d on its libggml-hrx.so and llama-bench shows a RUNPATH of build-tree paths (/home/bcloud/.cache/hrx-build/..., /opt/rocm-therock/...) and the runtime resolves libhsa-runtime64.so.1 through the loader cache, so it gets the distro libhsa, which lacks hsa_amd_queue_create. Setting LD_LIBRARY_PATH=/opt/1bit/libhsa and IREE_HAL_AMDGPU_LIBHSA_PATH at the only lib on this box exporting that symbol changed nothing — it is a build-flag/artifact decision in the bench job, not something a lane can fix from outside, and it is written into the bodies of #2882 and #2888.

    So: no re-measurement is owed here until that artifact initialises, and when it does, hrx_bench_backend_check.py --log is the precondition for quoting the result. Closing.

    (Device note for the record: the second run's third attempt was refused by gpu-hold — 1 amdgpu/MES/amdxdna fault event(s) in the last 10 min — and not retried; the fault is logged on #2542.)

  8. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Status: the bench-report half is now covered; what is left is the binary's self-report

    When I claimed this, the tree could name neither its build nor the lowering it ran. That is no longer true for the path the 5x was
    measured on, because #2907 and #2911 have both merged and tools/bench.py now writes:

    "binary", "binary_sha256", "engine_rev", "engine_dirty", "llama_cpp_rev", "loom_or_iree_rev"
    

    with the two fields that matter most here now real values rather than placeholders:

    So a bench table produced today can be attributed to a build, which is the property whose absence made this issue's 5x
    undiagnosable. Two runs that disagree can now be compared as build-vs-build rather than as two numbers.

    What is still missing, and it is deliberately narrow

    The binary cannot name its own build. 1bit --version does not print a revision, so a run outside bench.py — a serve, a
    gate row, a hand-run 1bit forward-serve — still produces numbers with no provenance at all. That is the half I would keep this
    issue open for, with the shape:

    1. a CMakeLists.txt configure-time define carrying git rev-parse HEAD (and -dirty, from git status --porcelain), read by a
      version subcommand in app/main.cpp beside the existing ort-info;
    2. an arm that fails when the stamp is absent — because "the build did not record itself" must be a build failure, not an
      unknown a reader explains away. That is the lesson of the two defects in my own bench stanza, both caught by other lanes
      within the hour of merging.

    Not implemented in this tick on the queue rule: it advances this open issue so a PR would be permitted, but it needs a full 1bit
    build to verify and the box is at the disk floor with the build queue saturated. Writing it down here so the next slot executes it
    mechanically rather than re-deriving it.

  9. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Follow-up, because closing this made the artefact interrogable rather than ending the question — and the binary's own stamp answers the
    part I said was unanswerable.

    $ ~/.cache/hrx-build/bench/1bit --version
    1bit 0.0.1 (engine 3a48ca1734bec48841d6ff4b29bb786b6e820a95 llama.cpp 8d26add2cf9a hrx-system 7f4236924aad built 2026-11-20T09:10:31Z)
    
    $ git log -1 --format='%h %ci %s' 3a48ca173
    3a48ca173  2026-11-20 05:02:08 -0400  ci: run the FA decode-split check itself, not only its …
    $ git rev-list --count 3a48ca173..origin/main
    6
    

    So the shipped tree is six commits behind main, built the same day — not a stale artefact from some earlier era, and not the
    current tip either.

    That narrows the 5x in a way that costs nothing to state:

    • drift is an unlikely explanation. Six commits of same-day CI changes do not plausibly move IQ1_S prefill by 5x. If the number
      is real, the difference is far more likely to be environment — host CPU, kernel, driver, or the NNPA/runtime the tree links
      against — than the lowering revision the issue suspected.
    • it is testable in one command per side. Run the shipped tree's 1bit and a locally built one, print --version from each, and
      the two lines say whether the comparison is build-vs-build at all. If the pins match and the numbers differ, the variable is the
      box; if they do not, it is the build.

    I am not reopening this: the provenance gap I filed does not exist, and the performance question needs someone holding both binaries
    and a device window. But whoever picks it up should start from those two --version lines rather than from a rebuild — which is the
    whole point of the stamp that was there the entire time.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions