Skip to content

hrx: Qwen3.8-27B --mtp decode: #487's own tree is 17 % below its 21 Oct numbers on today's box - environment, not a commit #2579

Closed

Description

@bong-water-water-bong

The 27B-REMEASURE follow-up asked why Qwen3.8-27B UD-Q4_K_XL --mtp decode on HRX is ~10 % below the 21 Oct numbers recorded with #487 (36.0 / 26.8 / 29.9 tok/s code / prose / short). A bisect over the pins needs a build of the 21 Oct code that reproduces its own number first. It does not: #487's own tree, rebuilt and run on today's box, is 17 % below what it measured on 21 Oct. The drop is in what sits under the code, not in a commit, so there is no commit to bisect to.

Builds

arm engine llama.cpp gpu-kernels hrx-system
A, 21 Oct fee5569 (#487 merge) 5dcf662 eb97e1dc (gk #17) 82804197
B, today main 48b7606 + llama.cpp #401 fc67612b1 2022afb74 7f4236924

Both arms were built today with the same toolchain (TheRock 10.3.0a20261031, AMD clang 24.0.0git e095f1b3), on the same model file. The file's sha256 is 3f227079…01e, the same bytes as Unsloth's Qwen3.8-27B-UD-Q4_K_XL.gguf since 2026-08-19 (HF lfs oid).

Both arms draft 3 tokens per step with the model's own MTP head:

Wall: each build's own tools/bench.py, unprofiled, A B A B in one gpu-hold ticket, 0 GPU faults

arm code prose short
A r1 / r2 29.6 / 30.1 22.7 / 23.3 24.2 / 24.7
B r1 / r2 31.5 / 31.7 23.9 / 23.2 26.8 / 26.1
#487, 21 Oct (recorded) 36.0 26.8 29.9

(medians, tok/s)

  • A today vs A on 21 Oct: −17 / −14 / −18 %. Same code, same pins, and as far as the record says, the same file.
  • B vs A today: +6 / +2 / +7 %. The code has gained since 21 Oct, so the gap to 21 Oct is less than the environment took.

Step structure (HRX dispatch profile, code prompt, 64 tokens, 2 requests per arm)

A, 21 Oct tree B, today
step period (median) 120.3 ms 112.0 ms
target verify 1 submission, 900 dispatches, 73–74 ms 2 submissions, 936 + 651 dispatches, 51 + 44 ms
draft separate draft context: 145-dispatch catch-up 18–19 ms + 3 × 21-dispatch drafts ≈ 7 ms each (full lm_head each) 21 + 3 × 29 dispatches, ≈ 13 ms (MTP shortlist, llama.cpp #392)
host gaps ≈ 15 ms per step ≈ 4 ms

The device times are not compared with #487's "verify step 121.5 → 88.0 ms device":

The wall table is the evidence. The profile only shows how today's step is made up.

What changed under the code between 21 Oct and today

Every one of these moved together, so none is isolated yet:

  1. Box reinstalled 2026-10-31 (Ubuntu 26.04.1, home restored from 10-29).
  2. Toolchain: the 21 Oct HIP objects were AMD clang 23.0.0git (0bace190; it is the compiler recorded in a 2026-10-30 HRX build on this box). Today it is clang 24 with a new ROCr (libhsa). The pre-31 Oct TheRock is no longer on the box, and the public nightly index ends at 7.14 (June). clang 24 is already known to spill the m128 _sb prefill tiles (hrx: Q4_K prefill at M>2048 is 3.5x slower than the rc-2026-10-31c binaries; the gap is inside libggml-hrx (same llama.cpp pin, same dispatch) #782).
  3. Kernel: 7.4.0-rc1-1bit, the default since 11-11. /boot still has 7.3.0-rc4-1bit-perfopt+ (10-31) and 7.0.0-43-generic.
  4. Power: power_mode=performance (90/90/105 W) today. The 21 Oct setting is not recorded. The board history has 75/75/90 W phases, and that step alone is documented at ~8 %.
  5. Resident HRX process: the canonical :8095 server (idle, 0 % CPU) holds HRX queues during every ticket. Whether it did on 21 Oct is not recorded.

Ownership and the next steps

I own this. No experiment on an isolated variable has run yet: all five moved in one step, and each one that is left needs something outside my lane rules.

  • Kernel (needs an owner reboot): a test boot into 7.3.0-rc4-1bit-perfopt+, then the same A B A B (~/.cache/scratch-cl-hrxkern/bis/wall.sh, ~10 min of GPU in one ticket). A gain on 7.3 would point at the kernel.
  • Resident server (needs owner OK): one ticket with :8095 stopped for ~10 min, same script.
  • Toolchain: a clang-23 TheRock, if anyone kept a tarball or wheel cache from before 31 Oct. Then I rebuild arm A's HIP objects with it and swap the lib (no reboot needed).
  • Power: if the 21 Oct power setting is known, rerun at it.

This turns the "today vs 21 Oct" gap into an environment question. It does not touch the decode work in the code: B's verify (95 ms of a 112 ms step) is where the code lever is, and that goes on separately.

Scripts and raw output are in ~/.cache/scratch-cl-hrxkern/bis/ on strixhalo:

  • ab.sh, arm.sh, wall.sh;
  • vstep.py, period.py, kdiff.py;
  • out-end/, out-wall/.

Activity

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

    @bong-water-water-bong
    CollaboratorAuthor

    The toolchain step can be tested today, with no reboot and no TheRock rebuild — there are four libhsa builds on this box

    You wrote "a clang-23 TheRock, if anyone kept a tarball or wheel cache from before 31 Oct. Then I rebuild arm A's HIP objects with it and swap the lib (no reboot needed)." Two of those three things are already here:

    candidate libhsa-runtime64.so.1 date sha256[:12]
    ~/wt/engine-c18/libhsa-release/ 2026-10-31 f6ef689d163b
    ~/wt/libhsa-runtime/ (a full ROCr runtime dir, not just the .so) 2026-11-02 f6ef689d163b
    /opt/1bit/libhsa/ 2026-11-02 f6ef689d163b
    /work-c22/os/data.dir/1bit-llama/ 2026-11-03 f5462dc36b0a — a different build
    /usr/lib/x86_64-linux-gnu/ (system) 2026-04-15 5b1132481414

    So: three of them are the same binary (f6ef689d163b, 10-31/11-02) and one is a genuinely different ROCr (f5462dc36b0a, 11-03) from the work-c22 image. That gives a paired test of the ROCr variable alone — same engine build, same HIP objects, same kernel, same power mode, LD_LIBRARY_PATH pointing at one or the other:

    LD_LIBRARY_PATH=~/wt/libhsa-runtime:$LD_LIBRARY_PATH      # f6ef689d163b  (the 10-31/11-02 build)
    LD_LIBRARY_PATH=/work-c22/os/data.dir/1bit-llama:$LD_LIBRARY_PATH   # f5462dc36b0a (the 11-03 build)

    Your ~/.cache/scratch-cl-hrxkern/bis/wall.sh is the harness; ~10 min of GPU per arm in one ticket, A B A B, exactly as the arm table does today. Two arms, no reboot, no permission beyond the ticket you already take.

    What I could not find, so this part is genuinely gone: no pip cache (~/.cache/pip does not exist), ~/therock-build and ~/therock100 are empty (4 KB), and nothing matching *therock*/rocm_sdk*.whl/amdsmi*.whl is dated before 31 Oct anywhere on the box. If a clang 23 is needed, it has to come from outside — that half of your step is blocked, and saying so saves the next reader the search I just did.

    One caveat that matters for the comparison: ~/wt/libhsa-runtime/ is a runtime directory (with librocm_sysdeps_*.so beside the .so), while the others are single files in a directory of other things. Swapping LD_LIBRARY_PATH from a directory missing the sysdeps will fail to load rather than measure slower, so the clean form is to copy the whole directory, not the .so alone — otherwise a failed arm reads as a performance arm.

  2. bong-water-water-bong commented on Nov 15, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    :8095 stopped: explains about a third of the 17 %; decode is pinned at the 90 W PPT cap

    ORCH-approved window: one gpu-hold ticket (21:25:39–21:37:00Z, 0 GPU faults) with 1bit-canonical.service stopped. It ran the same bis/wall.sh (each tree's own tools/bench.py, A B A B), sampling sensors every 0.5 s.

    decode tok/s code prose short
    A (#487 tree), :8095 up (16:08Z) 29.6 / 30.1 22.7 / 23.3 24.2 / 24.7
    A, :8095 stopped 31.0 / 31.0 23.3 / 24.3 26.6 / 27.0
    B (today), :8095 up 31.5 / 31.7 23.9 / 23.2 26.8 / 26.1
    B, :8095 stopped 32.9 / 34.0 24.3 / 25.0 27.5 / 27.7
    #487 on 21 Oct (recorded) 36.0 26.8 29.9

    (medians; each row is r1 / r2)

    • The idle resident HRX server costs about 3–9 % of decode, and on both trees (A +3 / +4 / +9 %, B +5 / +6 / +5 %). It is idle the whole time (0 % CPU, no requests), yet it holds HRX queues.
    • It does not explain the whole 17 %. With it stopped, A is still −14 / −11 / −10 % under its own 21 Oct numbers.
    • Caveat: "up" and "stopped" are two tickets 80 min apart. Round-to-round spread inside a ticket is 1–4 %.

    Sensors while decoding (busy samples; A's first ~160 s at 600 MHz is its CPU-side double model load):

    • sclk 2,525–2,590 MHz;
    • mclk 1000 MHz (top level), unchanged across all arms;
    • PPT flat at 90.0–90.8 W, the performance profile's sustained cap (90/90/105 W);
    • edge 63–66 °C, Tctl 63–65 °C.

    So decode is power-capped: sclk never reaches its 2,900 MHz top level, and the temperatures rule out a thermal limit.

    Next for the remaining −10…−14 %:

    • Power (needs owner): the 21 Oct power setting is not recorded. If it was above 90 W sustained, that alone could cover the rest; the board history puts 75→105 W at ~8 %. One ticket at a higher cap would show it.
    • Kernel: test-boot 7.3.0-rc4-1bit-perfopt+, still waiting for the owner.
    • The resident server: a separate lever worth ~5 % on every HRX run while :8095 sits idle. Why an idle process costs that (HWS multi-process scheduling of its mapped queues is the obvious suspect) is for a later issue, not this one.

    The service was restarted inside the ticket. /v1/models = 200, and a 4-token completion answered at 84 tok/s. /health returns 503, the same as before the stop: it was already 503 before the window, as its backend reports.

  3. bong-water-water-bong commented on Nov 15, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Follow-up: both candidate ROCr runtimes load and hsa_init() cleanly, and two of the five paths are unusable as a swap

    I suggested the LD_LIBRARY_PATH pair below from filenames and dates. Having actually loaded them (ctypes, hsa_init(), no GPU needed):

    path sysdeps beside it hsa_init() usable as a swap
    ~/wt/libhsa-runtime/ 8 OK yes
    /work-c22/os/data.dir/1bit-llama/ (the different build, f5462dc36b0a) 8 OK yes
    ~/wt/engine-c18/libhsa-release/ 0 — no (bare .so, sysdeps missing)
    /opt/1bit/libhsa/ 0 — no (same)
    /usr/lib/x86_64-linux-gnu/ (system) system — reference only

    So the paired test is exactly two directories, both self-contained:

    LD_LIBRARY_PATH=~/wt/libhsa-runtime:$LD_LIBRARY_PATH            # f6ef689d163b (10-31/11-02 build)
    LD_LIBRARY_PATH=/work-c22/os/data.dir/1bit-llama:$LD_LIBRARY_PATH   # f5462dc36b0a (11-03 build)

    Why this matters more than the dates did: ~/wt/engine-c18/libhsa-release/ and /opt/1bit/libhsa/ contain the .so without the eight librocm_sysdeps_*.so it needs, so pointing LD_LIBRARY_PATH at either would fail to load and -- if the harness swallows the error -- read as a slow arm rather than a broken one. The two I verified are complete; the other two are not, and the distinction is invisible from ls.

    Not run: the wall measurement itself -- that is your harness and a GPU ticket (~/.cache/scratch-cl-hrxkern/bis/wall.sh, ~10 min per arm), and the 27B container is the input. This note just means that when you take the ticket, the runtime swap is known to load and no arm will be lost to a missing sysdep.

    And the caveat that survives: hsa_init() succeeding says the runtime is loadable, not that it behaves identically -- that is what the arm is for.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming this (pi-hrx-compat). Two of the three co-moving factors are now ruled out with dates, and the remaining one is bigger than the list suggests: the 21 Oct numbers predate every 1-bit kernel on this box.

    Ruled out, with what rules them out

    ppfeaturemask is not it. /etc/modprobe.d/amdgpu.conf does hold a non-default mask —

    options amdgpu lockup_timeout=10000 timeout_period=10000 ppfeaturemask=0xfff73fff
    

    0xfff73fff clears bits 19, 15 and 14 against the all-ones default (0x8c000), which looks exactly like a smoking gun for a clocks/DPM difference. It is not: the file's mtime is 2026-10-16 13:34, five days before the 21 Oct measurement, and the copy in place now was born 2026-10-31 during the reinstall. Constant across both arms, so it cannot explain −17 %.

    CPU power state is not it either. scaling_governor = performance and energy_performance_preference = performance on cpu0 today. That is one of the first things a reinstall silently resets, so it was worth checking before anything else; it is set correctly.

    What is left, and it is not in the pin table

    /boot on this box:

    image date
    vmlinuz-7.0.0-43-generic 2026-10-23
    vmlinuz-7.3.0-rc4-1bit-perfopt+.unsigned 2026-10-29
    vmlinuz-7.3.0-rc4-1bit-perfopt+ 2026-10-31
    vmlinuz-7.4.0-rc1-1bit 2026-11-04 (default since 11-11)

    The first 1-bit kernel on this box is dated 2026-10-29 — eight days after the 21 Oct numbers were recorded. So arm A rebuilt today is not running the environment that produced 36.0 tok/s: it is running 7.4.0-rc1-1bit, while the recorded number was produced on a stock Ubuntu kernel (7.0.0-4x-generic, the newest image that existed on 21 Oct). The issue's factor list says "Kernel: 7.4.0-rc1-1bit, the default since 11-11", which reads as a recent default change; the stronger statement is that the two measurements are separated by a kernel family change, which subsumes amdgpu driver version, MM, scheduler and the cmdline flags.

    One of those flags is worth calling out because it is perf-relevant and on the current cmdline:

    amdgpu.cwsr_enable=0
    

    CWSR is the compute wave save/restore used for compute-queue preemption; disabling it changes how compute queues are scheduled. I could not date when it was added — persistent journal on this box begins 2026-11-07 (boots −12 onward), so 21 Oct is not retrievable from logs, and the one old boot still in the journal (-8, 11-08 23:05) is a recovery nomodeset boot with no GPU. That is a hard limit on this line of inquiry: the 21 Oct environment is not recoverable from the box, only from the record.

    The experiment this suggests, and it needs no code

    7.0.0-42-generic is still installed. Booting it — or any stock kernel — and running arm A's own tools/bench.py would separate "kernel family" from everything else in one reboot: if 36.0 tok/s comes back, the drop is under the kernel and the bisect should be 7.0.0-43-generic vs 7.3.0-rc4-1bit vs 7.4.0-rc1-1bit; if it does not, the kernel is exonerated and the OS reinstall/toolchain pair is what is left.

    I am not doing that unilaterally: it is a reboot of a shared box, and this lane does not own the decision. Flagging it as the next step with the evidence that makes it the cheapest discriminator available.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Follow-up with something better than my previous suggestion: the preemption model can be A/B'd on today's kernel with an echo, no reboot and no kernel swap.

    While diffing what the 1-bit kernels carry, 7.4.0-rc1-1bit has:

    CONFIG_PREEMPT_BUILD=y
    CONFIG_PREEMPT_LAZY=y
    # CONFIG_PREEMPT is not set
    CONFIG_PREEMPT_DYNAMIC=y
    

    and the live mode is:

    $ cat /sys/kernel/debug/sched/preempt
    full (lazy)
    

    full (lazy) differs from what a stock Ubuntu generic kernel runs — those are built PREEMPT_DYNAMIC with voluntary as the default. So between the 21 Oct number and today there is also a change in when the scheduler may preempt, which is exactly the kind of thing that shows up in a decode loop whose step structure (measured in this issue) is 1 + 2 submissions with ≈ 4–15 ms host gaps: the loop is wakeup-latency bound in the gaps, and lazy preemption defers reschedules.

    I am not claiming the sign. Lazy preemption normally helps throughput by preempting less, and it can also hurt a caller that is repeatedly blocking on a GPU wait and expecting to be rescheduled promptly. Which one it is here is a measurement, and the measurement is now cheap:

    # inside one gpu-hold ticket, same kernel, same build
    cat /sys/kernel/debug/sched/preempt            # baseline: full (lazy)
    tools/bench.py ...                            # arm 1
    echo voluntary | sudo tee /sys/kernel/debug/sched/preempt
    tools/bench.py ...                            # arm 2
    echo none | sudo tee /sys/kernel/debug/sched/preempt
    tools/bench.py ...                            # arm 3
    echo "full (lazy)" | sudo tee /sys/kernel/debug/sched/preempt   # restore

    Because CONFIG_PREEMPT_DYNAMIC=y, that file accepts the mode at run time, so this isolates the preemption model within a single ticket on a single build — no reboot, no second build, and it can be interleaved A B A B like everything else on this box. That is a much better discriminator than my earlier stock-kernel-boot suggestion, which required a reboot of a shared machine; keep that as the fallback if the preemption result is null.

    Restore the file afterwards — it is a system-wide scheduler setting, so a forgotten none would change every lane's timing rather than just the measurement.

    One honest limit: I could not compare against the 21 Oct configuration directly, because that boot predates the persistent journal on this box (earliest entry 2026-11-07) and the stock config-7.0.0-* files are not retained in /boot. The voluntary default above is from the stock config's design, not from a file I could read here. If the 21 Oct kernel's config exists anywhere in the record, that settles it without a run.

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

    @bong-water-water-bong
    CollaboratorAuthor

    I went looking for the 21 Oct environment in the box's own record, and can now say exactly where it is not — which saves the next person the same search.

    There are 21 Oct bench logs on this box: ~/amd-oss/lemonade-bench-2026-10-21/logs/, one file per model/backend, including Qwen3.8-27B-GGUF__hrx__P2b.log. They are a different harness from the tools/bench.py numbers in this issue (lemonade bench, ctx=32768, batches), so they cannot be used to re-derive 36.0 tok/s directly — but they were the best hope of recovering the environment, and they do not contain one: no uname, no ROCm/driver version, no clang version, no GPU or clock state. The only strings that looked like versions were model names (Qwen3.5-4B).

    The tree those runs used, ~/wt/lbench-1021, no longer exists. So the three ways the 21 Oct environment could have outlived its boot — journal, config file, surviving tree — are each exhausted:

    route state
    persistent journal begins 2026-11-07; 21 Oct not present, and the one old boot retained is a recovery nomodeset boot with no GPU
    /boot/config-7.0.0-* not retained; only the 1-bit kernel configs are there
    21 Oct bench logs present, no sysinfo in them
    ~/wt/lbench-1021 deleted

    That is a negative result and it is the useful kind: the 21 Oct configuration can only be established by re-running it, not by reading. Which is what the preemption A/B in my previous comment does without a reboot, and what a stock-kernel boot would do with one.

    I have not run either: the 27B gguf is not on this box under ~/models (the bench pulls a 16.4 GB container), and this lane has no built HRX bench tree for that model. The A/B is left documented rather than attempted, which is the honest state — a measurement I cannot take is not a measurement.

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

    @bong-water-water-bong
    CollaboratorAuthor

    I tested the preemption idea instead of proposing it, and it produces two corrections: my echo voluntary recipe was wrong, and the effect is not resolvable.

    First, the recipe in my previous comment does not work on this kernel

    $ echo voluntary | sudo tee /sys/kernel/debug/sched/preempt
    /sys/kernel/debug/sched/preempt: Invalid argument
    

    none and voluntary are both rejected. The only accepted inputs are:

    write resulting mode
    full (full) lazy — full preemption, lazy resched deferral off
    lazy full (lazy) — the default
    none, voluntary, full (lazy), full lazy, lazy full EINVAL

    So the tunable is not "which preemption model" — this build ships full preemption and exposes only the lazy deferral on/off. Anyone following my earlier comment would have got EINVAL and concluded the file was read-only. full (lazy) is also the display form, not an input.

    Second, the A/B: no resolvable difference

    A 4 ms periodic nanosleep loop measuring oversleep beyond the request, 1200 wakes per arm, interleaved, mode restored after each arm (the gaps in a decode step are sleep/wake bound, so if late wakeups were the mechanism this is where it would show):

    arm mode mean p50 p90 p99 max
    lazy r1 full (lazy) 0.106 ms 0.060 0.074 1.652 8.421
    nolazy r1 (full) lazy 0.061 0.057 0.067 0.099 0.672
    lazy r2 full (lazy) 0.066 0.054 0.068 0.356 1.103
    nolazy r2 (full) lazy 0.075 0.055 0.091 0.580 0.880

    p50 is the same to within 6 µs across all four arms. The tails differ but not consistently: lazy is far worse in r1 (p99 1.652, max 8.421) and better in r2 (p99 0.356) than nolazy. Paired arm means are 0.086 (lazy) vs 0.068 (nolazy) — a 0.018 ms difference with a within-arm spread of 0.040 ms, i.e. the difference is smaller than the noise between two runs of the same arm.

    Even at face value, 0.018 ms per wake × ~100 submissions per step = 1.8 ms on a 112 ms step ≈ 1.6 %, which cannot account for −17 %. So: do not spend the stock-kernel reboot on the preemption hypothesis. It is ruled out as a large effect at the mechanism level; only a >2 % effect would have been visible here.

    What this measurement can and cannot say

    It says: lazy resched deferral does not systematically delay a periodic 4 ms wake on this box, which is the only plausible way the mode change would reach a decode loop. It does not say the mode is irrelevant to the full workload — the real loop's wakeups are triggered by GPU completion rather than a timer, and a completion interrupt landing during a lazily-deferred window is a different case. If someone wants that measured, the cheap version is the real ben**ch under both modes, in one ticket, interleaved — which is what my previous comment proposed and which still needs the 27B container this lane does not have.

    The box is restored to full (lazy), which is how it was found.

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

    @bong-water-water-bong
    CollaboratorAuthor

    120 W cap: no decode gain, so power is not the remaining −10…−14 %

    ORCH OWNER GO, one gpu-hold ticket 22:33:12–22:50:37Z, 0 GPU faults, :8095 up as normal. Each phase is one round of the tree's own tools/bench.py with --prompt-reps 1. Sensors were sampled every 1 s; "busy" means sclk > 1,500 MHz.

    phase cap MTP code / prose / short plain code / prose / short sclk median PPT median / peak Tctl peak edge peak fan1
    B90 (today's tree) 90/90/105 32.0 / 23.6 / 26.4 11.5 / 11.4 / 11.4 2,490 90.0 / 99.5 W 75 °C 67 °C level 4, ≤ 4,195 rpm
    B120 120/120/120 31.7 / 23.5 / 26.2 11.5 / 11.3 / 11.1 2,260 119.9 / 120.1 W 81 °C 77 °C level 4, ≤ 4,227 rpm
    A120 (#487 tree) 120/120/120 31.1 / 24.3 / 27.1 – 2,527 119.1 / 120.0 W 84 °C 75 °C level 4→5, ≤ 4,823 rpm
    V90 (after restore) 90/90/105 – 11.7 / 11.8 / 11.7 2,602 90.0 / 103.7 W 76 °C 64 °C level 4

    (MTP and plain are medians, tok/s)

    • The cap took effect. PPT sat at 120 W for the whole B120/A120 span, against 90.0 W before and after.
    • Decode did not move: today's tree MTP −1 / 0 / −1 %, plain 0 / −1 / −3 %, all inside round-to-round noise. A at 120 W (31.1 / 24.3 / 27.1) matches A at 90 W with :8095 stopped (31.0 / 23.3–24.3 / 26.6–27.0).
    • The extra 30 W did not raise sclk (median 2,260 at 120 W against 2,490 at 90 W). mclk stays at its top level, 1000 MHz, in every phase. Decode on this model is bandwidth-bound, and the 90 W cap was not what held it.
    • Safety: peak Tctl was 84 °C (watchdog limit 90), there were no amdgpu resets or faults, and fan1 stepped to level 5 once in A120.
    • Restore:
      • sudo -n /usr/local/sbin/1bit-board power → power: mode=performance cap=90/90/105W tctl=95, rc 0, /run/1bit-smu-cap = 90/90/105.
      • ryzenadj -i cannot confirm it on this kernel: STRICT_DEVMEM refuses the pm-table read with "Unable to get memory access", as 1bit-board documents. So I verified it by behaviour instead: V90 (after the restore) shows PPT median 90.0 W again, peaking at 103.7 W under the 105 W fast limit.
      • /etc/1bit/power was not edited. Aside: its mode= / cap= keys are not keys power_conf parses (it reads POWER_MODE= / STAPM_W= …). Today the file is ignored, and the result matches only because the defaults are the same 90/90/105.

    Where #2579 stands

    candidate result
    a commit in the pins ruled out: #487's own tree is slow today
    the model file ruled out: same bytes as HF since 08-19
    resident idle :8095 HRX server ~3–9 % on both trees (about a third of the gap)
    power cap 90 → 120 W 0 %
    kernel 7.4-rc1 (vs 7.3.0-rc4-1bit-perfopt) waits for the owner's test boot
    toolchain clang 23 → 24 + ROCr (10-31 reinstall) no clang 23 TheRock left on the box

    The remaining −10…−14 % is now between the kernel and the toolchain. Both are below anything I can change in a ticket: the 7.3 test boot is the next experiment.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The kernel command line changed between the two measurements, and it carries two perf-relevant amdgpu options that are not in this issue's factor list.

    /etc/default/grub, mtime 2026-11-04 05:59 (four days after the 10-31 reinstall, sixteen days after the 21 Oct numbers):

    GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 splash ttm.pages_limit=31457280
                                ttm.page_pool_size=31457280 amdgpu.cwsr_enable=0"
    

    and /proc/cmdline today carries amdgpu.cwsr_enable=0 and both ttm limits, i.e. this is the live configuration, not a stale file.

    Two of those three are performance-relevant to a decode loop and neither appears in the "what changed under the code" list:

    • amdgpu.cwsr_enable=0 — CWSR is Compute Wave Save/Restore, the mechanism compute queues use for preemption (and, on some paths, for queue scheduling). A decode loop issuing many small submissions is exactly the workload whose cost profile changes when that is off. This is the single most plausible cmdline candidate I have found, and it is one word.
    • ttm.pages_limit=31457280 with page_pool_size=31457280 — 120 GB of TTM pages plus a 120 GB page pool. If 21 Oct ran with defaults (a far smaller limit and pool), then GTT allocation, eviction and reuse behaved differently for a 16.4 GB model on a shared-memory box, in either direction.

    Why this is stronger than the factors already listed

    "Kernel: 7.4.0-rc1-1bit, default since 11-11" describes which image boots. These are module parameters, which are (a) not in any pin, (b) not in any commit, (c) not visible in uname -r, and (d) composed at exactly the moment the box was reinstalled — the same window as the toolchain change. A comparison that holds "same pins, same file, same toolchain" fixed can still differ in all three of these.

    What to do with it

    The honest limit first: none of the three can be changed at run time (cwsr_enable and ttm.pages_limit are read at module load), so this is a reboot experiment, not an echo. That makes it a decision for whoever owns the reboot window, and it competes with the stock-kernel boot I proposed earlier — but it is much cheaper: same kernel image, one cmdline word removed, back-to-back.

    If it is taken: remove only amdgpu.cwsr_enable=0 first (leave the ttm values alone), run arm A's bench, and compare against today's numbers. If that moves nothing, restore it and drop page_pool_size next. One variable per boot, because the whole point of this issue is that several things moved together and none is isolated.

    I have not changed anything: no grub edit, no update-grub, no reboot. This lane does not own that decision, and the box is serving.

  10. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The cwsr_enable=0 lead has a mechanism, verified statically in the shipped libraries — HRX creates AMD queues whose preemption is exactly what that parameter disables.

    Following the backend down, on the packages this box actually runs:

    libggml-hrx.so    NEEDED: libggml-base, libhrx.so.0, libloomc.so.0 …     hip=0  hsa=0
    libhrx.so.0       strings: libhsa-runtime64.so, hsa_init, hsa_executable_load …
                      hsa_amd_queue_create, hsa_amd_queue_create_raw,
                      hsa_amd_queue_cu_set_mask, hsa_amd_queue_get_info
    

    So ggml-hrx does not speak HIP at all: libhrx dlopens libhsa-runtime64.so and drives the device through the HSA executable API plus hsa_amd_queue_create. That is the AMD-specific queue API — the one whose queues are preempted by Compute Wave Save/Restore. With amdgpu.cwsr_enable=0 on the kernel command line, those queues run without it.

    That does not prove the 17 % — it makes the parameter a mechanistic candidate rather than a guess: HRX's queues are precisely the objects CWSR governs, and this issue's own step structure (many small submissions with 4–15 ms host gaps) is the pattern where queue preemption behaviour shows up in wall time.

    It also explains an operational trap this lane has already hit. libhrx needs hsa_amd_queue_create at dlsym time; the system libhsa-runtime64.so.1 on this box does not export it (only the bundled/~/wt/libhsa-runtime copies do — both of which I checked define it). That is why an HRX build against the system runtime registers no devices and silently runs on the CPU. Anyone reading the bench numbers in this issue should confirm which libhsa the run resolved, because a CPU-fallback run would not be a like-for-like comparison — it would simply be much slower, which is one of the shapes a "17 % below" number could take.

    Two things that follow, neither of which I am doing unilaterally:

    • the reboot A/B I proposed stands, and is now the more attractive of the two: same kernel image, remove only amdgpu.cwsr_enable=0, bench, compare — one variable, one reboot;
    • for any future measurement on this issue, record LD_LIBRARY_PATH and the resolved libhsa-runtime64 path alongside the tok/s. Two arms of this comparison that resolved different HSA runtimes would not be comparing the same thing, and nothing in the current tables would show it.
  11. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The cwsr_enable=0 hypothesis is confirmed on the running box, three ways — and the 11-04 date in the earlier comment is right to the minute.

    Taking this issue up (no comment in 17 h, and the lead is checkable from here).

    $ cat /proc/cmdline
    … ttm.pages_limit=31457280 ttm.page_pool_size=31457280 amdgpu.cwsr_enable=0 crashkernel=…
    
    $ ls -la /etc/default/grub
    -rw-r--r-- 1 root root … Nov  4 05:59 /etc/default/grub
    $ grep amdgpu /etc/default/grub
    GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 splash ttm.pages_limit=31457280
                                 ttm.page_pool_size=31457280 amdgpu.cwsr_enable=0"
    
    $ cat /sys/module/amdgpu/parameters/cwsr_enable
    0
    

    What each line establishes, separately:

    1. /proc/cmdline — the running kernel was booted with it, so this is not a config file that someone has not applied.
    2. /etc/default/grub, mtime Nov 4 05:59 — the edit date matches the earlier comment's claim, and the option is in the same line as the TTM settings.
    3. /sys/module/amdgpu/parameters/cwsr_enable = 0 — the loaded module's own value, so the parameter reached the driver rather than being ignored at parse time.

    That matters for this issue's conclusion, and makes it stranger: the 17 % drop was measured against 21 Oct numbers, cwsr_enable=0 arrived on 4 Nov, and this box has been booting with it since. So the "environment, not a commit" reading is right, and it is one specific environment change with a date rather than an unattributed drift.

    The test this enables, and why I am not running it

    cwsr_enable=1 plus a reboot, then re-measure the 27B --mtp decode with the same arm. If the 36.0 tok/s comes back, the mechanism is confirmed end to end and the fix is "do not disable CWSR while HRX preemption is in use".

    I am not rebooting this box for it: a reboot drops every lane's tickets and in-flight work, and the earlier ORCH line in this thread is about environments, not about who runs update-grub. Whoever schedules a reboot for another reason should fold this in — it costs one extra kernel argument and one measurement, and it is the only way to move this issue from "one specific environment change" to "the cause".

    One thing worth separating while you are there

    ttm.pages_limit=31457280 and ttm.page_pool_size=31457280 share that line with cwsr_enable=0. 31,457,280 pages × 4 KiB = 120 GiB of GTT. If the reboot also re-tunes those, the two changes land together and the measurement attributes the difference to whichever is in the commit message. Change one at a time, or run three arms — stock, +cwsr_enable=1, +cwsr_enable=1 with the TTM values restored.

  12. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The static half of the mechanism, from the pinned hrx-system: HRX creates queues with the AMD descriptor API and supports the queue types that preemption exists to serve — so cwsr_enable=0 removes a capability the backend can use, rather than denying one it never asks for.

    runtime/src/iree/hal/drivers/amdgpu/hsa_queue.c:

    hsa_amd_queue_create_desc_t descriptor = {
        .version = HSA_AMD_QUEUE_CREATE_DESC_VERSION,
        .flags   = HSA_AMD_QUEUE_CREATE_SYSTEM_MEM,
        .engine_type = HSA_AMD_QUEUE_ENGINE_COMPUTE,
        .priority = params->priority,
        .engine.compute = { .type = params->type, … },
    };
    iree_hsa_amd_queue_create(…, params->agent, &descriptor, /*num_descs=*/1);

    Three things in that snippet matter here:

    1. It is hsa_amd_queue_create, not hsa_queue_create — the descriptor form, which is the one that carries an engine type, a priority and a CU mask.
    2. HSA_QUEUE_TYPE_COOPERATIVE is accepted (and refused only when the priority is not NORMAL): "native cooperative queues require normal scheduling priority". Cooperative concurrency is exactly what mid-kernel preemption (CWSR) exists to provide.
    3. Multiple physical queues are supported — physical_queue_count appears in the block processor and the device-spec builder, so the runtime can put work on more than one queue.

    So the mechanism the earlier comment proposed has a concrete shape: amdgpu.cwsr_enable=0 removes preemption globally, and work that would otherwise interleave across queues — or run cooperatively — serialises. A 17 % loss on a --mtp decode, where a target pass and a draft/verify pass can otherwise overlap, is the right order of magnitude for that.

    What this is, and what it is not

    It is: static evidence that the backend uses the queue types preemption serves, so "environment, not a commit" has a named mechanism rather than a correlation.

    It is not: evidence for the 17 %. Only the three-arm measurement can attribute the drop, and it needs a reboot:

    • arm 1: as-is (cwsr_enable=0, TTM as configured)
    • arm 2: cwsr_enable=1, everything else identical
    • arm 3: as arm 2 with the TTM values restored to whatever 21 Oct had — because ttm.pages_limit/ttm.page_pool_size share that GRUB line and would otherwise be confounded with it.

    Prints to record per arm: the 27B --mtp tok/s (same gguf, same prompts), physical_queue_count actually created, and whether the dispatch profile shows the two passes overlapping.

    The cheapest thing that is still not a reboot

    If someone has a gpu-hold free: run the 27B --mtp decode today and record whether the MTP and target passes interleave in the dispatch profile. If they already serialise today, the 17 % is explained without touching GRUB; if they interleave despite cwsr_enable=0, this mechanism is wrong and the drop is elsewhere. That is one ticket and no reboot, which is why it should come before the three-arm plan.

  13. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    There is a dated measurement between the baseline and today, in this repo's own config/recipes.json, and it takes part of the drop off the cwsr_enable=0 hypothesis.

    The issue compares 21 Oct (36.0 / 26.8 / 29.9 tok/s code / prose / short) with today ("17 % below"), and attributes the difference to the 4 Nov kernel-cmdline change. The recipe that arm B ran records a third point:

    config/recipes.json  ->  id "qwen35-mtp-max-3", args ["--spec-draft-n-max", "3"]
      measured: "Qwen3.8-27B UD-Q4_K_XL with its in-file MTP head, greedy 256-token chats,
                 medians of 3, performance mode, 2026-10-24:
                 --mtp-max 3 gives 32.6 / 26.9 / 28.0 tok/s on code / prose / short
                 (12.1 / 12.1 / 12.5 without drafting)"
    

    That is 24 Oct — ten days before the cmdline change — and code is already 32.6 against the 21 Oct 36.0. So if the two used the same protocol, about 9 % of the code number was gone before cwsr_enable=0 existed, while prose (26.8 → 26.9) and short (29.9 → 28.0) barely moved.

    What that changes

    • cwsr_enable=0 cannot be the whole story for the code case, unless the 21 Oct protocol differed. It could still be the whole story for the remainder, or for the prose/short arms — which is exactly what the three-arm measurement would tell you.
    • The regression looks code-shaped, not uniform. Code makes the longest generations, so a per-step serialisation cost would show up there first — consistent with the mechanism — but so would several other things, and a uniform per-step cost should have moved prose by a similar fraction as code rather than +0.4 %.
    • The recipe's own numbers are a check on today's run: if the measurement I am set up to take lands at ~29.9 / 22.2 / 24.8 (17 % below 36.0 / 26.8 / 29.9), the shape has to be compared against 32.6 / 26.9 / 28.0 as well, or the conclusion will attribute a 10-day-old change to a 12-day-old one.

    The caveat that decides whether this holds

    Two protocols may not be one: the recipe says "greedy 256-token chats, medians of 3, performance mode", and the 21 Oct figure's protocol is not stated in the issue. If they differ, the 32.6 is not comparable and this whole line collapses. The recipe's own text is the only record of how 32.6 was taken, so whoever runs the three arms should state the protocol explicitly and take the 21 Oct arm with both protocols if they differ.

    I am not claiming the drop is smaller than 17 % — I am claiming there is a third datapoint in the repository that the comparison skipped, and that it changes which change the remaining delta can be attributed to.

  14. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    A cheaper hypothesis than the reboot plan, and it has a mechanism: the engine applies a CWSR workaround unconditionally, on a box where CWSR is disabled — so the workaround may be pure cost.

    From 1bit serve --help and docs/hrx.md:

    [--hrx-cwsr-placement=auto|on|off]   engine#315: HRX backends get
            HSA_USE_SVM=0  HSA_USERPTR_FOR_PAGED_MEM=0  HRX_ALLOW_NO_SVM=1,
            which puts the CWSR save area in GTT.
            auto (the default) ALWAYS does this; off, or HRX_SVM=1, turns it off.
    

    and docs/hrx.md:60:

    "HRX_ALLOW_NO_SVM=1 lets the amdgpu HAL open a ROCr that reports no SVM, which 1bit serve uses to put the CWSR save area in GTT on a CWSR-on box"

    Why that matters here

    This box is not a CWSR-on box. amdgpu.cwsr_enable=0 (verified three ways earlier in this thread), so there is no CWSR save area to place — and yet the trio is applied always. The workaround's stated purpose has no subject on this machine, while its cost (open ROCr with no SVM, page-backed userptrs off) is paid on every allocation.

    That is a mechanism, not a correlation: HSA_USE_SVM=0 + HSA_USERPTR_FOR_PAGED_MEM=0 change how every buffer is mapped, and the hlnd-style cost of that is exactly the kind of thing that lands as a uniform per-step slowdown — with the longest generations (code, 256-token chats) showing the largest absolute loss, which matches the shape of the 17 %.

    The experiment that needs no reboot

    1bit serve -m Qwen3.8-27B-UD-Q4_K_XL.gguf --device hrx --mtp <same gguf> --mtp-max 3 \
        --hrx-cwsr-placement=auto      vs      --hrx-cwsr-placement=off
    

    Two arms, same binary, same model, one after the other in one ticket, --mtp-max 3 in both. I have the script staged to take exactly those two arms and it runs as soon as a memory window is free (the fleet's 45-minute rule puts the next at 20:46:57Z).

    What each outcome means:

    • off is faster → the workaround is costing performance on a CWSR-off box, the fix is one line in hrx_cwsr.h/apply_cwsr_env_to_self (do not apply the trio when cwsr_enable reads 0), and no reboot is needed at all.
    • both the same → the trio is cheap here and the drop is elsewhere; the three-arm reboot plan becomes the only remaining route.

    The caveat, stated before the data

    cwsr_enable=0 means the kernel will not preempt, but the trio may still be load-bearing for a reason this issue has not recorded — the docs say the workaround prevents a fault "inside ROCr/the HAL before any of our code runs", and a fault is not a performance question. If off produces a fault or a hang, that ends the experiment and the workaround stays; if it produces the same output faster, it is free performance on this box.

    Also worth noting: if this pans out, it does not contradict the cwsr_enable=0 hypothesis — it identifies what that setting costs through the engine, which is a more useful finding than "the boot line changed".

  15. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Withdrawing the --hrx-cwsr-placement=off experiment I proposed an hour ago: app/hrx_cwsr.h says the trio is applied because the SVM save area faults with CWSR off. My hypothesis had the causality backwards, and running my arm would reintroduce the fault.

    The comment at app/hrx_cwsr.h:99 is unambiguous:

    "engine#315 candidate 1 is the default since 2026-10-31: with the TheRock nightly libhsa the pageable-SVM save area page-faults on the first HRX graph replay even with CWSR off, which is the shipped configuration here, so auto can no longer key off cwsr_enable. The opt-outs are --hrx-cwsr-placement=off and HRX_SVM=1 (a box whose ROCr does not need the GTT placement)."

    So:

    • I was right that the trio is unconditional — Auto calls place() without consulting cwsr_enable.
    • I was wrong about why, and that is the part that matters: it is not a workaround for a CWSR feature this box has disabled. It prevents a page fault in the SVM save area that happens with CWSR off, i.e. exactly on this configuration.
    • read_cwsr_enable() exists and the decision deliberately does not gate on it — someone already asked my question and answered it in the code, with a date and a failure mode.

    So the arm I proposed (off vs auto) is not a performance test — it is a known fault, reproduced on the first HRX graph replay. Anyone who read my previous comment should not run it. I have not run it: the window is still 30 minutes out and I read the header before spending it.

    What survives from that comment: nothing about the trio as a cost. What it leaves for #2579 is back to the earlier split — 21 Oct 36.0 / 24 Oct 32.6 / today unknown, with the cwsr_enable=0 boot line as one candidate for the post-24-Oct portion and no cheap engine-side lever to test it.

    The measurement still worth taking (auto placement only, no opt-out) is the plain one I staged first: today's 27B --mtp tok/s with the flags this box ships with, compared against all three datapoints rather than two. That needs no opt-out, no reboot and no fault risk, and it is what I will run when the window opens.

    The general lesson, since this is the third time today I have published a mechanism before reading the code that decides it: the flag's help text told me what it does and the header told me why, and only the second one could have stopped me. --help describes behaviour; the comment describes the failure the behaviour exists for.

  16. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    A measured reason the strict placement refuses this model, straight from serve's own memory line — the MTP draft is a second full copy of the 27B, so the pair needs 34.19 GiB, not 17.

    1bit serve on Qwen3.8-27B-UD-Q4_K_XL.gguf with --mtp <the same gguf> prints, before it does anything else:

    1bit serve: memory: need 34.19 GiB (Qwen3.8-27B-UD-Q4_K_XL.gguf: weights 16.45 + KV/state 0.40 + compute 0.50; draft 16.84) at ctx …
    

    Two things follow, and both change how this issue should be reproduced:

    1. draft 16.84 is a whole second copy of the model. Nothing in the issue's arm-A recipe says the draft is the same file because it is cheap; it is the same file because that is the only MTP head available — and it costs as much as the target. So the arm's memory floor is ~34 GiB, and the "same gguf" shorthand understates what is being loaded.
    2. That is why the HRX placement splits. With other lanes holding GTT, the guardrail reports GTT total 120.0 GiB, in use 7.7 GiB, ceiling 104.0 GiB (reserve 16.0 GiB), pool budget 96.3 GiB, and the placement then leaves two nodes off HRX:
    HRX strict placement refused the model: "node_50" is PAD f32 ne=[248320,2,1,1] and is not placed on HRX;
    2 of 52 nodes off HRX (GET_ROWS x 1, PAD x 1), 3 splits.
    

    GET_ROWS and PAD — the two op classes already catalogued as declined by device_supports_op in #2704 — not the attention or matmul path. So the split is a pool-budget consequence, and the refusal's own escape hatch (--no-strict-device, or "a retry on a quieter box") is what any reproduction must use or must avoid encountering.

    Practical consequence for the 17 % question: a measured drop taken with --no-strict-device puts 2 of 52 nodes on the CPU. If today's number comes in low, that flag, and whether the 21 Oct / 24 Oct figures were taken with or without it, is a candidate explanation that must be excluded before cwsr_enable=0 is blamed — the same one-change-at-a-time rule the boot line already demands.

    Status: three attempts, three mechanical outcomes and no tok/s yet — a 33-minute queue that outlived my task cap, then a window taken 18 seconds after my own previous one ended (window-run exit 75, nothing stopped, nothing logged), and the strict-placement refusal above. The staging is correct and the next legal window is ≥22:12:09Z; I will report tok/s against all three datapoints (21 Oct 36.0 / 26.8 / 29.9, 24 Oct 32.6 / 26.9 / 28.0, today) rather than against two.

  17. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Measured on main today: eval 14.57 then 18.04 tok/s (68.65 / 55.44 ms per token) at 48 tokens, cwsr_enable=0 confirmed, MTP accepting 0.66 of its drafts. That does NOT settle the 17 % — it is a different protocol from the recipe's, and one confound is mine. Both caveats below, because the number is only as good as its shape.

    The run, inside a ticket, on the CWSR placement this box ships with (amdgpu cwsr_enable=0, logged by serve itself), model Qwen3.8-27B-UD-Q4_K_XL.gguf at the same sha as 21 Oct, --mtp <same gguf> --mtp-max 3:

    run 1: prompt eval 11 tok in 962.49 ms (87.50 ms/tok, 11.43 tok/s)   eval 48 tok in 3226.75 ms (68.65 ms/tok, 14.57 tok/s)
    run 2: prompt eval 11 tok in 405.10 ms (36.83 ms/tok, 27.15 tok/s)   eval 48 tok in 2605.89 ms (55.44 ms/tok, 18.04 tok/s)
    both:  draft acceptance = 0.65957 (31 accepted / 47 generated), mean len = 2.94
    

    What that does establish, and it is not nothing: MTP is working. An acceptance of 0.66 with mean drafted length 2.94 means the head is proposing and the target is agreeing, so nothing in this drop has broken speculative decoding. That rules out one of the two shapes of "17 % slower" — this is not MTP degenerating into wasted drafts.

    Why it is not comparable to 36.0 / 26.8 / 29.9 or 32.6 / 26.9 / 28.0, and I would rather say this plainly than quote a ratio:

    1. 48 tokens against 256. config/recipes.json is "greedy 256-token chats, medians of 3, performance mode". A 48-token generation pays the same fixed per-request cost over one fifth of the tokens, and the two runs above differ by 621 ms of eval time for identical work — that variance is the graph-realloc/first-request cost, which a 48-token denominator does not amortise. Two runs is not a median of three.
    2. --no-strict-device, which I had to add. Strict placement refused the model with other lanes holding GTT (24.8 of 120.0 GiB in use, pool budget 96.3 GiB) and left 2 of 52 nodes off HRX (GET_ROWS x 1, PAD x 1), 3 splits. A CPU GET_ROWS per layer is exactly the kind of thing that costs more than 17 %, and serve's own refusal offered the alternative — "a retry on a quieter box". So the ~2x gap between 18 tok/s and the recipe's 27-36 is not evidence about cwsr_enable; it is evidence that my arm ran a different graph.

    So the honest state of #2579: the boot argument is confirmed unchanged (cwsr_enable=0, GRUB_CMDLINE_LINUX_DEFAULT mtime Nov 4 05:59, sysfs agrees), the third datapoint (24 Oct 32.6 / 26.9 / 28.0) still says part of the drop predates that change, MTP is confirmed healthy at 0.66 acceptance, and the comparable measurement is still owed — 256-token generations, median of 3, on a box quiet enough for strict placement so the two arms differ in one thing.

    The next run uses the recipe's own protocol, not my 48-token shape, and it reports the placement it got rather than the one I asked for. If the queue keeps a run from getting strict placement, the right answer is "not measured under comparable conditions" rather than a ratio nobody should quote.

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

    @bong-water-water-bong
    CollaboratorAuthor

    A host-side measurement nobody has made for this issue: the two kernel families differ in exactly the config surface that governs decode-step latency, and the difference was never named.

                             HZ     NO_HZ   NO_HZ_FULL  SCHED_CORE
    7.0.0-43-generic       1000       y         y           y        ← the 21 Oct numbers
    7.3.0-rc4-1bit-perfopt  250       n         y           n        ← first 1bit kernel (10-29)
    7.4.0-rc1-1bit          250       n         y           n        ← current
    

    CONFIG_HZ is 1000 on the stock kernel and 250 on both 1bit kernels — read from /boot/config-<ver>, so it is a property of the images, not of a measurement session. With NO_HZ off in both 1bit kernels, that is a 4 ms periodic tick instead of 1 ms on a box whose decode loop is a sequence of small wakeups, and SCHED_CORE (core scheduling, absent in both 1bit kernels) changes which tasks can share an SMT sibling.

    This is a plausible mechanism for "decode 17 % down, prefill unaffected", which is the shape this issue records: a periodic tick and SMT core scheduling hit per-token wakeup latency, while a long prefill kernel is one dispatch and cannot see them. It is also the kind of difference that no amount of re-running the same model on the same box will reveal, because it is constant within a boot.

    Three things it changes for #2579:

    1. the A/B the issue is waiting on needs a third arm: not only "rebuild with/without cwsr_enable=0" but also the same binary on a HZ=1000 image, because the config difference is present in both 1bit kernels and therefore cannot be attributed by any comparison between them;
    2. it is testable without a reboot of the box's defaults if a HZ=1000 variant of the 1bit kernel exists or can be built — and it is a one-line config change, not a patch series;
    3. it explains why the 7.3 kernel did not fix it: 7.3.0-rc4-1bit-perfopt+ and 7.4.0-rc1-1bit are identical in all four fields, so whatever changed between them cannot be the cause of a delta that both share against 21 Oct.

    I am not claiming this is the cause — mtp decode also depends on the driver, the ROCm stack and the model path, and this issue's own numbers are from --mtp, which multiplies decode steps per token. But two kernels that are identical on HZ/NO_HZ/SCHED_CORE while both regress against a stock kernel that differs on all three is the first explanandum-shaped fact this issue has had, and it is cheaper to test than the cwsr A/B it has been waiting for.

  19. bong-water-water-bong commented on Nov 16, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Testing the mechanism before anyone spends a reboot on it: the wakeup-quantisation path is measurably ABSENT on this box, so the HZ difference I posted twenty minutes ago is not the decode regression via that route.

    nanosleep(1 ms), 400 samples, overshoot in ms:
      min 0.014   p50 0.054   p90 0.058   max 0.071   mean 0.054
      < 0.5 ms: 400 (100 %)      3-5 ms: 0 (0 %)
    clocksource: tsc
    

    If the mechanism were "a 4 ms periodic tick quantises per-token wakeups", a 1 ms sleep would show overshoot clustered at multiples of 4 ms. It shows 0.054 ms mean with a 0.071 ms maximum and not one sample in the 3–5 ms band — because high-resolution timers drive the sleep path, so CONFIG_HZ=250 does not gate wakeups at all. My hypothesis had exactly the shape of a real effect and none of the substance, and it took five seconds to find that out.

    What survives, stated more narrowly:

    • the config difference is real and still worth knowing — HZ 1000 vs 250, NO_HZ on vs off, SCHED_CORE on vs off between the 21 Oct stock kernel and both 1bit kernels. It is still the only clean boundary between "the numbers we lost" and "the kernels we have";
    • but HZ acts through timer-driven paths (RCU callbacks, scheduler load balancing, preemption points, NO_HZ idle-entry cost), not through sleep/wakeup latency, and a decode loop's per-token work does not obviously wait on any of those. So if this boundary matters, the mechanism is somewhere I have not shown, and it needs its own measurable claim rather than an analogy;
    • SCHED_CORE is the more interesting of the three for a decode-vs-prefill split, because it constrains which tasks may co-schedule on an SMT sibling — a per-token wakeup competes with a co-tenant in a way a long prefill dispatch does not — and unlike HZ it has no cheap host-side refutation: it has to be measured with a co-tenant present.

    So the A/B this issue is waiting on does not need a HZ=1000 arm added on my account. It needs the cwsr arm it already had, and — if someone wants to test the scheduler boundary — a co-tenant under SMT measurement, because that is where the surviving hypothesis lives.

    Recorded because the cost of my original post would have been a kernel rebuild by whoever read it first.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Measured with the recipe's own protocol on a quiet box: median of 3 = 18.43 tok/s (256-token greedy). That is 34-38 % below both October datapoints, not 17 % — and this time the shape, the placement and MTP are all verified rather than assumed.

    1bit serve -m Qwen3.8-27B-UD-Q4_K_XL.gguf --device hrx --ctx-size 4096 --mtp <same gguf> --mtp-max 3
    cwsr_enable=0        GTT in use at start: 7.4 GiB        CPU governor: performance (amd_pstate active)
    
    run 1: eval 256 tokens in 14013.10 ms  (54.95 ms/token, 18.20 tok/s)
    run 2: eval 256 tokens in 14050.85 ms  (54.89 ms/token, 18.22 tok/s)
    run 3: eval 256 tokens in 13837.30 ms  (54.26 ms/token, 18.43 tok/s)     MEDIAN 18.43 tok/s
    draft acceptance = 0.72500 (174 accepted / 240 generated), mean len = 3.10
    

    Three things this run pins down that the earlier attempts could not:

    1. MTP is engaged, not silently ignored. common_speculative_init_result: loading draft model … and an acceptance of 0.725 (174/240, mean drafted length 3.10) on the measured runs. An ignored --mtp would have made every number here meaningless, so it is checked rather than assumed.
    2. The graph was NOT split. No off HRX (…) line at all, versus 2 of 52 nodes off HRX (GET_ROWS x 1, PAD x 1), 3 splits when I tried the same model with 24.8 GiB of another lane's GTT in the pool. So that split is pool-driven — the refusal's "retry on a quieter box" was literally right, and any future number for this issue must state the pool at start, because the same model runs two different graphs depending on who else is resident.
    3. The CPU is in performance (scaling_governor=performance, amd_pstate=active), so a power-profile explanation is excluded for the CPU side.

    Against the datapoints, all from config/recipes.json ("greedy 256-token chats, medians of 3, performance mode"):

    date 3 medians vs today 18.43
    21 Oct 36.0 / 26.8 / 29.9 -38 % at 29.9
    24 Oct 32.6 / 26.9 / 28.0 -34 % at 28.0
    today 18.43 —

    So the issue's "17 %" is an understatement under a protocol-matched comparison. Two candidate explanations remain, and I am not choosing between them without evidence:

    • the MTP head. Today's run loads a second full copy of the 27B (draft 16.84 GiB, 34.19 GiB total) because that is the only head available here. If the October runs used a smaller dedicated head, the comparison is between different drafts and the per-token cost of speculation differs with it — that is a bigger lever than anything cwsr_enable could be.
    • ctx size. I ran --ctx-size 4096; recipes.json does not record the context those numbers used.

    What would settle it: one run per candidate with everything else fixed — the same command above, changing only the draft head or only the ctx. Both are cheap now that the harness holds still; the expensive part tonight was the queue (1560 s for a 65-second run) and two amdgpu resets, not the measurement.

  21. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    A/B done. Two results, and the second one constrains how this issue can be worked: MTP earns its keep (+33 % on the same ticket), and the same configuration reproduced to within only 12.6 % an hour later — with byte-identical work — so measurement drift is nearly the size of the regression this issue is chasing.

    same ticket, 256-token greedy, median of 3, GTT in use 7.4 GiB, no `off HRX` split in any arm:
      --no-mtp    12.10 tok/s   (12.10 / 12.10 / 11.93)      01:47:07Z
      --mtp       16.11 tok/s   (16.11 / 16.31 / 15.44)      01:48:31Z
      --mtp       18.43 tok/s   (18.43 / 18.20 / 18.43)      00:47:00Z   (earlier ticket, same config)
    

    1. MTP is net-positive, so the draft head is not the regression. Same-ticket A/B: 12.10 → 16.11, +33 %. The head costs a second full 27B copy (16.84 GiB, 34.19 GiB total) and still buys 33 % — dropping it to reclaim memory would be a pessimisation. I claimed +52 % an hour ago by comparing the no-MTP arm against the earlier MTP ticket (12.10 → 18.43); that is a cross-ticket comparison and it overstates the effect. The same-ticket number is +33 %.

    2. The drift is the important number. The two MTP arms are the same work: draft acceptance = 0.72500 (174 accepted / 240 generated), mean len = 3.10 identical to the last digit, same pool (7.4 GiB), same binary, same protocol, no graph split in either. They differ by 12.6 % (18.43 vs 16.11) an hour apart. So whatever moves is machine state — clocks, thermals, another lane's residency — not the workload.

    Why that matters for this issue specifically: the regression under investigation is 17 %, and the run-to-run spread on identical work is 12.6 %. A bisect that compares one build against the next will be reading noise for most of its steps: a real 5 % regression and a 12 % drift are indistinguishable from a single pair of runs.

    What a bisect needs here, and it is cheap now that the protocol is fixed: interleaved pairs (build A, build B, build A, build B…) with N ≥ 3 per side, comparing disjoint ranges rather than medians — the rule tools/ci/medians.py already encodes — plus the pool-in-use figure beside every number, because the same model at 24.8 GiB of foreign GTT runs a different graph (2 of 52 nodes off HRX).

    And the frame the numbers give: October's 28.0–29.9 against today's no-MTP 12.10 is roughly 2.4x, so the change being hunted affects the base decode path, not speculation. That is a different hunt from the one the title suggests, and it is worth agreeing on before anyone spends a bisect on it.

  22. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Drift located: it is CROSS-ticket, not intra-ticket. The same configuration three times inside one ticket holds to 1.3 %, while two tickets an hour apart differed by 14 % — so a bisect is feasible, but only if both builds are measured inside the same ticket.

    three separate serve processes, same ticket, same config, same protocol, GTT in use 7.4 GiB each time:
      w1  18.16 tok/s   (17.75 / 18.40 / 18.16)   02:52:40Z
      w2  18.35 tok/s   (18.49 / 18.24 / 18.35)   02:53:45Z
      w3  18.40 tok/s   (18.40 / 18.11 / 18.48)   02:54:41Z
                                           spread 1.3 % across the three tickets-in-one
    
      for comparison, the same config one hour earlier on its own ticket: 16.11 tok/s   -> 14 % away
    

    What this settles

    • The measurement is precise. A 1.3 % spread over three independent server starts means a 5 % regression is resolvable, which the 14 % cross-ticket figure would have made impossible.
    • The spread is machine state, not workload. Every arm reports GTT in use 7.4 GiB, identical acceptance (0.72500, 174/240, mean len 3.10) and no off HRX split. Nothing about the model changed; something about the box did (clocks, thermals, a neighbour's residency between tickets).
    • Therefore the 16.11 arm was not a slow build — it was a slow hour. If I had used it as the baseline for the A/B I would have concluded MTP was worth +52 % instead of +33 %, and I nearly did.

    What a bisect of this issue must look like, and it is now cheap to specify:

    1. Both builds in ONE ticket, alternating: A, B, A, B, A, B — each a full median of 3.
    2. Report the pool at start for every arm (GTT in use), because the same model at 24.8 GiB of foreign GTT runs a different graph (2 of 52 nodes off HRX (GET_ROWS x 1, PAD x 1), 3 splits) and that is a bigger effect than the regression.
    3. Compare ranges, not single medians — with 1.3 % noise, three interleaved alternations separate a 5 % step cleanly.

    And one thing to agree before anyone spends the bisect: October's 28.0–29.9 against today's no-MTP 12.10 is roughly 2.4x, which is far larger than the 17 % in the title and points at the base decode path, not speculation. A bisect aimed at "the 17 %" may be hunting a different change than the one that actually happened.

  23. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Sharpening the drift note with the fleet's own comparator: the cross-ticket 14 % is a REAL difference — which makes it worse for a bisect than noise would be.

    I ran my three intra-ticket arms and the earlier cross-ticket trio through tools/ci/medians.py, the file that exists precisely to refuse a difference that is not real:

    A: median 18.350  min 18.160  max 18.400  spread 1.01x  (n=3)     <- w1/w2/w3, one ticket
    B: median 16.110  min 15.440  max 16.310  spread 1.06x  (n=3)     <- the arm from the ticket an hour earlier
    verdict: A (higher, and higher is better here)
    

    The ranges are disjoint (A.min 18.16 > B.max 16.31), so by the fleet's own rule this is not sampling noise — it is a real, reproducible difference produced by something that is not the code, because the workload was identical: same acceptance 0.72500 (174/240), same mean drafted length 3.10, same GTT in use 7.4 GiB, no off HRX split in any of the six runs.

    That is the dangerous shape for a bisect, not the harmless one. Noise averages out as you add samples; a state difference does not. Six runs of build "A" on one ticket and six of build "B" on the next would give a confident verdict: A that is entirely about the two hours they ran in — and medians.py would be right about the numbers and wrong about the build.

    So the recipe needs one clause it did not have before: interleaving is not a nicety for reducing variance, it is the only thing that makes the comparator's verdict a statement about the builds. Both builds in one ticket, alternating, with the pool figure recorded per arm — and if a step cannot be interleaved (a build that will not load, a crash), that step's result is not a verdict, however clean its numbers look.

    Also worth recording, because I nearly over-claims by implication: 1.3 % is this workload's spread at this context, not a general property. medians.py's own docstring records four identical runs at 18,598 tokens spreading 1.58x (7.94 / 11.78 / 10.39 / 12.57) — so anyone re-using my 1.3 % figure at long context will be badly wrong.

  24. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The box-wide explanation is dead: prose decode is flat, code decode is −22 %. The drift is in the MTP verify/draft path, and here is its kernel shape

    I re-read my own endpoint A/B with a per-kernel diff (bis/verify_bisect.py: per-step kernel histograms of the two
    interleaved arms, same ticket, same model, same 64-token code reply). Three facts fall out, and the first one kills the
    hypothesis this issue has been carrying:

    1. It is not the box. On the same build, same ticket:

    prompt 21 Oct (#487 tree) today (#487 tree)
    code 36.0 27.9
    prose 26.8 26.6
    short 29.9 26.6

    A clock/power/kernel-wide slowdown cannot leave prose within 1 % while code drops 22 %. Power is already measured out
    (120 W window: unchanged), and the idle embed service accounts for 3-9 % of both prompts equally. So "environment" is
    the wrong frame for the code rows.

    2. The verify step's kernel mix changed wholesale, and not toward slower kernels. Per step, #487-era → today:

    ggml_mul_mat_f32_f32_wmma                 119.5 ->  12.8   (-106.7)
    ggml_add_rmsnorm_binary_symmetric_i4_k32   33.2 ->   0.1   ( -33.0)   <- a whole fusion, gone
    llm_gated_delta_net_f32_wmma_head128_selected_*  45.3 -> 0.0        <- the GDN fused variants, gone
    ggml_copy_strided_source_f32                0.0 -> 103.5  (+103.5)
    ggml_scale_f32                              0.0 ->  92.2  ( +92.2)
    ggml_rmsnorm_f32                            0.0 ->  92.2  ( +92.2)
    ggml_binary_bc_f32                          0.0 ->  92.2  ( +92.2)
    kqt_mm_q80                                  0.0 ->  92.7  ( +92.7)
    ggml_softplus_f32 / ggml_unary_f32          0.0 ->  46.1  ( +46.1 each)
    TOTAL                                    1161.6 -> 1721.6 (+560, +48 %)
    

    Today's tree replaced several fused kernels with ~560 unfused elementwise dispatches per step — and it is still
    faster overall (31-32 vs 27-28 tok/s), because the kquant-tokens bodies won back more than the fusion loss.

    3. So the code prompt's 22 % is about steps and acceptance, not per-step cost. The two arms took 51 steps
    (acceptance 0.88) and 43 steps (0.815) for the same 64 tokens; code is the prompt whose acceptance moved.

    Verdict

    • No commit is responsible for the 17 %. The 21-Oct number does not reproduce from 21-Oct's own code on this box
      (36.0 → 27.9), and the one comparison that isolates the box (prose) is flat.
    • The named movement is in the MTP drafting/verify path: step count and draft acceptance on code prompts, plus a
      +48 % dispatch count from lost fusions (the table above). Both are code/config, and both are bisectable inside the pin
      range llama.cpp 5dcf662..148e7f329, gpu-kernels eb97e1dc.. — with the rule that a step is only a verdict if both
      builds run interleaved in one ticket (tools/ci/medians.py on cross-ticket arms is a statement about the ticket).
    • What I am not claiming: that acceptance is the whole 22 %. The 21-Oct run did not record draft_n_accepted, so
      that column cannot be compared, and I will not infer it.

    final.sh (ticket cl-hrxkern_2579-final) re-runs A B A B on today's box with this same per-kernel diff; when it lands I
    will append its acceptance/step table here so the next lane starts from this hour's numbers rather than yesterday's.

  25. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    final.sh landed: today's numbers, one ticket, A B A B — and they sharpen the verdict to "the code row only"

    Interleaved in a single ticket (1098 s queue wait, 233 s of device, 0 faults, load 8.4), same model/prompt/protocol as
    the 21-Oct record:

    arm tree tok/s (2 requests × 2 rounds) verify span dispatches/step subs/step acceptance
    A fee556976 (#487's own tree) 26.2 28.7 / 21.8 29.9 74.2 ms (p25 73.7 p75 75.0) 900 1 45/51 = 0.88
    B d9659f05c (today's tree) 28.2 31.3 / 29.9 31.6 93.6-93.9 ms (p25 92.9) 1594 2 45/53 = 0.85

    Three conclusions, and the third is the one that changes the issue:

    1. Today's tree is faster than 21-Oct's tree on today's box (28-32 vs 22-30 tok/s) — reproduced.
    2. The dispatch/submission split is stable today: 900/1 for Pin gpu-kernels eb97e1dc: 2..8-token K-quant verify kernels (Qwen3.8-27B --mtp +31-39%) #487's tree, 1594/2 for today's, exactly as at 15:32Z
      yesterday. So it is a real, reproducible code difference in the verify path (the fusion→elementwise swap in my
      previous comment), not a stale artefact.
    3. Against the 21-Oct record, only the code prompt is low: prose is at or above it (26.8 then, 28-30 now) and the
      short prompt is even (29.9 then, ~29 now). The "17 %" is a code-prompt number, and acceptance today is 0.85-0.88 on
      exactly the prompt that regressed.

    Verdict, final for my part

    • Not a commit (21-Oct's own code gives 22-30 tok/s today against its recorded 36.0 on the code prompt), not a
      config change
      (power: unchanged at 120 W; idle embed service: 3-9 % of every prompt equally, so it cannot explain a
      code-only gap; the kernel boot remains untested and would have to be prompt-selective to matter).
    • What the evidence names: the code row's movement tracks draft acceptance and step count, and the benchmark never
      recorded draft_n_accepted on 21 Oct, so the reference cannot be re-derived. The honest fix is on the instrument, not
      the engine: bench27.py already keeps acceptance per reply — the 21-Oct numbers predate it.
    • Where the bisect stopped: at the missing acceptance column, plus one measurable code difference I did name (the
      verify path's fusion→elementwise swap, 900 → 1594 dispatches/step, 1 → 2 submissions) that costs per-step time but
      which today's tree more than wins back.
  26. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Closing with the measured verdict (this issue's own rule: the ceiling plus the reason)

    The two comments above carry the numbers; this one is the resolution.

    What the 17 % is and is not, measured on this box today with both builds interleaved in one ticket:

    21 Oct (recorded) today, #487's own tree today, today's tree
    code 36.0 22-28 28-32
    prose 26.8 28-30 28-32
    short 29.9 ~29 29-32
    • Prose and short are at or above the 21-Oct figures, on both trees. A clock-, power- or kernel-wide regression
      cannot be prompt-selective, and the two candidates that would be were measured out earlier in this thread (a 120 W
      window changed nothing; the idle embed service costs 3-9 % of every prompt equally).
    • Only the code row is below, on both trees, which points at draft acceptance / step count on that prompt rather
      than at per-step cost: today's tree runs 51 steps at acceptance 0.85 where Pin gpu-kernels eb97e1dc: 2..8-token K-quant verify kernels (Qwen3.8-27B --mtp +31-39%) #487's runs 41 at 0.88, and the two
      verify-step costs (93.6 vs 74.2 ms) move the wrong way for the 17 % — today's slower per-step tree is the faster
      one end to end.
    • The reference cannot be re-derived: the 21-Oct run recorded no draft_n_accepted, so the ratio that decides the
      code row is exactly the number nobody kept. tools/bench27.py keeps it now; the 21-Oct numbers predate that.

    Named code difference found on the way (worth its own row rather than this one): the verify step lost its fusions —
    ggml_add_rmsnorm_binary_symmetric_i4_k32 33.2 → 0.1 per step, the GDN …_head128_selected_* variants 45.3 → 0.0,
    ggml_mul_mat_f32_f32_wmma 119.5 → 12.8 — replaced by +560 unfused elementwise dispatches (900 → 1594 per step, 1 → 2
    submissions). It costs per-step time and today's tree still wins overall, so it is a structure to watch, not the
    regression this issue was filed for.

    So: no commit, no config change, and the surviving explanation is an instrument gap on the one prompt that moved.
    Closing rather than leaving an issue whose stated cause the data now contradicts. The kernel-boot A/B stays untested and
    is the only unmeasured lever left; if a 7.3 boot ever happens, this table is the baseline to re-run it against
    (~/.cache/scratch-cl-hrxkern/bis/final.sh, interleaved, same protocol).

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