Skip to content

ggml-hrx: work around private RoPE helper merge ordering - #120

Closed
AaronStGeorge wants to merge 1 commit into
AMD-Ecosystem:hrx-graph-develop-v2from
AaronStGeorge:fix/hrx-rope-dependency-order
Closed

AaronStGeorge wants to merge 1 commit into
AMD-Ecosystem:hrx-graph-develop-v2from
AaronStGeorge:fix/hrx-rope-dependency-order

Conversation

@AaronStGeorge

@AaronStGeorge AaronStGeorge commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Llama 3.2 3B decode fails to produce perplexity because Loom cannot resolve @ggml_rope_f32_pair_packet (HRX issue #1089). This PR temporarily works around the linker ordering bug; kernel arithmetic is unchanged. Move rope_f32.loom after llm_attention_qkv_matmul_postops.loom in the vector Q/K recipes, keeping library_sources and compile_dependencies aligned.

CI evidence

Both completed runs cover all 25 smoke models, prefill and decode, on HRX/Vulkan gfx1151. The baseline already includes #119's IQ4 fix, so this pair isolates the ordering workaround.

Run llama.cpp commit Prefill passing Decode passing
Before 682337098905cf69ea4b8ec00bc50a9993bd6ff8 25/25 22/25
After 12aa79f6b822998f2dc48cba97218e916e9f7869 25/25 25/25

The three missing decode measurements (Llama 3.2 1B, Llama 3.2 3B and SmolLM3 3B) all report the unresolved helper before and pass afterward. All previously available HRX PPL values are unchanged. Both workflows are red because expected failures now XPASS; the after run passes all 50 numerical comparisons.

Selected model: Llama-3.2-3B-Instruct-UD-Q4_K_XL.gguf.

Regime Baseline HRX / reference PPL Candidate HRX / reference PPL Numerical verdict Before / after CI links
decode-like unavailable / 7.2515 7.2492 / 7.2515 invalid-measurement -> pass before / after
prefill-like 10.5279 / 10.5638 10.5279 / 10.5638 pass -> pass before / after
Complete before/after comparison: all 25 smoke models, both regimes
Model Regime Baseline HRX / reference PPL Candidate HRX / reference PPL Numerical verdict Change Failure causes
extra.Bonsai-1.7B-gguf decode-like 20.2263 / 20.2263 20.2263 / 20.2263 pass -> pass unchanged pass none
extra.Bonsai-1.7B-gguf prefill-like 21.3080 / 21.3049 21.3080 / 21.3049 pass -> pass unchanged pass none
extra.Bonsai-4B-gguf decode-like 14.5323 / 14.5328 14.5323 / 14.5328 pass -> pass unchanged pass none
extra.Bonsai-4B-gguf prefill-like 14.3731 / 14.3636 14.3731 / 14.3636 pass -> pass unchanged pass none
extra.Bonsai-8B-gguf decode-like 13.1626 / 13.1621 13.1626 / 13.1621 pass -> pass unchanged pass none
extra.Bonsai-8B-gguf prefill-like 12.5425 / 12.5495 12.5425 / 12.5495 pass -> pass unchanged pass none
extra.Jan-nano-128k-gguf decode-like 10.4439 / 10.4295 10.4439 / 10.4295 pass -> pass unchanged pass none
extra.Jan-nano-128k-gguf prefill-like 9.7897 / 9.9176 9.7897 / 9.9176 pass -> pass unchanged pass none
extra.Jan-v1-4B-GGUF decode-like 10.8061 / 10.8138 10.8061 / 10.8138 pass -> pass unchanged pass none
extra.Jan-v1-4B-GGUF prefill-like 9.6797 / 9.7696 9.6797 / 9.7696 pass -> pass unchanged pass none
extra.LFM2-1.2B-GGUF decode-like 14.4871 / 14.5189 14.4871 / 14.5189 pass -> pass unchanged pass none
extra.LFM2-1.2B-GGUF prefill-like 13.8624 / 13.8816 13.8624 / 13.8816 pass -> pass unchanged pass none
extra.LFM2.5-1.2B-Instruct-GGUF decode-like 21.0922 / 20.9775 21.0922 / 20.9775 pass -> pass unchanged pass none
extra.LFM2.5-1.2B-Instruct-GGUF prefill-like 18.1015 / 18.1351 18.1015 / 18.1351 pass -> pass unchanged pass none
extra.Llama-3.2-1B-Instruct-GGUF decode-like unavailable / 10.0121 10.0045 / 10.0121 invalid-measurement -> pass improved before hrx: invalid-measurement: llama-perplexity did not print a valid finite positive PPL estimate
extra.Llama-3.2-1B-Instruct-GGUF prefill-like 14.4433 / 14.4604 14.4433 / 14.4604 pass -> pass unchanged pass none
extra.Llama-3.2-3B-Instruct-GGUF decode-like unavailable / 7.2515 7.2492 / 7.2515 invalid-measurement -> pass improved before hrx: invalid-measurement: llama-perplexity did not print a valid finite positive PPL estimate
extra.Llama-3.2-3B-Instruct-GGUF prefill-like 10.5279 / 10.5638 10.5279 / 10.5638 pass -> pass unchanged pass none
extra.Meta-Llama-3.1-8B-Instruct-GGUF decode-like 5.4161 / 5.4211 5.4161 / 5.4211 pass -> pass unchanged pass none
extra.Meta-Llama-3.1-8B-Instruct-GGUF prefill-like 7.0713 / 7.0906 7.0713 / 7.0906 pass -> pass unchanged pass none
extra.MiniCPM-V-4.6-Thinking-gguf decode-like 16.0936 / 16.1030 16.0936 / 16.1030 pass -> pass unchanged pass none
extra.MiniCPM-V-4.6-Thinking-gguf prefill-like 14.2873 / 14.3064 14.2873 / 14.3064 pass -> pass unchanged pass none
extra.MiniCPM-V-4.6-gguf decode-like 16.2314 / 16.2231 16.2314 / 16.2231 pass -> pass unchanged pass none
extra.MiniCPM-V-4.6-gguf prefill-like 14.3866 / 14.4046 14.3866 / 14.4046 pass -> pass unchanged pass none
extra.MiniCPM3-4B-GGUF decode-like 21.9671 / 21.9597 21.9671 / 21.9596 pass -> pass unchanged pass none
extra.MiniCPM3-4B-GGUF prefill-like 14.6335 / 14.6525 14.6335 / 14.6581 pass -> pass unchanged pass none
extra.MiniCPM5-1B-GGUF decode-like 23.8496 / 23.7958 23.8496 / 23.7958 pass -> pass unchanged pass none
extra.MiniCPM5-1B-GGUF prefill-like 26.3941 / 26.4078 26.3941 / 26.4095 pass -> pass unchanged pass none
extra.Ministral-3-3B-Instruct-2512-GGUF decode-like 8.1995 / 8.1871 8.1995 / 8.1871 pass -> pass unchanged pass none
extra.Ministral-3-3B-Instruct-2512-GGUF prefill-like 7.8130 / 7.8116 7.8130 / 7.8116 pass -> pass unchanged pass none
extra.Phi-4-mini-instruct-GGUF decode-like 7.5603 / 7.5497 7.5603 / 7.5497 pass -> pass unchanged pass none
extra.Phi-4-mini-instruct-GGUF prefill-like 9.6331 / 9.7933 9.6331 / 9.7933 pass -> pass unchanged pass none
extra.PromptBridge-0.6b-Alpha-GGUF decode-like 24.1013 / 24.0622 24.1013 / 24.0622 pass -> pass unchanged pass none
extra.PromptBridge-0.6b-Alpha-GGUF prefill-like 23.8217 / 23.8592 23.8217 / 23.8592 pass -> pass unchanged pass none
extra.Qwen3-0.6B-GGUF decode-like 19.2814 / 19.2797 19.2814 / 19.2797 pass -> pass unchanged pass none
extra.Qwen3-0.6B-GGUF prefill-like 20.5002 / 20.4865 20.5002 / 20.4865 pass -> pass unchanged pass none
extra.Qwen3-1.7B-GGUF decode-like 17.4745 / 17.5090 17.4745 / 17.5090 pass -> pass unchanged pass none
extra.Qwen3-1.7B-GGUF prefill-like 15.9749 / 15.9850 15.9749 / 15.9850 pass -> pass unchanged pass none
extra.Qwen3-4B-GGUF decode-like 14.0307 / 14.0311 14.0307 / 14.0311 pass -> pass unchanged pass none
extra.Qwen3-4B-GGUF prefill-like 12.2655 / 12.2982 12.2655 / 12.2982 pass -> pass unchanged pass none
extra.Qwen3-4B-Instruct-2507-GGUF decode-like 10.4159 / 10.4413 10.4159 / 10.4413 pass -> pass unchanged pass none
extra.Qwen3-4B-Instruct-2507-GGUF prefill-like 9.0959 / 9.1689 9.0959 / 9.1689 pass -> pass unchanged pass none
extra.Qwen3.5-0.8B-GGUF decode-like 16.5618 / 16.5637 16.5618 / 16.5637 pass -> pass unchanged pass none
extra.Qwen3.5-0.8B-GGUF prefill-like 15.7516 / 15.7933 15.7516 / 15.7933 pass -> pass unchanged pass none
extra.Qwen3.5-2B-GGUF decode-like 12.1638 / 12.1727 12.1638 / 12.1727 pass -> pass unchanged pass none
extra.Qwen3.5-2B-GGUF prefill-like 10.8440 / 10.8548 10.8440 / 10.8548 pass -> pass unchanged pass none
extra.SmolLM3-3B-128K-GGUF decode-like unavailable / 7.4642 7.4737 / 7.4642 invalid-measurement -> pass improved before hrx: invalid-measurement: llama-perplexity did not print a valid finite positive PPL estimate
extra.SmolLM3-3B-128K-GGUF prefill-like 8.9937 / 9.0182 8.9937 / 9.0182 pass -> pass unchanged pass none
extra.gemma-3-270m-it-GGUF decode-like 53.9771 / 53.9679 53.9771 / 53.9679 pass -> pass unchanged pass none
extra.gemma-3-270m-it-GGUF prefill-like 60.2556 / 60.2415 60.2556 / 60.2579 pass -> pass unchanged pass none

Smoke comparison: before / after.

Both automation trees differ only in the llama.cpp gitlink and use HRX c9ffcd25e74ff3580cb128a485c74f0c3d48fec4 with the same unfiltered model manifest. The baseline source tree is identical to integration merge 4e14145b37c11f5e9394e02868e81d6edae7cce3. Build checkouts and raw PPL logs were verified.

Settings: model_tier=smoke, skip_benchmarks=["lemonade-benchmark"]; WikiText-2, context/batch 512; prefill microbatch 512 with 32 chunks; decode microbatch 1 with two chunks; unchanged HRX/Vulkan PPL ratio limit 1.10. Different gfx1151 runners were used. Both exact Q/K recipes also reproduce the before/after link result locally on gfx1100.

Stability: ten additional Llama 1B/8B runs passed all 40 comparisons across nine runners with identical PPL. The earlier high-PPL/NaN results were likely runner/environment related; the original runner was not retested.

Requirements

  • Contributing guidelines reviewed for this change; the contributor requested this submission after reviewing the diagnosis and ordering workaround.
  • AI usage disclosure: YES. Codex assisted with diagnosis, the manifest edit, validation, and this PR.

Work around the private-helper merge order issue tracked in ROCm/hrx-system#1089.

Assisted-by: Codex
@AaronStGeorge
AaronStGeorge marked this pull request as ready for review September 28, 2026 23:59
@AaronStGeorge

Copy link
Copy Markdown
Collaborator Author

Merged as part of #121

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant