Repository navigation
ggml-hrx: opt validated Qwen models into shared row64 weights - #181
Draft
AaronStGeorge wants to merge 18 commits into
Draft
AaronStGeorge wants to merge 18 commits into
AaronStGeorge wants to merge 18 commits into
Conversation
Assisted-by: Codex
Assisted-by: Codex
Assisted-by: Codex
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Closes ROCm/ggml-staging-automation#160.
Prefer shared row64 Q4_K/Q6_K weights for validated Qwen models while retaining the existing operation matchers. The immutable context flag is enabled only for
LLM_ARCH_QWEN35; other architectures keep their normal selection policy. The tested opt-in files are Qwen3.8-27B, Qwen3.5-0.8B/2B/9B and MiniCPM-V-4.6's text backbone.The change shares eligible weight representations across consumers and retains the Qwen short-prefill kernels and row64 Q4 metadata reuse. The fixes pass the logical row through the shared F32 reader, reuses known Q4/Q6 tile coordinates in prefill, and keeps the Q6 compiler hint local to prefill so decode code generation is preserved.
This PR includes the architecture-level row64 preference and all five fixes as separate commits. The results below measure this PR head,
bd85479285423b239213519d0892c56d071864df.2cbd3dddc826b09be9f3cd316c5d36ffbf87ea2c36bc1bd8547928Final performance results
Baseline: frozen
hrx-graph-develop-v2atbe335351871563a09520b0db4a63c21db2040807. Candidate:bd85479285423b239213519d0892c56d071864df. Hardware: Radeon RX 7900 XTX / gfx1100, with the same frozen HRX runtime on both sides. The current target branch has advanced beyond the measured baseline; these measurements do not claim validation of a rebased or merged result.Standalone
llama-bench, standard warmup enabled, full GPU offload, flash attention, F16 K/V cache, eight CPU threads, mmap, batch/microbatch 512. Prefill lengths 66/128/256/512/1024 and 128-token decode at prefix depth zero. Each invocation has five repetitions, ordered baseline/candidate/candidate/baseline (ABBA). All 1,800 samples are retained; the first five model results were reused unchanged when completing the remaining ten.Numbers are percent throughput change, positive means faster. Each estimate is the geometric mean of the two adjacent candidate/baseline mean-throughput ratios.
ppdenotes prefill token count. These screening estimates do not establish statistical equivalence.Qwen27 and Qwen9 retain large 66/128-token gains. All decode estimates range from -0.57% to +0.73%. Remaining prefill losses include Qwen3-1.7B pp256/512 (-1.93%/-1.26%) and LFM2 pp66 (-2.30%). MiniCPM-V pp66 is unstable: its positive primary has mixed full pairs and negative later windows. Small differences are not assigned a causal explanation by this sweep.
Qwen3-0.6B stability check
Uneven early pp128 samples justified one separate 20-repetition ABBA check with the identical workload sequence. All 480 samples are retained, alongside the original screen.
The -5.32% pp128 loss did not reproduce at that magnitude (-0.54% in the longer check); the initial pp66 gain also did not reproduce. Neither run replaces the other, and no samples were discarded.
Validation and scope
Independent source review found no blocking implementation findings in the retained fixes. The final clean committed build and four representative original controls passed. Inspected Q4/Q6 decode assembly and machine code match the shared-reader control, while inspected Q4/Q6 prefill code matches the preceding tile-coordinate implementation.
Known limitations remain: exact-Q6 and paired-Q4 strict-reference failures are inherited with identical parent/candidate outputs; tolerances were not changed. The generic packed-Q8/F32 diagnostic defect and native-weight materialization limitations are not repaired by these changes. The current sweep measures standalone throughput; it does not revalidate cold serving failures, speculative MTP, image inputs, or WebAssembly. The MTP-labelled MoE model uses ordinary decode here.
Requirements