Skip to content

Annier.fp4 refactor - #96

Open
Annieren wants to merge 4 commits into
gfx11from
annier.fp4_refactor
Open

Annier.fp4 refactor#96
Annieren wants to merge 4 commits into
gfx11from
annier.fp4_refactor

Conversation

@Annieren

@Annieren Annieren commented Sep 2, 2026

Copy link
Copy Markdown

Overview

It dissolves the https://github.com/charlie12345/rocmfp4 into ggml's canonical file homes for the two rocmfp4 quant types on gfx1151 (RDNA3.5), so rocmfp4 becomes structurally indistinguishable from nvfp4/mxfp4.

Additional information

First Author: Charlie12345

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, some study assistance and document.

@Annieren
Annieren requested a review from jimw567 September 2, 2026 05:28
Comment thread ggml/src/ggml-cuda/mmq-config-rdna3-5.cuh
@mgehre-amd

Copy link
Copy Markdown
Collaborator

Can you please explain the validation that you have done in the PR description?

@Annieren

Annieren commented Sep 7, 2026

Copy link
Copy Markdown
Author

Got catch. mmq-config-rdna3-5.cuh was changed accidentally. Added it back.

  1. I have tested ppl for multiple rocmfp4 models test:
model gpu (PPL ± err) cpu (PPL ± err)
gpt-oss-20b-MXFP4.gguf 209.1671 ± 6.69884 206.9469 ± 6.62915
Qwen3.6-35B-A3B-Q4_0_ROCMFP4_STRIX_LEAN.gguf 6.0749 ± 0.14655 6.0730 ± 0.14638
ornith-1.0-35b-MTP-ROCmFP4-COHERENT.gguf 6.1894 ± 0.14964 6.1722 ± 0.14919
Qwen3.6-40B-Deckard-MTP-ROCmFP4-STRIX-embQ8-imatrix-headQ6.gguf 6.0991 ± 0.14321 FAIL(too big to load)
Qwen3-Coder-Next-ROCmFP4-STRIX-embQ8-imatrix-headQ6.gguf 6.3562 ± 0.18145 FAIL(too big to load)
Qwen3.6-35B-A3B-MTP-ROCmFP4-STRIX-embF16-headQ6.gguf 6.0612 ± 0.14725 6.0690 ± 0.14756
FastContext-1.0-4B-SFT-ROCmFP4-STRIX-embF16-imatrix.gguf 9.0616 ± 0.25846 9.0622 ± 0.25856
Nex-N2-mini-ROCmFP4-STRIX-embF16-imatrix-headQ6.gguf 6.0234 ± 0.14591 6.0219 ± 0.14597
  1. Performance test on both rcomfp4 and non-rocmfp4 models, no performance impact as expected:
    fp4refactor-vs baseline
model test A B Δ (B/A)
Cosmos-Reason2-8B-Q8_0 pp512 1500.85 1474.00 -1.8%
Cosmos-Reason2-8B-Q8_0 tg128 26.15 26.11 -0.2%
DeepSeek-R1-Distill-Qwen-7B-Q4_K_M pp512 1633.05 1621.45 -0.7%
DeepSeek-R1-Distill-Qwen-7B-Q4_K_M tg128 46.64 45.82 -1.8%
Meta-Llama-3.1-8B-Instruct-Q4_K_M pp512 1376.46 1367.60 -0.6%
Meta-Llama-3.1-8B-Instruct-Q4_K_M tg128 43.29 42.56 -1.7%
Qwen3-1.7B-Q4_K_M pp512 5399.19 5391.90 -0.1%
Qwen3-1.7B-Q4_K_M tg128 152.71 152.51 -0.1%
Qwen3-30B-A3B-Q4_K_M pp512 1768.02 1773.46 +0.3%
Qwen3-30B-A3B-Q4_K_M tg128 79.30 79.44 +0.2%
Qwen3-4B-Q4_K_M pp512 2552.13 2545.35 -0.3%
Qwen3-4B-Q4_K_M tg128 75.44 75.39 -0.1%
Qwen3.5-35B-A3B-Q4_K_M pp512 1738.59 1734.58 -0.2%
Qwen3.5-35B-A3B-Q4_K_M tg128 59.19 58.72 -0.8%
Qwen3.5-4B-Q4_0 pp512 2325.64 2306.02 -0.8%
Qwen3.5-4B-Q4_0 tg128 66.67 66.46 -0.3%
Qwen3.5-4B-Q4_K_M pp512 2179.13 2267.82 +4.1%
Qwen3.5-4B-Q4_K_M tg128 63.18 62.33 -1.3%
Qwen3.5-9B-Q4_0 pp512 1380.28 1381.55 +0.1%
Qwen3.5-9B-Q4_0 tg128 40.09 40.15 +0.1%
Qwen3.5-9B-Q4_K_M pp512 1241.35 1266.67 +2.0%
Qwen3.5-9B-Q4_K_M tg128 35.24 37.52 +6.5%
Qwen3.6-35B-A3B-UD-Q4_K_XL pp512 1732.68 1707.55 -1.5%
Qwen3.6-35B-A3B-UD-Q4_K_XL tg128 57.62 58.26 +1.1%
Qwen3.6-35B-A3B-UD-Q5_K_XL pp512 1578.18 1612.38 +2.2%
Qwen3.6-35B-A3B-UD-Q5_K_XL tg128 55.82 56.19 +0.7%
SmolLM2-1.7B-Instruct-Q4_K_M pp512 4421.65 4374.87 -1.1%
SmolLM2-1.7B-Instruct-Q4_K_M tg128 148.78 156.17 +5.0%
gemma-4-12b-it-Q4_K_M pp512 916.41 899.97 -1.8%
gemma-4-12b-it-Q4_K_M tg128 27.93 27.76 -0.6%
gemma-4-26B-A4B-it-UD-Q4_K_M pp512 1703.79 1736.18 +1.9%
gemma-4-26B-A4B-it-UD-Q4_K_M tg128 49.61 47.93 -3.4%
gemma-4-31B-it-Q4_K_M pp512 349.48 355.00 +1.6%
gemma-4-31B-it-Q4_K_M tg128 11.21 11.27 +0.5%
mean Δ = -0.2%
  1. ISA diff, no change as expected

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.

2 participants