Skip to content

gguf_convert_endian.py: Add endianness conversion for Q1 and TQ2 quantizations - #26618

Merged
taronaeo merged 2 commits into
ggml-org:masterfrom
Andreas-Krebbel:q1_tq2_endian
Aug 5, 2026
Merged

taronaeo merged 2 commits into
ggml-org:masterfrom
Andreas-Krebbel:q1_tq2_endian

Conversation

@Andreas-Krebbel

@Andreas-Krebbel Andreas-Krebbel commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This adds support for the Q1 TQ2 quantization formats to the gguf_convert_endian.py script. Since the quantized values are sub-byte anyway, nothing needs to be done there. The only target for applying a byte swap is the fp16 values.

Additional information

I've tested these changes with two models on IBM Z (s390x).

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. AI assisted in creating the patch.

@ggml-gh-bot

This comment was marked as resolved.

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for just these two? :)

@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Aug 5, 2026
@Andreas-Krebbel

Andreas-Krebbel commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Any particular reason for just these two? :)

Actually, I had a few more added, but for those, the example models I've found did produce garbage results. It probably wasn't related to the byte swap in the conversion script, but rather to the models itself or something else during inference. But I didn't want to include something I couldn't validate.

@taronaeo taronaeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see you Andreas! :)

@taronaeo
taronaeo merged commit 020760a into ggml-org:master Aug 5, 2026
5 checks passed
@Andreas-Krebbel
Andreas-Krebbel deleted the q1_tq2_endian branch August 5, 2026 10:06
satindergrewal pushed a commit to satindergrewal/llama.cpp that referenced this pull request Aug 12, 2026
…-org#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
huaxel pushed a commit to huaxel/strix-llama.cpp that referenced this pull request Aug 12, 2026
…-org#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
brittlewis12 pushed a commit to brittlewis12/llama.cpp that referenced this pull request Aug 17, 2026
…-org#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
thecodacus pushed a commit to thecodacus/llama.cpp that referenced this pull request Sep 7, 2026
…-org#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
…-org#26618)

* Add endianness conversion for Q1 and TQ2 quantizations

* lint

---------

Co-authored-by: Sigbjørn Skjæret <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants