Skip to content

perf(deepseek): prompt spans, a lent-slot fix and Strata 0.2.6 on one host - #143

Merged
iamwavecut merged 3 commits into
masterfrom
dev/deepseek-same-host
Oct 25, 2026
Merged

iamwavecut merged 3 commits into
masterfrom
dev/deepseek-same-host

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

DeepSeek-V4.1-Flash prefills in prompt spans, the shared expert delivery no longer lets a miss overwrite a lent slot its own call reads, and the docs compare NInfer with Strata's latest release on one host.

Changes

  • Prompt spans (DeepSeek-V4.1-Flash, host and disk experts). Every chunk of a span of up to 16,384 tokens passes a block before any passes the next, so each block's bank is filled once per span. Beside the elastic expert cache the span borrows its 1,323 MiB of buffers from the cache while it runs; a span the cache cannot lend them to runs chunk by chunk. With a fixed --expert-cache-mib the buffers stay in the workspace.
  • Bank prefetch. Only wide calls in a row to two layers set a layer's successor, so a span's repeated calls to one layer and the narrow calls between prompts keep the prefetch order.
  • Lent-slot race (all families on core/expert_delivery: DeepSeek-V4.1-Flash, Gemma 4, Flint, native Qwen3.5 MoE). A round candidate that a narrow call routed from a lent slot moved to its cache slot while that call was served; a miss of the same call could then take the freed slot and overwrite it before the call's cached pairs read it. Such candidates now land at a later call.
  • Docs. Strata 0.2.6 (strata-dsv41 0.1.51) and NInfer on one RTX 4090 host, spans, 16 GB (RTX 4090 held to 16 GB and a Tesla V100), README What's New, performance and GPU tables.

Verification

RTX 4090 (Vast, 2x EPYC engineering samples, 409 GiB RAM, driver 615.71, CUDA 13 build):

  • ninfer_expert_delivery_test: all 25 cases pass with host and disk sources. The new lent landing case fails without the fix (229,184 wrong values, host and disk) and passes with it.
  • Run-to-run equality of an 8,086-token prompt after a short request, greedy, 32 answer tokens, compared with a fresh server:
    • before the fix: release (chunk by chunk) 3 of 3 servers differed, by 0.021 to 0.024 at tokens 28 and 29; fixed --expert-cache-mib 8150 (spans of 4,096) 3 of 3 differed, by 0.0004 to 0.021; default cache (spans of 16,384) 3 of 3 equal. Tokens were equal in every run.
    • after the fix: fixed cache 4 of 4 equal (max |d| 0), default cache 2 of 2 equal, short answers equal.
  • Speed after the fix, default cache, one server each: 25.9 and 26.0 tok/s decode on the short answer, 22.3 and 22.2 after 8,086 tokens, 923.8 and 923.9 tok/s prefill (before: 26.0/25.9, 22.2/22.1, 926/925).

Not verified

  • Gemma 4, Flint and native Qwen3.5 MoE share the delivery change, but no model run of theirs was made; only the delivery test covers them.
  • The successor-rule change's effect on those families' prefetch is unmeasured.
  • The span fallback (cache cannot lend the buffers) did not occur in any run.
  • No real 16 GB card: the 16 GB rows come from a process holding the rest of an RTX 4090 and a V100-32GB.

A wide call sets the next layer's successor only after another wide call,
so a prompt span's repeated calls to one layer and the narrow calls between
prompts no longer clear the bank prefetch.

A round candidate that a narrow call routes from a lent slot moved to its
cache slot while the call was served, and a miss of the same call could take
the freed lent slot and overwrite it before the call's cached pairs read it.
Such candidates now land at a later call. The lent_landing test reproduces
the overwrite without the fix.
With host or disk experts, every chunk of a span of up to 16,384 tokens
passes a block before any passes the next, so each block's experts cross the
bus once per span. Beside the elastic expert cache the span borrows its
buffers from the cache while it runs; a span the cache cannot lend them to
runs chunk by chunk.
@iamwavecut
iamwavecut merged commit a53a4f3 into master Oct 25, 2026
1 check failed
@iamwavecut
iamwavecut deleted the dev/deepseek-same-host branch October 26, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant