Correct native HRX explicit RoPE frequency factors
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 423
- Forks
- 53
- Avg merge
- 20h 26m
- Merged PRs (30d)
- 310
Description
Row: BACKEND-ROCM
Native HRX's Qwen postprocess matcher treats ggml_rope_ext's explicit freq_factors tensor as an inverse-frequency table. The CPU reference divides the base theta by each factor, while the HRX kernel multiplies the position by each supplied value.
Application pin: AMD-Ecosystem/llama.cpp 6319038132ed12f968ea68f37753f705da830ea8. Runtime pin: ROCm/hrx-system 6bcd5a4ff111fa5bf160ab9f4592ca8e7cc810b1, with the separately retained #3081 Loom compilation repair. The #3083 scheduling repair makes the BF16 Qwen postprocess region reachable.
Source proof: ggml/src/ggml-cpu/ops.cpp:5852 computes theta/ff. ggml/src/ggml-hrx/dispatch_registration/qwen/dispatch-qwen-attention-postprocess.cpp:410 binds the explicit tensor directly. ggml/src/ggml-hrx/kernel-corpus/kernels/qwen_moe/qwen3_moe/attention_postprocess_f32_f16.loom:44 computes position * inverse_frequencies. The upstream test fixture creates inverse frequencies and supplies them as ggml factors at tests/test-hrx-ops.cpp:737 and :2790. Production Qwen3 uses nullptr at src/models/qwen3.cpp:91 and :99, so it takes the separate implicit mode.
The extended upstream numerical fixture uses BF16 weights, 16 tokens, input1024, Q16, KV8, cache4096, and the unchanged upstream threshold 2 + 0.05 * abs(CPU). GPU relay aborts at output index2865: HRX0.61159, CPU-1.4684, difference2.07999, allowed2.07342. This index uses token1, head6, channel49. The same supplied float0.0008659643353894353 gives CPU angle1.0000017 and HRX angle0.000865964. The original quantized two-token fixture passes its unchanged tolerance.
Evidence: /home/vikash/vllm.cpp-hrx-evaluation/build-hrx-evaluation/native-prefill-repaired-numerics retains command, complete artifact hashes, exit-6, and stderr. The source calculation is retained in /home/vikash/vllm.cpp-hrx-prefill-repair-3083/build-hrx-prefill-repair/evidence/explicit-rope-diagnosis.json.
Owner: BACKEND-ROCM's #3080 evaluation operator. The #3083 scheduling spec lists this under Owed. The scoped scheduling repair does not change kernel arithmetic or tolerances. Resolve the explicit mode under a committed scope, keep its reproducer, and independently review any semantic repair. This issue does not explain the separate corrupted model output in the implicit mode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ggml/src/ggml-cpu/ops.cpp:5852, dispatch-qwen-attention-postprocess.cpp:410, and attention_postprocess_f32_f16.loom:44 to compare explicit frequency handling. Run the extended fixture described in tests/test-hrx-ops.cpp and review the retained diagnostic artifacts. Done means the explicit mode agrees with the CPU reference while the implicit mode, original quantized fixture, and stated tolerances remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, performance, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100