[PR #320] [MERGED] setup: --tp 1 on one GPU so a DeepSeek prompt takes the chunked path #467

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

📋 Pull Request Information

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

Base: main ← Head: fix/ds4-single-gpu-prompt-path


📝 Commits (1)

  • 65c1ea0 setup: --tp 1 on one GPU so a DeepSeek prompt takes the chunked path

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 maya.py (+9 -1)

📄 Description

What

write_config_ds4 wrote --tp 2 on every PC. With one GPU that group has no equal neighbour, so the
engine takes the layer-group split, and the v1.1.17 note says what that costs: the prompt runs in windows
of 16 tokens. The chunked path on one GPU needs --threads on.

This writes --tp min(2, #GPUs) - two equal GPUs per group, unchanged on 2+ GPUs - and --threads on
when there is one GPU and the config before does not say.

Measure, before -> after

One RTX 4000 Ada Generation 20 GB, Windows 11, DeepSeek-V4.1-Flash-1017 Maya-S, context 262144, engine
v1.1.19, same prompts, greedy, --mmap-experts off in both.

before (--tp 2) after (--tp 1 --threads on)
prompt 2,687 tokens, fresh 103 tok/s 205 tok/s
prompt 63,850 tokens, fresh 571 tok/s 595 tok/s
decode, 200 tokens 8.54 tok/s 10.76 tok/s

The 63.8K row is mostly v1.1.19's long-prompt skip: the last ~2,700 tokens get the full work either way.
The difference is the case where the whole prompt is new tokens, and there the chunked path reads it
about twice as fast.

Engine log: prompts in chunks of 0 before, prompts in chunks of 8192 after.

The output

The prompt path changes, so which expert runs on the CPU and which on the GPU changes with it, and the
last bits of an answer too. The answers in the runs I compared were the same, but this is not a bit for
bit comparison.

Tests

  • python -m unittest tools.test_setup_ds4 -> 43 tests, OK (Windows, the same Python the setup uses);
    the test that asserts --tp 2 still passes because its pc has two GPUs.
  • python tools/check_hip_compat.py -> ok.
  • The rest of tools/ and serve/ on Windows has failures that predate this change (CRLF and C:\
    paths in fixtures); CI runs on Linux, where I could not run it.

Found while measuring a v1.1.19 install on one GPU; the same install with a hand-written --tp 1 --threads on was the "after" column above.


🔄 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/320 **Author:** [@pietroMastro92](https://github.com/pietroMastro92) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `fix/ds4-single-gpu-prompt-path` --- ### 📝 Commits (1) - [`65c1ea0`](https://github.com/mw00/project-maya/commit/65c1ea05bd319bec1f1719dad83a6d81505980b2) setup: --tp 1 on one GPU so a DeepSeek prompt takes the chunked path ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `maya.py` (+9 -1) </details> ### 📄 Description ## What `write_config_ds4` wrote `--tp 2` on every PC. With one GPU that group has no equal neighbour, so the engine takes the layer-group split, and the v1.1.17 note says what that costs: the prompt runs in windows of 16 tokens. The chunked path on one GPU needs `--threads on`. This writes `--tp min(2, #GPUs)` - two equal GPUs per group, unchanged on 2+ GPUs - and `--threads on` when there is one GPU and the config before does not say. ## Measure, before -> after One RTX 4000 Ada Generation 20 GB, Windows 11, DeepSeek-V4.1-Flash-1017 Maya-S, context 262144, engine v1.1.19, same prompts, greedy, `--mmap-experts off` in both. | | before (`--tp 2`) | after (`--tp 1 --threads on`) | |---|---|---| | prompt 2,687 tokens, fresh | 103 tok/s | **205 tok/s** | | prompt 63,850 tokens, fresh | 571 tok/s | **595 tok/s** | | decode, 200 tokens | 8.54 tok/s | **10.76 tok/s** | The 63.8K row is mostly v1.1.19's long-prompt skip: the last ~2,700 tokens get the full work either way. The difference is the case where the whole prompt is new tokens, and there the chunked path reads it about twice as fast. Engine log: `prompts in chunks of 0` before, `prompts in chunks of 8192` after. ## The output The prompt path changes, so which expert runs on the CPU and which on the GPU changes with it, and the last bits of an answer too. The answers in the runs I compared were the same, but this is not a bit for bit comparison. ## Tests - `python -m unittest tools.test_setup_ds4` -> 43 tests, OK (Windows, the same Python the setup uses); the test that asserts `--tp 2` still passes because its `pc` has two GPUs. - `python tools/check_hip_compat.py` -> ok. - The rest of `tools/` and `serve/` on Windows has failures that predate this change (CRLF and `C:\` paths in fixtures); CI runs on Linux, where I could not run it. Found while measuring a v1.1.19 install on one GPU; the same install with a hand-written `--tp 1 --threads on` was the "after" column above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:25:44 +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#467
No description provided.