[GH-ISSUE #502] calibrate_ds4_tp: on a pair of equal GPUs the layer split (--tp 1) is never measured; on 2x 3090 it keeps ~22% more trunk experts in VRAM and reads prompts 1.55x faster #203

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

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

tools/calibrate_ds4_tp.py's tp_candidates() returns [2] for two equal GPUs: the layer split, --tp 1, is tried only when no two GPUs match. The thread sweep only goes below the config's own count. So on 2x RTX 3090 --calibrate has nothing to compare against the setup's --tp 2. Measured by hand on v1.1.28, same pack, drafter and starting profile:

2x RTX 3090 + dspark-xs2 essay tok/s code tok/s 6K prompt tok/s trunk experts in VRAM
--tp 2 (setup's choice) 44.71 51.03 488 3,030, each split over both cards; 4,652 MiB left on CUDA1
--tp 1, both GPUs (layer split) 41.08 48.54 755 ~3,706 whole (4,090 with the drafter's); both cards full

I take the point in the tool's docstring that decode decides, since an agent's turns mostly reuse their cached conversation. Even so, --tp 1 deserves to be a candidate:

  • it holds ~22% more trunk experts in VRAM;
  • it reads a long first prompt 55% faster (a new document, a cold cache);
  • its decode cost isn't settled. This pair shows 5–8% lower decode, but another layer-split run of ours (65K context, through a different launcher, a different profile) decoded 45.3 / 52.5, level with or above --tp 2 here.

Measuring --tp 1 on equal pairs too would let the existing rule (decode decides, prompt speed above PROMPT_FLOOR) choose on data. (All figures with the cards at a 230 W limit. At stock power the layer split read 6K prompts ~30% faster again, with decode unchanged; we didn't re-measure --tp 2 at stock.)

Originally created by @noonghunna on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/502 `tools/calibrate_ds4_tp.py`'s `tp_candidates()` returns `[2]` for two equal GPUs: the layer split, `--tp 1`, is tried only when no two GPUs match. The thread sweep only goes below the config's own count. So on 2x RTX 3090 `--calibrate` has nothing to compare against the setup's `--tp 2`. Measured by hand on v1.1.28, same pack, drafter and starting profile: | 2x RTX 3090 + dspark-xs2 | essay tok/s | code tok/s | 6K prompt tok/s | trunk experts in VRAM | |---|---|---|---|---| | `--tp 2` (setup's choice) | 44.71 | 51.03 | 488 | 3,030, each split over both cards; 4,652 MiB left on CUDA1 | | `--tp 1`, both GPUs (layer split) | 41.08 | 48.54 | **755** | ~3,706 whole (4,090 with the drafter's); both cards full | I take the point in the tool's docstring that decode decides, since an agent's turns mostly reuse their cached conversation. Even so, `--tp 1` deserves to be a candidate: - it holds ~22% more trunk experts in VRAM; - it reads a long first prompt 55% faster (a new document, a cold cache); - its decode cost isn't settled. This pair shows 5–8% lower decode, but another layer-split run of ours (65K context, through a different launcher, a different profile) decoded 45.3 / 52.5, level with or above `--tp 2` here. Measuring `--tp 1` on equal pairs too would let the existing rule (decode decides, prompt speed above `PROMPT_FLOOR`) choose on data. (All figures with the cards at a 230 W limit. At stock power the layer split read 6K prompts ~30% faster again, with decode unchanged; we didn't re-measure `--tp 2` at stock.)
Author
Owner

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

Thanks - agreed, and your table made the case. In v1.1.34 ./maya.sh --calibrate also measures the layer split (--tp 1) on two to four equal GPUs, as its last start. The rule is the same as before: decode speed decides, and a setting whose long prompt reads below 60% of the config's own is not taken. On your 2x 3090 that means --tp 1 is measured, and chosen only if it decodes more than 5% faster. (On more than four GPUs a layer split leaves too much of each card idle in decode to be worth the extra start.)

Closing - please reopen if it comes back.

Released in v1.1.34: https://github.com/mw00/project-maya/releases/tag/v1.1.34

<!-- gh-comment-id:6456003097 --> @mw00 commented on GitHub (Oct 27, 2026): Thanks - agreed, and your table made the case. In v1.1.34 `./maya.sh --calibrate` also measures the layer split (`--tp 1`) on two to four equal GPUs, as its last start. The rule is the same as before: decode speed decides, and a setting whose long prompt reads below 60% of the config's own is not taken. On your 2x 3090 that means `--tp 1` is measured, and chosen only if it decodes more than 5% faster. (On more than four GPUs a layer split leaves too much of each card idle in decode to be worth the extra start.) Closing - please reopen if it comes back. Released in **v1.1.34**: https://github.com/mw00/project-maya/releases/tag/v1.1.34
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#203
No description provided.