[PR #360] [MERGED] DeepSeek prompts: keep the expert copies going while the host waits for the routing (+7-9% on 28K tokens here) #488

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

📋 Pull Request Information

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

Base: main ← Head: ds4-flow-pump-while-routing


📝 Commits (1)

  • db703e9 DeepSeek prompts: keep the expert copies going while the host waits for the routing

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 src/ds4/ds4_model.cu (+10 -0)

📄 Description

What it changes: before each layer's bounds come back (the cudaStreamSynchronize after attention, routing and the
shared expert), the host calls flow_pump while the stream is busy, so the layer's likely experts - queued when the
layer before routed - are copied during that work instead of after it. DS4_FLOW_PUMP_WAIT=0: as before.

What it leaves alone: the batches (still fixed by the stream), the order of the sums - the bits are the same.

Measured (v1.1.21 + PR 1 and the others, --mmap-experts off, MAYA_DS4_STREAM=0 DS4_CHUNK=16384, one process a
config, two rounds):

8,517 tokens 28,432 tokens
DS4_FLOW_PUMP_WAIT=0 1,819 / 1,678 tok/s 3,079 / 3,048
default 1,861-1,902 3,276-3,366

On v1.1.19: 1,469 -> 1,607 (8.5K, compute waited for copies 1.86 -> 1.23 s), 2,234 -> 2,345 (28K, 3.47 -> 2.73 s).

Same answers: a 3,000-token prompt + 48 greedy tokens gave the same token ids with it on and off.

🤖 Generated with Claude Code


🔄 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/360 **Author:** [@OscarSheng](https://github.com/OscarSheng) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `ds4-flow-pump-while-routing` --- ### 📝 Commits (1) - [`db703e9`](https://github.com/mw00/project-maya/commit/db703e9e84f4bf01431ea85aeda77e2ca918fd4c) DeepSeek prompts: keep the expert copies going while the host waits for the routing ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/ds4/ds4_model.cu` (+10 -0) </details> ### 📄 Description What it changes: before each layer's bounds come back (the `cudaStreamSynchronize` after attention, routing and the shared expert), the host calls `flow_pump` while the stream is busy, so the layer's likely experts - queued when the layer before routed - are copied during that work instead of after it. `DS4_FLOW_PUMP_WAIT=0`: as before. What it leaves alone: the batches (still fixed by the stream), the order of the sums - the bits are the same. Measured (v1.1.21 + PR 1 and the others, `--mmap-experts off`, `MAYA_DS4_STREAM=0 DS4_CHUNK=16384`, one process a config, two rounds): | | 8,517 tokens | 28,432 tokens | |---|---:|---:| | `DS4_FLOW_PUMP_WAIT=0` | 1,819 / 1,678 tok/s | 3,079 / 3,048 | | default | **1,861-1,902** | **3,276-3,366** | On v1.1.19: 1,469 -> 1,607 (8.5K, compute waited for copies 1.86 -> 1.23 s), 2,234 -> 2,345 (28K, 3.47 -> 2.73 s). Same answers: a 3,000-token prompt + 48 greedy tokens gave the same token ids with it on and off. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:26:00 +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#488
No description provided.