Repository navigation
Conversation
…, CPU, Vulkan)
Ports the ROCmFPX tensor formats from ciru-ai/ROCmFPX onto current master
without removing anything upstream. ggml-cuda is not touched at all in this
commit -- 0 files modified there -- and the HIP backend still builds, which is
what makes the Vulkan and format layers safe to carry.
Types, on ciru's numbering so their published GGUFs load correctly:
Q4_0_ROCMFP4 100 4.50 bpw UE4M3 scales + packed AMD FP4 blocks
Q4_0_ROCMFP4_FAST 101 4.25 bpw single-scale speed layout
Q6_0_ROCMFPX 102 6.50 bpw signed-magnitude integer levels
Q8_0_ROCMFPX 103 8.25 bpw signed int8, clamped
Q3_0_ROCMFPX 104 3.50 bpw
TURBO3_0 105 3.50 bpw KV cache
TURBO4_0 106 4.50 bpw KV cache
Q7_0_ROCMFPX 107 7.50 bpw DualView, packed signed-Q7 + FP16 scales
Q2_0_ROCMFPX 108 2.50 bpw S40 codebook + dual UE4M3 scales
What is here: format definitions and reference math (ggml/rocmfpx, ggml/rocmfp4),
CPU paths, Vulkan dequant shaders and integer-dot (MMQ/MMVQ) paths, gguf-py
support, and the llama-quantize recipes.
What is not here yet: the ROCm/HIP kernels. ciru's ggml-cuda replaces upstream's
per-arch MMQ configuration -- its own base carried 8 mmq-config-*.cuh includes
and 42 ggml_cuda_mmq_get_config references, its version has neither -- so taking
it wholesale would revert that machinery for every quant type and every GPU.
Upstream has since restructured MMQ into mmq-load-tiles.cuh, mmq-vec-dot.cuh
and per-type mmq-instance-*.cu files, which is an additive extension path. The
kernels will be re-derived onto that in phase 2 rather than merged over it.
Conflict resolutions, 13 hunks over 4 files:
- ggml-vulkan.cpp: kept both sides for the new pipelines and switch cases;
took upstream's renames (k_fa_type -> k_type_eff, k_nb2 -> nbk2_eff).
- flash_attn_base.glsl: upstream moved the FA type constants into the shared
fa_types.glsl, so ciru's inline copies were dropped and its ROCmFPX, TURBO
and Q1_0 cases added to fa_types.glsl instead.
- ggml/src/CMakeLists.txt: kept upstream's GGML_OPENMP_FETCH block.
- vulkan-shaders-gen.cpp: kept both sets of shader registrations.
Also corrects the FP6 codebook: its first negative entry is -32, not -0. The
fork's own port notes record the old value disagreeing with
rocmfpx_decode_fp6_code and costing ~2% error. This changes FP6 decode output
and has been compiled here, not validated on hardware.
Source: https://github.com/ciru-ai/ROCmFPX (MIT)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dzannotti
force-pushed
the
rocmfpx/full
branch
from
August 27, 2026 21:52
9abe628 to
469d5e2
Compare
Collaborator
Author
|
@LaurentZuijdwijk i think we should close this in favor of the work you was already doing |
gaetan-puleo
pushed a commit
to rcfa/strix-llama.cpp
that referenced
this pull request
Oct 16, 2026
Co-authored-by: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 542ff66)
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.
Ports the ROCmFPX tensor formats from ciru-ai/ROCmFPX (MIT) onto current
masteradditively — nothing upstream is removed.ggml-cuda: 0 files modified. The HIP backend still builds unchanged, which is what makes this safe to carry and to sync.57 files, +9,909/−762.
Types
On ciru's numbering, so their published GGUFs load correctly:
Q4_0_ROCMFP4Q4_0_ROCMFP4_FASTQ6_0_ROCMFPXQ8_0_ROCMFPXQ3_0_ROCMFPXTURBO3_0TURBO4_0Q7_0_ROCMFPXQ2_0_ROCMFPXEvery type ciru adds over upstream, verified by set comparison.
GGML_TYPE_COUNT = 109matches ciru exactly.Numbering: these are on-disk GGUF ids. Laurent's fork independently assigned
107 = Q2_0_ROCMFPX, colliding with ciru's107 = Q7_0_ROCMFPX. This follows ciru. Ids 100–104 agree under both, so all FP4/FP6/FP8 models are unaffected either way.What is here
Format definitions and reference math (
ggml/rocmfpx,ggml/rocmfp4), CPU paths, Vulkan dequant shaders and integer-dot (MMQ/MMVQ) paths, gguf-py support,llama-quantizerecipes.What is not here yet — and why it is a phase, not an omission
The ROCm/HIP kernels.
ciru's
ggml-cudais not additive on top of upstream — it replaces upstream machinery. Inmmq.cuh, ciru's own base carried 8mmq-config-*.cuhincludes and 42ggml_cuda_mmq_get_configreferences; ciru's version has neither, substituting the oldertile_x_sizes/MMQ_DP4A_TXS_*scheme. Merging it reverts upstream's per-arch MMQ configuration for every quant type and every GPU, and leaves 16k lines of divergence in a directory upstream touches ~81 times per 90 days.Upstream has since restructured MMQ into an extension-friendly shape:
with
NVFP4andMXFP4already shipping through it. Phase 2 re-derives ciru's kernels onto that path, per type, so they add rather than replace — keeping NVIDIA paths intact (not because they are used here, but because deleting them is what makes a fork unmergeable) and keeping future syncs clean.The wholesale port is preserved on
rocmfpx/wholesale-reference— it builds on both backends (Vulkan 663 targets, HIPggml-hip+llama-quantize, 0 errors) and is the reference for the re-derivation. It is not proposed for merge.A behavioural change to be aware of
The FP6 codebook's first negative entry is corrected to
-32from-0. The fork's own port notes record the old value disagreeing withrocmfpx_decode_fp6_codeand costing ~2% error. This changes FP6 decode output.Verification
-DGGML_VULKAN=ON, fedora 44)llama-cli+llama-quantizelinked-DGGML_HIP=ON -DGPU_TARGETS=gfx1151)ggml-cudauntouchedCompile and link only. Nothing ran on hardware, no model was quantized or evaluated. Before this drives anything it wants
test-backend-opson the GPU and a perplexity run against a known-good quant — the FP6 change especially.For context on whether this is worth landing: the fork's measurements put
Q4_0_ROCMFP4at 14.63 GiB / 12.56 tg128 / 5.9842 PPL against UD-Q4_K_XL at 16.69 GiB / 11.71 / 5.8965 — smaller and faster, marginally worse quality, error bars overlapping. No comparison againstIQ4_XSexists in either project, which is arguably the incumbent it has to beat.