Skip to content

gguf_convert_endian.py: skip MXFP4 data#17523

Merged
CISC merged 2 commits intoggml-org:masterfrom
AlekseiNikiforovIBM:byteswap_mxfp4
Nov 27, 2025
Merged

gguf_convert_endian.py: skip MXFP4 data#17523
CISC merged 2 commits intoggml-org:masterfrom
AlekseiNikiforovIBM:byteswap_mxfp4

Conversation

@AlekseiNikiforovIBM
Copy link
Contributor

MXFP4 data only uses 1-byte data, there's nothing to byteswap.

Also use gguf.constants.GGML_QUANT_SIZES to determine block sizes. Don't duplicate block size constants.

@CISC
Copy link
Member

CISC commented Nov 26, 2025

Hmmm, won't converting gpt-oss mess up for the same reason? I think GGUFWriter.add_tensor/write_tensor_data needs a check.

@AlekseiNikiforovIBM
Copy link
Contributor Author

Hmmm, won't converting gpt-oss mess up for the same reason? I think GGUFWriter.add_tensor/write_tensor_data needs a check.

byteswap calls in GGUFWriter.add_tensor/write_tensor_data should be already a no-op if data elements are 1-byte-sized. But this conversion script requires explicit handling for each data structure.

@CISC CISC merged commit 4fcd87c into ggml-org:master Nov 27, 2025
4 of 5 checks passed
@CISC
Copy link
Member

CISC commented Nov 27, 2025

@AlekseiNikiforovIBM Mind having a look at gguf_new_metadata.py and gguf_editor_gui.py? I have a feeling they might mess up when saving a non-native endian GGUF.

@AlekseiNikiforovIBM
Copy link
Contributor Author

I can take a look at these scripts. Are there any examples on how to use gguf_new_metadata.py?

@CISC
Copy link
Member

CISC commented Nov 27, 2025

I can take a look at these scripts. Are there any examples on how to use gguf_new_metadata.py?

A very simple test would just be gguf-new-metadata --general-name foo input.gguf output.gguf

Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
* gguf_convert_endian.py: skip MXFP4 data

* Use gguf.constants.GGML_QUANT_SIZES to determine block sizes
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
* gguf_convert_endian.py: skip MXFP4 data

* Use gguf.constants.GGML_QUANT_SIZES to determine block sizes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants