Skip to content

fix(model): preserve GGUF tensor alignment when grafting the MTP head - #70

Merged
0xaron merged 1 commit into
opensetlabs:mainfrom
Afloat16:fix/preserve-graft-tensor-alignment
Nov 26, 2026
Merged

0xaron merged 1 commit into
opensetlabs:mainfrom
Afloat16:fix/preserve-graft-tensor-alignment

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

What this changes and why

The graft copies general.alignment as generic metadata without updating GGUFWriter alignment. Nondefault-alignment inputs produce output whose declared and actual tensor offsets disagree.

Use the GGUF writer custom-alignment API when copying general.alignment so metadata and tensor padding remain consistent.

Closes #69.

How it was tested (machine, commands, output)

Linux x86-64, AMD EPYC 9V74, Python 3.12.14.

python3 -m unittest discover -s tests -p test_graft_alignment.py -v

The round-trip regression fails on unchanged source and passes for both alignment values after the change, preserving exact tensor values. Tests ran with GGUF 0.19.0 and NumPy.

Shell syntax and changed Python compilation checks passed.

  • ./install.sh on a clean machine, then ./serve and one request: a clean-prefix installation was attempted but the 15 GB disk check failed; no inference request was run.
  • README and help remain consistent with this focused correction.
  • No README measurement was changed.

@0xaron
0xaron merged commit 58e6168 into opensetlabs:main Nov 26, 2026
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.

model: preserve GGUF tensor alignment when grafting the MTP head

2 participants