[PR #5118] [Other] Drafting: DFlash2 named on a layer split runs beside several requests (opt-in) #5314

Open
opened 2026-11-07 16:34:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5118
Author: @Joe11221
Created: 11/3/2026
Status: 🔄 Open

Base: main ← Head: dflash2-parallel-split


📝 Commits (3)

  • 37f0806 [Other] Drafting: DFlash2 named on a layer split runs beside several requests (opt-in)
  • 2b50ac1 [Docs] Batching: DFlash2 with several requests on a layer split, measured on six mixed cards
  • f1e45f4 [Other] Drafting: the split test follows the named DFlash2 beside several requests

📊 Changes

7 files changed (+66 additions, -16 deletions)

View changed files

📝 docs/BATCHING.md (+23 -0)
📝 serve/server.py (+2 -2)
📝 strata_cli/drafting_cmd.py (+2 -1)
📝 strata_cli/launch/runner.py (+2 -1)
📝 strata_control/drafting.py (+14 -7)
📝 tests/terminal/test_drafting.py (+14 -0)
📝 tests/terminal/test_drafting_single.py (+9 -5)

📄 Description

Problem and result

On a layer split, a run config with "drafting": "dflash2" and "parallel": 2 starts the MTP instead, with the note "DFlash2 isn't available in this mode". The 0.1.56 engine runs --draft dflash2 beside --batch: a request running alone drafts with DFlash2, and the batch slots follow the engine's own slot-draft rule. Only the Terminal's plan (drafting.blocked_by) stops it.

With this change, DFlash2 that the person names runs beside several requests on a layer split. Auto keeps the MTP there, one card keeps the MTP, and --pipeline-windows still blocks DFlash2. Without a named dflash2 on a split with several requests, the engine arguments are the same as before.

Measured on six mixed cards (below), two slots cost both drafters the same share of a lone request's speed, and two slots answered three short requests about 13% sooner than one at a time with either drafter:

Original IQ3_S One request at a time "parallel": 2 Three short requests, wall
MTP 56.2 tok/s 51.0 tok/s (-9.3%) 12.65 s -> 10.93 s
DFlash2 52.2 tok/s 47.9 tok/s (-8.2%) 13.05 s -> 11.38 s

DFlash2 itself ran 6 to 7% slower than the MTP on these cards. That is a measurement of this machine, where the drafter runs on an RTX 3060 and the engine already warns about that. This PR makes no default change.

Approach

  • strata_control/drafting.py: blocked_by takes chosen (DFlash2 named). Several requests don't block it when chosen and the start is a layer split (split, or a --layer-split argument). apply passes chosen from the config's choice.
  • serve/server.py: passes split=layer_split_of(...) to drafting.apply. Before this, the server never told it about a split.
  • strata_cli/launch/runner.py and strata_cli/drafting_cmd.py: pass chosen; drafting plan also works out the split from the run config's gpu list.
  • docs/BATCHING.md: what runs where, and the numbers.

Auto stays as it is because changing it would change a default, and I measured DFlash2 slower than the MTP here. The app keeps its own rule from ffa80d73 (one request for DFlash2 on a split), and this PR doesn't touch the app.

Validation

Measured: RTX 2080 Ti, RTX 3060, 3x Tesla P100, RTX 3060 in split order, Xeon W-2150B, 188 GiB, CUDA 12.9.1. v0.2.10 built with the root Dockerfile (CUDA_ARCHITECTURES=60;75;86) plus the P100 fix of #4274, which these cards need, and this branch's Python files mounted over the image's. Original and Swift 1.5 IQ3_S, context 178,176, --kv int8, the Q4_0 DFlash2 pack with the Q4_0 selector that strata drafting fetch makes. The MTP ran with --spec 4 (my run config), DFlash2 with the release's --spec 6 and --draft-conf. Each run was a fresh engine, nothing retried. Two runs per configuration with "parallel": 2, in one order and then reversed. One request at a time: two MTP runs and three DFlash2 runs. Each run read prompts of 4K, 32K and 128K, decoded seven prompts of 512 tokens three times, and ran a session with six follow-ups, a side request, a second conversation, parallel rounds and a cancel.

Passed:

  • 13 runs: every request completed, and the engine logged no errors and no non-finite values. In every "parallel": 2 DFlash2 run the engine logged DFlash2 drafter on and --batch-groups auto: 2 groups of 1 slot, and lone requests drafted (14,500 of 23,736 drafts accepted on the original weights).
  • Follow-up turns reused 99.78 to 99.85% of their tokens, first token median 0.49 to 0.54 s, in all four configurations.
  • Prompt reads with "parallel": 2: DFlash2 1,103 tok/s at 32K and 1,503 at 128K, MTP 1,081 and 1,496.
  • python -m pytest tests/terminal/test_drafting.py: the new tests pass. They cover: named on a split with two requests, the server's arguments for that case, Auto keeping the MTP, one card keeping the MTP, and --pipeline-windows.
  • python -m pytest tests/terminal (Windows, Python 3.14). On v0.2.10: 47 failed, 2,424 passed, 80 skipped, 28 errors. On this branch before its last commit: 49 failed, 2,423 passed, 80 skipped, 28 errors. One new failure was test_a_layer_split_with_several_requests_is_the_mtp_alone, which pinned the old rule. The last commit splits it into Auto (the MTP) and named DFlash2 (DFlash2 alone with --batch), and both pass. The other differences are in test_cfg_paths.py, which gave 4 failed and 0 or 1 error in two runs on each revision.
  • python tools/test_setup_choices.py: OK on both.

Failed:

  • test_the_server_applies_it_at_every_start fails at its last check on this Windows machine. An extra --kv-resident 8192 appears, and it fails the same way on v0.2.10. The new checks in that test run before that line and pass.

Not run: one card (still blocked), more than two slots, a split where the slots run as one group (where the engine also gives each slot its own drafter), other cards, Metal and the app.

Limits

One machine. Lone requests at "parallel": 2 are slower than at one request at a time with either drafter here, because the slot sessions take expert cache on the first card (2,016 -> 1,476 slots).


🔄 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/Niko1221/Strata/pull/5118 **Author:** [@Joe11221](https://github.com/Joe11221) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `dflash2-parallel-split` --- ### 📝 Commits (3) - [`37f0806`](https://github.com/Niko1221/Strata/commit/37f08060f8c1ef5b2108df656a8f40bcecc10806) [Other] Drafting: DFlash2 named on a layer split runs beside several requests (opt-in) - [`2b50ac1`](https://github.com/Niko1221/Strata/commit/2b50ac1c7b78ec6a14963bfefaa57d33e03ffed8) [Docs] Batching: DFlash2 with several requests on a layer split, measured on six mixed cards - [`f1e45f4`](https://github.com/Niko1221/Strata/commit/f1e45f46739dc1f3da183771415ddebfcd75e6cc) [Other] Drafting: the split test follows the named DFlash2 beside several requests ### 📊 Changes **7 files changed** (+66 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/BATCHING.md` (+23 -0) 📝 `serve/server.py` (+2 -2) 📝 `strata_cli/drafting_cmd.py` (+2 -1) 📝 `strata_cli/launch/runner.py` (+2 -1) 📝 `strata_control/drafting.py` (+14 -7) 📝 `tests/terminal/test_drafting.py` (+14 -0) 📝 `tests/terminal/test_drafting_single.py` (+9 -5) </details> ### 📄 Description ## Problem and result On a layer split, a run config with `"drafting": "dflash2"` and `"parallel": 2` starts the MTP instead, with the note "DFlash2 isn't available in this mode". The 0.1.56 engine runs `--draft dflash2` beside `--batch`: a request running alone drafts with DFlash2, and the batch slots follow the engine's own slot-draft rule. Only the Terminal's plan (`drafting.blocked_by`) stops it. With this change, DFlash2 that the person names runs beside several requests on a layer split. Auto keeps the MTP there, one card keeps the MTP, and `--pipeline-windows` still blocks DFlash2. Without a named `dflash2` on a split with several requests, the engine arguments are the same as before. Measured on six mixed cards (below), two slots cost both drafters the same share of a lone request's speed, and two slots answered three short requests about 13% sooner than one at a time with either drafter: | Original IQ3_S | One request at a time | `"parallel": 2` | Three short requests, wall | |---|---:|---:|---:| | MTP | 56.2 tok/s | 51.0 tok/s (-9.3%) | 12.65 s -> 10.93 s | | DFlash2 | 52.2 tok/s | 47.9 tok/s (-8.2%) | 13.05 s -> 11.38 s | DFlash2 itself ran 6 to 7% slower than the MTP on these cards. That is a measurement of this machine, where the drafter runs on an RTX 3060 and the engine already warns about that. This PR makes no default change. ## Approach - `strata_control/drafting.py`: `blocked_by` takes `chosen` (DFlash2 named). Several requests don't block it when `chosen` and the start is a layer split (`split`, or a `--layer-split` argument). `apply` passes `chosen` from the config's choice. - `serve/server.py`: passes `split=layer_split_of(...)` to `drafting.apply`. Before this, the server never told it about a split. - `strata_cli/launch/runner.py` and `strata_cli/drafting_cmd.py`: pass `chosen`; `drafting plan` also works out the split from the run config's `gpu` list. - `docs/BATCHING.md`: what runs where, and the numbers. Auto stays as it is because changing it would change a default, and I measured DFlash2 slower than the MTP here. The app keeps its own rule from ffa80d73 (one request for DFlash2 on a split), and this PR doesn't touch the app. ## Validation Measured: RTX 2080 Ti, RTX 3060, 3x Tesla P100, RTX 3060 in split order, Xeon W-2150B, 188 GiB, CUDA 12.9.1. `v0.2.10` built with the root `Dockerfile` (`CUDA_ARCHITECTURES=60;75;86`) plus the P100 fix of #4274, which these cards need, and this branch's Python files mounted over the image's. Original and Swift 1.5 IQ3_S, context 178,176, `--kv int8`, the Q4_0 DFlash2 pack with the Q4_0 selector that `strata drafting fetch` makes. The MTP ran with `--spec 4` (my run config), DFlash2 with the release's `--spec 6` and `--draft-conf`. Each run was a fresh engine, nothing retried. Two runs per configuration with `"parallel": 2`, in one order and then reversed. One request at a time: two MTP runs and three DFlash2 runs. Each run read prompts of 4K, 32K and 128K, decoded seven prompts of 512 tokens three times, and ran a session with six follow-ups, a side request, a second conversation, parallel rounds and a cancel. Passed: - 13 runs: every request completed, and the engine logged no errors and no non-finite values. In every `"parallel": 2` DFlash2 run the engine logged `DFlash2 drafter on` and `--batch-groups auto: 2 groups of 1 slot`, and lone requests drafted (14,500 of 23,736 drafts accepted on the original weights). - Follow-up turns reused 99.78 to 99.85% of their tokens, first token median 0.49 to 0.54 s, in all four configurations. - Prompt reads with `"parallel": 2`: DFlash2 1,103 tok/s at 32K and 1,503 at 128K, MTP 1,081 and 1,496. - `python -m pytest tests/terminal/test_drafting.py`: the new tests pass. They cover: named on a split with two requests, the server's arguments for that case, Auto keeping the MTP, one card keeping the MTP, and `--pipeline-windows`. - `python -m pytest tests/terminal` (Windows, Python 3.14). On `v0.2.10`: 47 failed, 2,424 passed, 80 skipped, 28 errors. On this branch before its last commit: 49 failed, 2,423 passed, 80 skipped, 28 errors. One new failure was `test_a_layer_split_with_several_requests_is_the_mtp_alone`, which pinned the old rule. The last commit splits it into Auto (the MTP) and named DFlash2 (DFlash2 alone with `--batch`), and both pass. The other differences are in `test_cfg_paths.py`, which gave 4 failed and 0 or 1 error in two runs on each revision. - `python tools/test_setup_choices.py`: OK on both. Failed: - `test_the_server_applies_it_at_every_start` fails at its last check on this Windows machine. An extra `--kv-resident 8192` appears, and it fails the same way on `v0.2.10`. The new checks in that test run before that line and pass. Not run: one card (still blocked), more than two slots, a split where the slots run as one group (where the engine also gives each slot its own drafter), other cards, Metal and the app. ## Limits One machine. Lone requests at `"parallel": 2` are slower than at one request at a time with either drafter here, because the slot sessions take expert cache on the first card (2,016 -> 1,476 slots). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
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
Niko1221/Strata#5314
No description provided.