[GH-ISSUE #277] --calibrate removes the config's MAYA_GLM_PCIE_SHARE / READ_CHUNKS (an earlier calibration's, kept by hand), and --bench is 12-16% slower without them (twice, v1.1.7 and v1.1.16) #105

Closed
opened 2026-10-29 21:20:53 +07:00 by bsakaguchi · 1 comment
Owner

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

Machine: RTX 5090 Laptop 24 GB, Core Ultra 9 275HX (8P + 16E, AVX2, no AVX-512), 64 GB RAM, Windows 11, driver 617.42. Maya-S24, 128K context, one GPU, part of the model read from the NVMe SSD. Config env: MAYA_GLM_KV_INT8=1, MAYA_GLM_DISK_READERS=8, MAYA_GLM_DISK_SKIP_W=0.12, MAYA_GLM_PCIE_SHARE=0.10, MAYA_GLM_READ_CHUNKS=4, MAYA_GLM_VRAM_EVICT=lru.

What happens: --calibrate --no-start ends with "the engine's own settings are already the fastest here" and apply() removes PCIE_SHARE=0.10 and READ_CHUNKS=4 from the config and from calibration.json. --bench (Maya stopped, same config otherwise) before and after:

decode, mean of 3 answers prefill 2K / 8K
v1.1.7 (2026-10-13), with PCIE_SHARE 0.10 + READ_CHUNKS 4 23.1 tok/s -
v1.1.7, after --calibrate removed them 19.5 tok/s -
v1.1.16 (2026-10-19), with them 23.8 tok/s (23.2 / 25.5 / 22.7) 588 / 1137
v1.1.16, after --calibrate removed them 20.9 tok/s (19.9 / 23.0 / 19.8) 578 / 1134

All three bench questions are slower without them, both times. Putting the two values back restores the speed.

The calibration's own sweep (v1.1.16):

the engine's own split (PCIe share 0.31): 21.1 tok/s
PCIe share 0.00: 18.0   0.10: 21.5   0.25: 21.5   0.50: 18.9   0.75: 17.3
16 CPU threads: 23.4   12: 19.9   11: 18.8   8: 20.1   4: 18.3
confirming against the engine's own settings ...
the engine's own disk reads (8 pieces an expert part): 22.0 tok/s
4 pieces: 23.8   2 pieces: 23.6
confirming the disk reads' size ...
[ok] tuned for this PC: the engine's own settings are already the fastest here (21.3 tok/s)

The single sweep points already show 4 pieces at +8% over the engine's 8, but the interleaved confirmation did not clear MIN_GAIN (3%), so neither value was kept.

What I think causes it (from reading tools/calibrate_glm.py, not tested):

  1. The baseline is the engine's default, not the config's current value. run() strips the calibration's keys from the env before measuring, and apply() removes any key the calibration did not choose. A value the user measured and set is dropped unless it beats the default by 3% inside the calibration, even when the full --bench says it is the faster one.
  2. The two settings are confirmed one at a time. The share is confirmed at the engine's 8 read pieces, and the read pieces at the share that won (here the engine's own, because the share's confirmation did not clear 3%). On this PC each alone is close to the noise, and the two together are +14% in --bench.
  3. One warm engine, switched live. Every arm runs in the same engine through strata_tune, and the VRAM/RAM tiers keep adapting across arms (LRU promotions). That may pull interleaved arms toward each other, while a fresh start with each setting (what --bench does) shows the gap.

Possible fixes, any one would have kept the faster settings here:

  • Compare against the config's current values as the incumbent, and keep them unless the default wins by MIN_GAIN (the rule in the other direction).
  • Confirm the combination (share + read pieces) against the default together.
  • Never remove a value set by hand in the config: report what the calibration measured and leave the choice to the user.

Happy to run a patched calibrate_glm.py on this laptop and report back.

Originally created by @klvnblst on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/277 **Machine:** RTX 5090 Laptop 24 GB, Core Ultra 9 275HX (8P + 16E, AVX2, no AVX-512), 64 GB RAM, Windows 11, driver 617.42. Maya-S24, 128K context, one GPU, part of the model read from the NVMe SSD. Config env: `MAYA_GLM_KV_INT8=1`, `MAYA_GLM_DISK_READERS=8`, `MAYA_GLM_DISK_SKIP_W=0.12`, `MAYA_GLM_PCIE_SHARE=0.10`, `MAYA_GLM_READ_CHUNKS=4`, `MAYA_GLM_VRAM_EVICT=lru`. **What happens:** `--calibrate --no-start` ends with "the engine's own settings are already the fastest here" and `apply()` removes `PCIE_SHARE=0.10` and `READ_CHUNKS=4` from the config and from `calibration.json`. `--bench` (Maya stopped, same config otherwise) before and after: | | decode, mean of 3 answers | prefill 2K / 8K | |---|---:|---:| | v1.1.7 (2026-10-13), with PCIE_SHARE 0.10 + READ_CHUNKS 4 | 23.1 tok/s | - | | v1.1.7, after `--calibrate` removed them | 19.5 tok/s | - | | v1.1.16 (2026-10-19), with them | 23.8 tok/s (23.2 / 25.5 / 22.7) | 588 / 1137 | | v1.1.16, after `--calibrate` removed them | 20.9 tok/s (19.9 / 23.0 / 19.8) | 578 / 1134 | All three bench questions are slower without them, both times. Putting the two values back restores the speed. **The calibration's own sweep (v1.1.16):** ``` the engine's own split (PCIe share 0.31): 21.1 tok/s PCIe share 0.00: 18.0 0.10: 21.5 0.25: 21.5 0.50: 18.9 0.75: 17.3 16 CPU threads: 23.4 12: 19.9 11: 18.8 8: 20.1 4: 18.3 confirming against the engine's own settings ... the engine's own disk reads (8 pieces an expert part): 22.0 tok/s 4 pieces: 23.8 2 pieces: 23.6 confirming the disk reads' size ... [ok] tuned for this PC: the engine's own settings are already the fastest here (21.3 tok/s) ``` The single sweep points already show 4 pieces at +8% over the engine's 8, but the interleaved confirmation did not clear `MIN_GAIN` (3%), so neither value was kept. **What I think causes it** (from reading `tools/calibrate_glm.py`, not tested): 1. **The baseline is the engine's default, not the config's current value.** `run()` strips the calibration's keys from the env before measuring, and `apply()` removes any key the calibration did not choose. A value the user measured and set is dropped unless it beats the default by 3% inside the calibration, even when the full `--bench` says it is the faster one. 2. **The two settings are confirmed one at a time.** The share is confirmed at the engine's 8 read pieces, and the read pieces at the share that won (here the engine's own, because the share's confirmation did not clear 3%). On this PC each alone is close to the noise, and the two together are +14% in `--bench`. 3. **One warm engine, switched live.** Every arm runs in the same engine through `strata_tune`, and the VRAM/RAM tiers keep adapting across arms (LRU promotions). That may pull interleaved arms toward each other, while a fresh start with each setting (what `--bench` does) shows the gap. **Possible fixes**, any one would have kept the faster settings here: - Compare against the config's current values as the incumbent, and keep them unless the default wins by `MIN_GAIN` (the rule in the other direction). - Confirm the combination (share + read pieces) against the default together. - Never remove a value set by hand in the config: report what the calibration measured and leave the choice to the user. Happy to run a patched `calibrate_glm.py` on this laptop and report back.
Author
Owner

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

Fixed in v1.1.18: --calibrate now treats the config's own values as the ones to beat - it compares them, together, with what its sweeps found, and keeps them unless the new choice is more than 3% faster. Thanks for the detailed report and the analysis!

<!-- gh-comment-id:6295076943 --> @mw00 commented on GitHub (Oct 20, 2026): Fixed in [v1.1.18](https://github.com/mw00/project-maya/releases/tag/v1.1.18): `--calibrate` now treats the config's own values as the ones to beat - it compares them, together, with what its sweeps found, and keeps them unless the new choice is more than 3% faster. Thanks for the detailed report and the analysis!
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#105
No description provided.