Repository navigation
ROCm (Strix Halo) support for Qwen3.8-27B, with fast GGUF prompts on by default - #144
ThinkOffApp wants to merge 34 commits into
Conversation
|
Thanks for the ROCm port. 0.6.0 goes out tonight and has moved a lot underneath it, so we'll do the rebase ourselves in 0.6.1, keeping your commits, together with @jkuepker's ROCm work (#100) and bf16 as the prompt default. Strix Halo support for the 27B, including exact GGUF projections, comes with that. |
|
Since 0.6.1 will carry #144 and #100 together, here are three things we found comparing them, for the merge:
Most of the rest is the same fix done twice under different names: the GDN lane masks and bf16 rounding, the guard around the PTX-only We're happy to run the merged tree on the R9700 the day it's up; @ThinkOffApp could cover gfx1151. |
|
Thanks @jkuepker, agreed on all three. On gfx12 (checked via gcnArchName), use WMMA and allow FP8 (prefill and --kv-dtype fp8). On every other GPU, default to qgemv and Triton attention, and refuse the FP8 flags with a clear error. Please keep top_by_value_then_id for the sampler, drafter and split. We'll run the merged 0.6.1 tree on gfx1151 (Strix Halo) the day it's up: tests, drafted == serial including seeded sampling, and GGUF speed. |
2900f59 to
954bb9f
Compare
1c11bd6 to
4e96ba5
Compare
…serves FP8 prompts The merged fast_prefill refused FP8 prompts on every ROCm GPU (ashhart#144 has no FP8 prompt kernel), which also refused gfx12's, measured at 2,360 tok/s against bf16's 1,599 on an R9700. Claude-Session: https://claude.ai/code/session_0177FjqB2W7svyUf7deveRJg
…serves FP8 prompts The merged fast_prefill refused FP8 prompts on every ROCm GPU (ashhart#144 has no FP8 prompt kernel), which also refused gfx12's: jkuepker measured his 2,360 tok/s prefill on an R9700 with it. Claude-Session: https://claude.ai/code/session_0177FjqB2W7svyUf7deveRJg
|
We stacked #100 on this PR's head (4e96ba5), following the rule agreed above: https://github.com/jkuepker/TensorFold/tree/rocm-144 (15 commits on top; this PR's commits are unchanged).
On the R9700 (gfx1201, torch 2.11 + ROCm 7.14) the branch passes the 27B and ROCm kernel tests in One thing for you: on this PR's own head, |
|
Thanks @jkuepker doing the run you suggested now. |
|
@jkuepker Thanks for stacking #100 on our head. Here are the gfx1151 results run on our Strix Halo and compared file by file on the same box. On gfx1151 the 27B path is unchanged. Every output of our frozen 192-output bit gate is bit-identical. Replies match our head 8/8, both serial and drafted, greedy and seeded, and drafted equals serial in both modes. Speed on the Qwen3.8-27B GGUF with default settings is within 2% on the same harness earlier today. An 8,651-token prompt reads at 197.2 tok/s serial and 192.4 drafted (193.0 and 191.3 before). Decode is 10.6 tok/s serial (10.5 before), and 25.8, 35.6, 17.9 and 27.9 tok/s drafted for short, code, story and long-document prompts (25.4, 35.2, 17.6 and 27.6 before). test_qwen27_server_errors, the test that aborts on your gfx1201 passes on gfx1151. The only differences are tests that #100 added for gfx12, which run on gfx1151 instead of skipping. Everything else fails the same way on both branches, so none of it comes from #100. The logs, receipts and scripts are on our Strix, and we're happy to share any of them. |
|
Thank you, @ThinkOffApp. We want this in. It lands as an experimental ROCm backend for Strix Halo, under your name, once it passes the same gates as our CUDA and Metal engines. We have no Strix Halo here, so the receipts have to come from yours:
One change: GGUF fast prompts stay off by default unless their output matches the native path bit for bit. If they match, post that run too and they can default on. Paste the commands, versions and outputs here, and we will port it with your commits first. |
|
Thank you, @ashhart. All three gates pass on our Strix Halo (gfx1151) for the Qwen3.8-27B GGUF and the MLX 4-bit, both with DFlash2, on 4e96ba5 plus one new commit that makes GGUF fast prompts opt-in. Each reply was compared by its token_sha and its full text. Drafted vs one-token decoding ("draft": false): 14/14 identical per model, greedy and seeded. A resumed three-turn conversation vs the same final turn on a freshly started server: 2/2. Eight requests at once on a fresh --parallel 8 server vs each run alone: 8/8, with nothing cached and the requests decoding together. GGUF fast prompts do not match the native path bit for bit (18 of 28 replies identical), so the new commit turns them off by default; TENSORFOLD_GGUF_FAST=1 turns them on. Versions: TensorFold 0.6.2 at 4e96ba5, torch 2.9.1+rocm7.13.0, Triton 3.5.1. Server: python -m tensorfold serve --backend cuda --drafter --context 16384 --no-thinking (plus --parallel 8 for the concurrency run). The client script and its output are below. |
|
Script and output referred to above. The run was on 4e96ba5 + 9ef7977 (now pushed to this PR). gates.py and the comparison output"""Ash's three #144 gates against a running TensorFold server: python gates.py PORT OUT.json MODE...
MODE g1: each prompt drafted and with "draft": false (one token a round), greedy and seeded.
MODE g2a: a 3-turn conversation on this server (turns 2 and 3 resume from the prompt cache).
MODE g2b: only the 3rd turn's full request (from G2A_JSON), sent to a freshly started server (nothing cached).
MODE g3: each prompt alone, then all of them at once.
MODE g3a / g3c: only the alone half / only the all-at-once half (run g3c on a fresh server so nothing is cached).
Every reply is recorded with the server's token_sha (hash of the reply's token ids) and its cached_tokens.
"""
import concurrent.futures as cf
import json
import sys
import urllib.request
port, out_path, modes = sys.argv[1], sys.argv[2], sys.argv[3:]
URL = f"http://127.0.0.1:{port}/v1/chat/completions"
def find(d, key):
if isinstance(d, dict):
if key in d:
return d[key]
for v in d.values():
r = find(v, key)
if r is not None:
return r
return None
def ask(messages, n=96, **kw):
body = {"model": "m", "messages": messages, "max_tokens": n, "temperature": 0}
body.update(kw)
r = urllib.request.Request(URL, json.dumps(body).encode(), {"Content-Type": "application/json"})
d = json.load(urllib.request.urlopen(r, timeout=3600))
return {"sha": find(d, "token_sha"), "cached": find(d, "cached_tokens"), "drafts": find(d, "drafts"),
"tokens": d["usage"]["completion_tokens"], "prompt_tokens": d["usage"]["prompt_tokens"],
"text": d["choices"][0]["message"]["content"]}
facts = ["Rivers carve valleys over millions of years as water erodes rock and carries sediment downstream. ",
"Early computers used vacuum tubes that failed often and filled entire rooms with heat and noise. "]
P = {"short": "In three sentences, explain why the sky is blue.",
"code": "Write a Python LRU cache class with get and put.",
"story": "Write a short story about a lighthouse keeper.",
"math": "Explain step by step how to compute 17 times 23.",
"list": "List ten tips for learning a new language.",
"long3k": "Summarize these notes:\n\n" + "".join(f"({i}) " + facts[0] for i in range(150)),
"long5k": "What patterns do you see?\n\n" + "".join(f"({i}) " + facts[1] for i in range(260))}
SEEDED = {"temperature": 0.8, "top_p": 0.95, "seed": 4242}
TURNS = ["I am planning a three-day trip to Helsinki in October. Suggest a rough plan.",
"Make day two more about design and architecture.",
"Now turn the whole plan into a short packing list."]
out = {}
for mode in modes:
if mode == "g1":
for k, p in P.items():
m = [{"role": "user", "content": p}]
for s, kw in (("greedy", {}), ("seeded", SEEDED)):
out[f"g1/{k}/{s}/drafted"] = ask(m, **kw)
out[f"g1/{k}/{s}/oneToken"] = ask(m, draft=False, **kw)
elif mode == "g2a":
for s, kw in (("greedy", {}), ("seeded", SEEDED)):
msgs = []
for i, t in enumerate(TURNS):
msgs.append({"role": "user", "content": t})
r = ask(msgs, n=160, **kw)
out[f"g2a/{s}/turn{i + 1}"] = r
msgs.append({"role": "assistant", "content": r["text"]})
out[f"g2a/{s}/messages"] = msgs
elif mode == "g2b":
prev = json.load(open(__import__("os").environ["G2A_JSON"]))
for s, kw in (("greedy", {}), ("seeded", SEEDED)):
out[f"g2b/{s}/turn3"] = ask(prev[f"g2a/{s}/messages"][:-1], n=160, **kw)
elif mode in ("g3", "g3a", "g3c"):
cases = [(k, s, kw) for k in ("short", "code", "story", "long3k") for s, kw in (("greedy", {}), ("seeded", SEEDED))]
for k, s, kw in cases if mode != "g3c" else []:
out[f"g3/{k}/{s}/alone"] = ask([{"role": "user", "content": P[k]}], **kw)
if mode != "g3a":
with cf.ThreadPoolExecutor(len(cases)) as ex:
futs = {(k, s): ex.submit(ask, [{"role": "user", "content": P[k]}], **kw) for k, s, kw in cases}
for (k, s), f in futs.items():
out[f"g3/{k}/{s}/concurrent"] = f.result()
json.dump(out, open(out_path, "w"), indent=1)
print(out_path, "done", len(out)) |
Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 084785a1500ff5248f1cbcbdfa2e274a6cebc752)
Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 4ac9bf4505941dfd9ee609d6a24aa72b990b5c21)
…N kernels Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit daa29356b4e769d390d93ad5344e94e97c0063ee)
Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit dda994c7d9ea3b7171ed8c08166bca014a4fe7b1)
… rows Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 73fb90acc9163f0a743e8e1c3cc9969eb1f9b547)
…l a run Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 20a000fad0083e7fecffe8db9e116be10ae0e6ae)
…n-negative halves) On AMD matrix cores a masked key's +0 weight times a negative v gives -0, and those zero products did not sum alike, so a row's bits depended on whether its chunk loaded the keys past it (test_prefill_attention_rows_do_not_ depend_on_chunking[24-4-256], chunk size 1). Found by @codexmb's review. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 8ebd8a46bee9b1783883c9f955b0a301f582ac30)
Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 29203e90942327124ca81b4c337a9b8b823e51b8)
…sert the ROCm layout and skip sm_90-only kernels Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 92433e949750d73167011721893318bc0148d65c)
…ed, MIT) and a Qwen3.5 GGUF loader Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit a4f52128c440c0f1637034cee5821760048211c7)
…dding rows, fp64 CPU reference check Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit d49a3f931130f309e98b132569944fd39c67b151)
…; check every row count and fail on gaps Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 55d97de834f98ae601786b1974ea3b51c46bb17e)
…st, mismatch bisection The 39264ef guard sweep on Strix had zero faults but 335 MISMATCH lines. The weight upload, slack fill and y readback went through hipMemcpy/hipMemset on HIP's null stream, outside torch's ordering. Every fill, copy and compare of guarded memory is now a torch op on a __cuda_array_interface__ view of the mapping, with a sync after each step. The guarded weight must equal the original byte for byte before any kernel runs (WEIGHT-COPY-BAD, exit 3). Each case also runs the ctypes call on ordinary torch buffers (CTYPES-MISMATCH separates harness from placement). y is prefilled with a NaN marker to count unwritten outputs. On a guarded mismatch the case reruns with one guarded buffer at a time (q8 / y / w) and prints which one changes the output, the differing count, the first (tok, col) and max |diff|. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ails closed, run log + identity From Codex's review of 99cbbeb (guard run 2 PASS on gfx1151): - The child prints CASE-START right before the guarded launch and CASE-DONE after its sync. A child death counts as FAULT only after CASE-START with no CASE-DONE and a GPU memory-fault signature ("Memory access fault by GPU" with return code -6 or 134, or hipErrorIllegalAddress / "illegal memory access"). Any other death (build, VMM setup, assert) is INCONCLUSIVE. A negative control that is not a clean FAULT stops the run as INCONCLUSIVE. - The 6-tile positive control's result now feeds the verdict. Before this it was printed and then dropped. - Every child's command, return code, stdout and stderr goes to a per-run log (logs/bounds/guard-<time>.log, --log). The header records the tree rev, dirty flag, torch/HIP versions, device and gcnArchName, the libtfgguf path, the Gufo revision and kSlackTiles. - The final line is PASS / FAIL / INCONCLUSIVE, exiting 0 / 1 / 2. Classification checked on CPU with stubbed children: fault, illegal-address, build failure, a death after CASE-DONE, the fault text with exit 1, clean, mismatch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the span rows A GGUF that keeps output.weight (or a tied token_embd) in F16/BF16/F32 loads it as Plain; the drafter's head setup special-cased NVFP4, Gguf and Exl3 and otherwise read head.scales/head.biases, which Plain lacks. The sub-head now takes the span rows (b16 computes each output column alone, so each logit keeps the target's bits). One GPU only, as for the other non-MLX heads. Review: codexmb. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p sources On a ROCm box the JIT build writes hipified copies inside the source tree, with a cuda folder of the path renamed hip (cuda/kernels/gdn.cu -> hip/kernels/gdn.cpp, qwen3_5/cuda/b16.cu -> qwen3_5/hip/b16.hip). The test read them as unshipped sources and failed on the Strix tree only. A file is skipped only when its cuda-path twin exists, so the vendored Gufo hip/ tree still counts (and removing its package-data line still fails the test: 20 missing). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s build GGUF detection and loading are a format extension with no HIP gate of their own; on NVIDIA a GGUF directory would reach the Gufo build and fail in hipcc terms. Engine admission now says GGUF runs on AMD (ROCm) and names the NVIDIA checkpoints. Test: refusal on HIP=False, no refusal on HIP=True; it fails with the check removed. Review: codexmb. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o turn them off Prompt reading on Strix (27B UD-Q4_K_XL, 8,651-token prompt) goes from 78 to 193 tok/s; answering speed is the same and drafted replies still match serial ones (16/16). Prompt rows no longer share decode's bits, so wording can differ from the exact route, as prompt and answer kernels already differ on NVIDIA. NVIDIA is untouched (HIP gate). gguf_fast_prefill_check now checks the switch both ways: unset gives the fast bits, 0 the exact ones. Test: tests/test_gguf_fast_default.py. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ROCm) It came in with ashhart#134 after this PR's ROCm skips; it calls qmm.matmul, which raises on HIP by design. On the Strix it was the only failing GPU-side test file (2 failed), on 0.6.0 and on 0.6.1 alike. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Gufo's WMMA W8A8 prompt GEMM and decode GEMV give different bits from the exact kernel, so by default every row count now stays on the exact kernel and prompts match the native path bit for bit. TENSORFOLD_GGUF_FAST=1 turns the fast routes back on (ROCm only). Co-Authored-By: Claude Opus 5.5 <[email protected]>
9ef7977 to
f94c36f
Compare
…ge programs 527a6a8's grouped fold keeps serial bits only if every program rounds the shared fp32 fold the same way. On gfx1151 the compiler contracted it into FMAs differently per kernel, so test_rows_crossing_a_group_edge_match_serial_bits (4 cases) and test_folded_groups_and_scalar_merge_are_bit_equal failed. With enable_fp_fusion=False on HIP, tests/cuda/test_attention.py passes 50/50. NVIDIA launches are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Rebased onto 0.6.5 (609ca41); the head is now 5203508, and the three gates were re-run on exactly that tree on our Strix Halo (gfx1151), GGUF and MLX 27B, same method as the earlier run. Drafted vs one-token decoding: 14/14 per model. Resumed conversation vs a fresh server: 2/2. Eight concurrent requests on a fresh One fix came with the rebase: 0.6.5's grouped tree-attention fold (527a6a8) lost serial bits on gfx1151 for rows crossing a group edge (5 tests in On GGUF fast prompts: we have not re-measured the fast-vs-exact comparison on this base, so the 18 of 28 result from 4e96ba5 is the last real number we have and the commit still leaves them off by default. We will post the re-run on 5203508 rather than carry that figure forward as if it were fresh. Versions for this run: TensorFold 0.6.5 at 5203508. The server invocation and the client script are unchanged from the earlier comments, so gates.py there is what produced these. |
|
Thanks for #144. I tried its current head ( On that card, the first decode request never finishes. The GPU stays at 100 % busy but under 90 W, as if a kernel were spinning, and no reply arrives. It happened with the default flags (I stopped it after 10 minutes) and with
An earlier version of your commits, which I carry in a fork on top of 0.6.2, does not hang on the same card. So it may come from a later commit, or from how that commit meets gfx1201, not from Strix Halo. I can bisect it on the R9700 if that's useful. I wrote up the gfx1201 side in #412. |
|
Thanks for running it and for the careful report. #144 was developed and gated on gfx1151 (Strix Halo) only; we have no gfx12 card, so we cannot reproduce this here, and we have not seen the hang on gfx1151. It may be related to what @jkuepker reported above on 2 Oct: on this PR's own head, gfx1201 aborts inside tree_forward via draft_decode, and the rule we agreed there is that gfx12 takes #100's WMMA kernels while this PR's path covers the other AMD GPUs. His rocm-144 branch does that and passes on the R9700. Two things that would narrow it quickly, if you have a moment:
A bisect on the R9700 would be very welcome, yes. We will take any fix that keeps gfx1151 bit-identical, and we can run the gfx1151 side of anything you find. |
|
Thanks, that explains it. I ran your two checks on the R9700 with the current head (
So on gfx1201 it is not the drafter. The target forward in this PR's own path gives non finite logits, and with drafts that probably keeps the verify loop spinning. About the base: my fork has this PR up to |
|
Thanks, that settles it, and it was not noise: it shows a real gap in this PR. On gfx12 without #100, this path produces non-finite logits and the server spins instead of failing. We will add a check so that on gfx12 this path stops at startup with a message pointing to #100's WMMA kernels, and gfx1151 stays bit-identical. We will post here when it is pushed. |
On gfx1201 (RDNA4) this path's forward gives non-finite logits; with drafts the verify loop then never returns (reported on ashhart#144 with an R9700). gfx12 runs on ashhart#100's WMMA kernels, so this path now stops at startup there with a message that says so. Nothing changes on gfx1151. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed in 88417d3: on gfx12 this path now stops at startup with a message pointing to #100's WMMA kernels, instead of hanging. It refuses every format on gfx12, MLX and GGUF alike. #144 on its own is only tested on gfx1151, and the tree path that aborted on gfx1201 is shared by all formats. We have no GGUF result on gfx12 either way. Nothing changes on gfx1151: the head before and after this commit both match our 28-case answer key (token hash, text and token count), with identical tokens in all 28. Thanks again for running the checks. |
|
Thank you, @ThinkOffApp. This is a long, careful port, honest down to the 6 of 16 replies where the fast GGUF route differs from the exact one. The Python engine is frozen (#286) and new work goes into the Zig engine, so this won't land as written. On the Zig engine it waits for a ROCm backend, the Qwen3.8-27B family and a GGUF reader. Your Zig HIP plan in #426 is where that backend starts. When ROCm comes, your HIP fixes carry over with your credit: 64-bit lane masks, HIP's bf16 rounding, and no FMA contraction in tree attention. Two rules come with it. We write our kernels in our own code rather than vendor Gufo's, and a speed feature can't change the reply, so the Q8_1 prompt route stays out. On gemv versus gemm16, we take the row-exact direction, where a window's rows reproduce the one-row bits. |
|
Thanks Ash, that makes sense, and thank you for keeping the HIP fixes with credit. We will continue the ROCm work on the Zig engine under #426. The kernels will be our own code, with nothing from Gufo, and the Q8_1 prompt route stays out, since a speed feature must not change the reply. On gemv versus gemm16 we take the row-exact direction, so a window's rows reproduce the one-row bits. #144 stays as the reference for gfx1151: the 28-case answer key and the 6-of-16 difference on the fast GGUF route. In #426, matching that answer key bit for bit is the acceptance gate for the ROCm backend. |
…serves FP8 prompts The merged fast_prefill refused FP8 prompts on every ROCm GPU (ashhart#144 has no FP8 prompt kernel), which also refused gfx12's: jkuepker measured his 2,360 tok/s prefill on an R9700 with it.
|
Tested the PR's GGUF Q8_0 and K-quant prefill on a Radeon 8060S (gfx1151, ROCm 10 / torch 2.11.0+rocm10.0.0). Two findings:
Local workaround that makes it run (not a proposed fix, just what I tested): return Results with that change, on real tensors from
Not covered: Q5_K and Q3_K tensors. The PR's |
|
Correction to my earlier comment: the workaround there (returning Patch (applies to 88417d3): Tested on Radeon 8060S (gfx1151, ROCm 10, torch 2.11.0+rocm10.0.0), against CPU dequant references, using real tensors from
Not tested: Q3_K tensors (3 in the Q4_K_XL file), and any wave64-WMMA GPU (none here). The guard's effect on those targets is unverified. |
|
Thanks @yijunyu, for the report and for narrowing the guard. Skipping the wave64 route only when gcnArchName says gfx1151 is the right shape: GPUs that have wave64 WMMA keep it, and the trap under This PR was closed on 6 Oct when the AMD work moved to the native Zig engine (#463, in 1.0.5; the model slices are planned in #490/#491), so it won't merge here. The branch still exists (ThinkOffApp:strix-rocm-gguf at 88417d3, the commit your patch applies to) but not aware if anyone would be continuing development on the old platform. |
ROCm (Strix Halo, gfx1151) for the Qwen3.8-27B CUDA path, GGUF on Gufo's kernels: rebased on 0.6.2
This PR is rebased onto upstream 0.6.2 (
56e2e3e), with 31 commits; current head4e96ba5. The two conflicts ingdn.cuanddflash2.pywere resolved, preserving the ROCm portability changes and GGUF support. The new GDN kernel passes 44/44 tests on the Strix in the exported run. The earlier 0.6.1-based head1c11bd6is preserved asstrix-rocm-gguf-v061-backup; the 0.5.0 version is preserved asstrix-rocm-gguf-v050-backup.What is new since the 0.5.0 version of this PR
TENSORFOLD_GGUF_FAST=0turns them off).TENSORFOLD_GGUF_FAST_VERIFY, defaultexact). We tried WMMA and bf16for verify: they changed drafted replies and were not faster.
TENSORFOLD_GGUF_FAST=0selects the exact route.tests/test_gguf_fast_default.pycovers the default and override;scripts/gguf_fast_prefill_check.pychecks both directions on real weights and restores the environment in afinallyblock.tests/test_gguf_q8_bounds.py, which reads the kernel constants from source.scripts/gguf_bounds_check.pyputs buffers against unmapped pages (HIP VMM). The negative controls fault: exactsize, and 5 tiles. The 700-case 8-tile sweep is clean on gfx1151.
tensorfold.cuda.ggufsources plus the vendored Gufo tree (the wheel used to hold only__init__.py).gguf_detect.gguf_file: engine admission no longer importsgguf_load. That import broke 12test_cuda_capacitystand-in tests; it already did so in this PR on 0.5.0.b16.cubuilds on hipcc. The PTX prompt kernel is built off-ROCm only, ROCm prompt rows use the row kernel, andgdn.cu's portability macros are applied.
test_qmm::test_every_nibble_decodes_exactlynow has the same PTX-only skip as the other tests that call the CUDA-only extension.Deliberately not gated to ROCm
qmm_fastMLX-layout row helpers. The standard tiled CUDA route does not reach them.top_by_value_then_idtie-break, the one deliberate CUDA-visible behaviour change, as discussed with@jkuepker.
Measured (single runs; receipts available)
Strix Halo (gfx1151), Qwen3.8-27B. Answering speed is tok/s for short / code / story / long doc. GGUF rows below use the 2 Oct 0.6.2 rerun on head
4e96ba5; the MLX row is the earlier 0.6.1 run. These are single runs. The long-document answering measurement follows a warm-up and benefits from prompt caching; prompt reading is measured separately on the 8,651-token prompt.TENSORFOLD_GGUF_FAST=0)rows. Bit-identical at pad 0 and pad 96.
4e96ba5):test_build,test_logprobs, disclosed below). Switch check reports 14/14 weights wired both ways;test_gdnpasses 44/44.fast-default-rerun/v062/SHAS.txt,summary.txt, per-file logs, fourv062-*.jsonreply files, conflict/range diffs andwindow-receipt.txt. Raw reply comparisons were independently checked by codexmb.TENSORFOLD_GGUF_FAST=0each produce identical drafted/serial replies in 16/16 cases (8 greedy, 8 seeded).3197181(the initial fast-default change on954bb9f), not final head1c11bd6. The final head changes only check-script environment cleanup and the PTX-only test mark. The GPU switch check and end-to-end runs were not repeated after those two changes.test_qwen27_server_errors), and three failed (test_qmm,test_build,test_logprobs). The final-head follow-up reportstest_qmm: 6 passed, 15 skipped, 0 failed; GGUF/packaging/capacity tests: 62 passed.test_buildandtest_logprobsremain outside this port's supported scope.fast-default-rerun/README.txt,fd-run.sh,summary.txt, per-file pytest/serve logs, and all fourfd-*.jsonreply files. Raw reply comparisons were independently checked by codexmb.Known open issue (not fixed here)
The MLX checkpoint on AMD: drafted replies can differ from serial.
TF_ROCM_DECODE_KERNEL=gemm16restores equality (8/8 + 8/8), but halves serial decode (9.0 -> 4.5 tok/s).Not covered
qwen4_exp) on ROCm:test_buildreaches the unported Flash Nextgdn_io.cubuild.test_logprobs: a bare-PyTorch reproduction on torch 2.9.1+rocm7.13 (gfx1151), seed 1234, shows integertopk(k=20)returningindex == row width(out of range) at 13 checked int64 widths between 21 and 47 (45 matched). The test's vocabulary width 31 is affected, and its following gather faults. Widths 1025 and 131073 matched CPU in this check; this does not establish general large-vocabulary safety. Our static import search foundtensorfold.cuda.logprobs.captureimported only byqwen4_expdecode/multi; that is not a proven call graph. Not fixed here. Receipts:rocm-topk-repro.py,rocm-topk-repro.out,test_logprobs-isolated.out. These failures are disclosed, not counted as passing tests.tools/gguf_validate.py: its check covers parsing and required keys only. That script also needs a nonzero exit for failed boolean checks; its exit code alone is not a validation gate.Packaging note
On ROCm, torch's JIT build writes hipified copies inside the package tree. A read-only install would fail on first
use; this is torch behaviour, not this PR.
Tested and written by petrus's agents (claudemb; reviewed by codexmb).