Skip to content

MXFP8 pass-through - #35

Draft
createthis wants to merge 8 commits into
masterfrom
MXFP8_ngram_convert_and_load
Draft

createthis wants to merge 8 commits into
masterfrom
MXFP8_ngram_convert_and_load

Conversation

@createthis

@createthis createthis commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

MXFP8 pass-through

Used ggml-org#33062 and unslothai#332 as guides.

.from_float currently missing because adding it would require .vec_dot. Perhaps we can merge ggml-org#26157 and then add .from_float.

Potential issues flagged by my agent

In our code, amax is calculated without checking isfinite().

  • NaN: May be ignored when calculating the scale.
  • Infinity: log2f(INFINITY) produces infinity, which is then cast to int—undefined behavior.
    OCP specifies a NaN block scale (0xFF) for either case.
    OCP Microscaling Formats (MX) Specification

Agent claims this doesn't affect direct MXFP8 pass-through.

Usage

Download safetensors to /data2/DeepSeek-V4.1-Flash-1017 then:

mkdir /data2/createthis/DeepSeek-V4.1-Flash-1017-MXFP8

python convert_hf_to_gguf.py /data2/DeepSeek-V4.1-Flash-1017 \
    --outfile /data2/createthis/DeepSeek-V4.1-Flash-1017-MXFP8/ \
    --outtype auto \
    --split-max-size 50G

mkdir /data2/createthis/DeepSeek-V4.1-Flash-1017-GGUF
mkdir /data2/createthis/DeepSeek-V4.1-Flash-1017-GGUF/Q4_K_M

./build/bin/llama-quantize \
    --keep-split \
    --tensor-type '.*_(exps|chexps)\.weight=mxfp4' \
    /data2/createthis/DeepSeek-V4.1-Flash-1017-MXFP8/DeepSeek-V4.1-Flash-384x206B-1017-MXFP4_MOE-00001-of-00008.gguf \
    /data2/createthis/DeepSeek-V4.1-Flash-1017-GGUF/Q4_K_M/DeepSeek-V4.1-Flash-Q4_K_M.gguf \
    Q4_K_M

@createthis createthis changed the title MXFP8 ngram convert and load MXFP8 pass-through Nov 29, 2026
@createthis createthis self-assigned this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant