[PR #85] [MERGED] Setup accepts a metadata-only first shard (#83); a split of three or more GPUs pins no more RAM than the PC has (#77) #323

Closed
opened 2026-10-29 21:24:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/85
Author: @mw00
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @mw00

Base: main ← Head: issue-fixes


📝 Commits (1)

  • 0c635ad Setup accepts a metadata-only first shard; the RAM tier counts the prompt path's pinned memory

📊 Changes

7 files changed (+122 additions, -8 deletions)

View changed files

📝 README.md (+2 -2)
📝 include/strata/core/glm_model.hpp (+6 -0)
📝 maya.py (+4 -1)
📝 src/core/glm_fast_path.cu (+57 -4)
📝 src/core/glm_prefill.cu (+10 -0)
📝 tools/gguf_reader.py (+5 -1)
📝 tools/test_maya_models.py (+38 -0)

📄 Description

Two fixes from the issues: the setup accepts unsloth's metadata-only first shard (#83), and a split of three or more GPUs no longer pins more RAM than the PC has (#77).

What changes

  • #83, the setup's shard check:
    • A shard of metadata alone (unsloth's first: the tokenizer, no tensors) is whole at its header's end. Its writer leaves out the alignment padding no data follows, and the engine already reads such a shard (gguf_reader.hpp).
    • incomplete() asked for the padding and stopped step 5 with "short: 9,429,859 of 9,429,888 bytes". It now takes the header's end for a shard without tensors.
    • tools/gguf_reader.py keeps the header's end, and a header cut inside a string now fails to parse instead of passing as whole. Tests for both.
  • #77, the RAM tier on a split of three or more GPUs:
    • The tier's budget is measured when the first GPU starts. Each later GPU's prompt path pins its staging after that (its token rows and landing ring, and the rows a middle GPU hands on, ~1-4 GB), and that came out of the 6 GB headroom.
    • One GPU's staging fits in the headroom (two GPUs, unchanged). Three GPUs' did not, and froze a Linux desktop until a hard reset.
    • What the third GPU on adds is now set aside when the budget is measured.
    • Each later GPU measures the free RAM again and leaves at least half the headroom free.
    • A warning says when what is left after a GPU's tier is short of the headroom.
  • #77, a pinned split's CPU lane (STRATA_GLM_CPU_PIN, Linux) runs a thread per physical core of its CPUs, as the unpinned default does; the SMT siblings stay free. Reported on one CCD of a 5900X per GPU: 10 threads 10.88 tok/s, 6 threads 11.45.
  • README: the headroom and pinning rows.

Tested

  • Python: the setup tests pass with the two new ones (18), and the HIP-name check passes.
  • Mercury (2x V100, Maya-S), against v1.0.30:
    • greedy tokens identical (3496079d, CPU lane off);
    • the RAM tiers the same size (9.75-9.81 + 10.22-10.27 GB against 9.81-9.82 + 10.28);
    • decode 30.1 / 30.6 tok/s against 30.3 / 29.9.
  • Uranus (1x V100, Maya-S): decode 18.0 against 18.0 tok/s. A single GPU has no later GPU to reserve for, so its tier is v1.0.30's.
  • Windows: the engine compiles (MSVC, CUDA 12.8, sm_86).
  • Not tested:
    • a split of three GPUs (our machines have one and two);
    • an unsloth UD quant through the whole setup: the check is tested with GGUFs written by the test.

For the reviewer

  • The headroom still absorbs one later GPU's prompt staging, on purpose. Counting it too took ~0.5 GB of tier from each of Mercury's GPUs and cost ~3% decode, on a split that has run fine.
  • #80 (load a split's parts at once) would make the parts measure the free RAM at the same time. This budget, and the one-measurement-at-the-first-GPU design it extends, assume they start one after another.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/85 **Author:** [@mw00](https://github.com/mw00) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `issue-fixes` --- ### 📝 Commits (1) - [`0c635ad`](https://github.com/mw00/project-maya/commit/0c635ad46009e3557712feef4963a2ed01798001) Setup accepts a metadata-only first shard; the RAM tier counts the prompt path's pinned memory ### 📊 Changes **7 files changed** (+122 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -2) 📝 `include/strata/core/glm_model.hpp` (+6 -0) 📝 `maya.py` (+4 -1) 📝 `src/core/glm_fast_path.cu` (+57 -4) 📝 `src/core/glm_prefill.cu` (+10 -0) 📝 `tools/gguf_reader.py` (+5 -1) 📝 `tools/test_maya_models.py` (+38 -0) </details> ### 📄 Description **Two fixes from the issues: the setup accepts unsloth's metadata-only first shard (#83), and a split of three or more GPUs no longer pins more RAM than the PC has (#77).** ## What changes - **#83, the setup's shard check:** - A shard of metadata alone (unsloth's first: the tokenizer, no tensors) is whole at its header's end. Its writer leaves out the alignment padding no data follows, and the engine already reads such a shard (`gguf_reader.hpp`). - `incomplete()` asked for the padding and stopped step 5 with "short: 9,429,859 of 9,429,888 bytes". It now takes the header's end for a shard without tensors. - `tools/gguf_reader.py` keeps the header's end, and a header cut inside a string now fails to parse instead of passing as whole. Tests for both. - **#77, the RAM tier on a split of three or more GPUs:** - The tier's budget is measured when the first GPU starts. Each later GPU's prompt path pins its staging after that (its token rows and landing ring, and the rows a middle GPU hands on, ~1-4 GB), and that came out of the 6 GB headroom. - One GPU's staging fits in the headroom (two GPUs, unchanged). Three GPUs' did not, and froze a Linux desktop until a hard reset. - What the third GPU on adds is now set aside when the budget is measured. - Each later GPU measures the free RAM again and leaves at least half the headroom free. - A warning says when what is left after a GPU's tier is short of the headroom. - **#77, a pinned split's CPU lane** (`STRATA_GLM_CPU_PIN`, Linux) runs a thread per physical core of its CPUs, as the unpinned default does; the SMT siblings stay free. Reported on one CCD of a 5900X per GPU: 10 threads 10.88 tok/s, 6 threads 11.45. - **README:** the headroom and pinning rows. ## Tested - **Python:** the setup tests pass with the two new ones (18), and the HIP-name check passes. - **Mercury (2x V100, Maya-S), against v1.0.30:** - greedy tokens identical (`3496079d`, CPU lane off); - the RAM tiers the same size (9.75-9.81 + 10.22-10.27 GB against 9.81-9.82 + 10.28); - decode 30.1 / 30.6 tok/s against 30.3 / 29.9. - **Uranus (1x V100, Maya-S):** decode 18.0 against 18.0 tok/s. A single GPU has no later GPU to reserve for, so its tier is v1.0.30's. - **Windows:** the engine compiles (MSVC, CUDA 12.8, sm_86). - **Not tested:** - a split of three GPUs (our machines have one and two); - an unsloth UD quant through the whole setup: the check is tested with GGUFs written by the test. ## For the reviewer - **The headroom still absorbs one later GPU's prompt staging, on purpose.** Counting it too took ~0.5 GB of tier from each of Mercury's GPUs and cost ~3% decode, on a split that has run fine. - **#80 (load a split's parts at once)** would make the parts measure the free RAM at the same time. This budget, and the one-measurement-at-the-first-GPU design it extends, assume they start one after another. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:24:13 +07:00
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#323
No description provided.