[GH-ISSUE #83] Setup: unsloth's metadata-only first shard is reported "short" (29 bytes of alignment padding missing) #31

Closed
opened 2026-10-29 21:19:25 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @speja969 on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/83

Version: Project Maya v1.0.30 (c189f7a), Linux (Debian 13).

What happens: with unsloth/GLM-5.3-Flash-GGUF UD-IQ4_XS passed through --gguf-dir, step 5 stops:

[X]  GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf: short: 9,429,859 of 9,429,888 bytes
     finish copying or downloading it, then run ./maya.sh again

The file is complete: 9,429,859 bytes is its size on Hugging Face, and llama.cpp loads the model from it. unsloth's first shard holds only metadata, no tensors.

Why: incomplete() in maya.py computes need = g.data_start + max(tensor ends, default=0), and GGUFFile (tools/gguf_reader.py) sets data_start to the end of the header rounded up to general.alignment (32). With no tensors, that asks for 29 bytes of trailing padding that the writer did not add (9,429,859 rounded up is 9,429,888).

Workaround: a padded copy of shard 1, with the other shards linked next to it:

cp <unsloth folder>/GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf <models>/UD-IQ4_XS/
truncate -s 9429888 <models>/UD-IQ4_XS/GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf
ln -s <unsloth folder>/GLM-5.3-Flash-UD-IQ4_XS-0000[2-5]-of-00005.gguf <models>/UD-IQ4_XS/

After that the setup, the pack, the calibration, the server and --bench all ran (speed report in a separate issue).

A possible fix: treat a file without tensors as whole once its header is there. For example, keep the unaligned end in GGUFFile._parse (self.header_end = pos, before rounding) and in incomplete():

need = (g.data_start + max(t.offset + (t.expected_bytes() or 0) for t in g.tensors)
        if g.tensors else g.header_end)

Not tested: whether the engine itself loads the unpadded shard once the check passes. Other unsloth quants whose first shard holds only metadata may hit the same check.

Originally created by @speja969 on GitHub (Oct 10, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/83 **Version:** Project Maya v1.0.30 (`c189f7a`), Linux (Debian 13). **What happens:** with unsloth/GLM-5.3-Flash-GGUF **UD-IQ4_XS** passed through `--gguf-dir`, step 5 stops: ``` [X] GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf: short: 9,429,859 of 9,429,888 bytes finish copying or downloading it, then run ./maya.sh again ``` **The file is complete:** 9,429,859 bytes is its size on Hugging Face, and llama.cpp loads the model from it. unsloth's first shard holds only metadata, no tensors. **Why:** `incomplete()` in `maya.py` computes `need = g.data_start + max(tensor ends, default=0)`, and `GGUFFile` (`tools/gguf_reader.py`) sets `data_start` to the end of the header rounded up to `general.alignment` (32). With no tensors, that asks for 29 bytes of trailing padding that the writer did not add (9,429,859 rounded up is 9,429,888). **Workaround:** a padded copy of shard 1, with the other shards linked next to it: ```sh cp <unsloth folder>/GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf <models>/UD-IQ4_XS/ truncate -s 9429888 <models>/UD-IQ4_XS/GLM-5.3-Flash-UD-IQ4_XS-00001-of-00005.gguf ln -s <unsloth folder>/GLM-5.3-Flash-UD-IQ4_XS-0000[2-5]-of-00005.gguf <models>/UD-IQ4_XS/ ``` After that the setup, the pack, the calibration, the server and `--bench` all ran (speed report in a separate issue). **A possible fix:** treat a file without tensors as whole once its header is there. For example, keep the unaligned end in `GGUFFile._parse` (`self.header_end = pos`, before rounding) and in `incomplete()`: ```python need = (g.data_start + max(t.offset + (t.expected_bytes() or 0) for t in g.tensors) if g.tensors else g.header_end) ``` Not tested: whether the engine itself loads the unpadded shard once the check passes. Other unsloth quants whose first shard holds only metadata may hit the same check.
Author
Owner

@mw00 commented on GitHub (Oct 10, 2026):

Thank you, the diagnosis was exact. The fix is in #85, as you suggested:

  • incomplete() now takes a shard without tensors as whole at its header's end;
  • tools/gguf_reader.py keeps that end.

The engine already accepted such a shard: its reader skips the end-of-file check when there are no tensors. So your padded copy won't be needed once #85 is in a release.

<!-- gh-comment-id:6096939978 --> @mw00 commented on GitHub (Oct 10, 2026): Thank you, the diagnosis was exact. The fix is in #85, as you suggested: - `incomplete()` now takes a shard without tensors as whole at its header's end; - `tools/gguf_reader.py` keeps that end. The engine already accepted such a shard: its reader skips the end-of-file check when there are no tensors. So your padded copy won't be needed once #85 is in a release.
Author
Owner

@mw00 commented on GitHub (Oct 11, 2026):

Fixed in v1.0.32 (#85): a first shard that holds only metadata (the tokenizer and settings, as unsloth's) is now read as whole, so the setup goes on to the pack. Update with the dashboard's About > Update, or git pull then ./setup.sh. Please reopen if it still stops for you.

<!-- gh-comment-id:6103591484 --> @mw00 commented on GitHub (Oct 11, 2026): Fixed in [v1.0.32](https://github.com/mw00/project-maya/releases/tag/v1.0.32) (#85): a first shard that holds only metadata (the tokenizer and settings, as unsloth's) is now read as whole, so the setup goes on to the pack. Update with the dashboard's About > Update, or `git pull` then `./setup.sh`. Please reopen if it still stops for you.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#31
No description provided.