mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5472] [Engine] DeepSeek on a DGX Spark: STRATA_DS4_DISK_SKIP_RANK / PROMPT_SKIP_RANK, a store miss left out by its pick rank (opt-in, changes the answers) #5442
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5442
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5472
Author: @R-Okauchi
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:dsv41-skip-rank📝 Commits (10+)
5ed6371DeepSeek engine: on a GPU that shares the PC's memory, read the store's slots in placecab3efbDeepSeek engine: DS4_UMA_TIER, one expert tier on a GPU that shares the PC's memory61d016fDeepSeek engine: under DS4_UMA_TIER, the store's context room from measurements, and chunks it can give back87c6762DeepSeek engine: the RAM store's slots in classes, one a blob size4800c84DeepSeek engine: the prompt path reads the RAM store's experts where they lied68d5e9DeepSeek engine: a long prompt's layer-major buffers take RAM back from the store first12b6129DeepSeek engine: a store the GPU maps grows back only at store_watch, never on the read path4b63d7eDeepSeek engine: DS4_UMA_TIER in CUDA builds onlya8759adDeepSeek engine: STRATA_DS4_DISK_SKIP_RANK, the SSD skip by rank (opt-in)d6eb1a7DeepSeek engine: STRATA_DS4_DISK_SKIP_RANK reads the experts it leaves out in behind📊 Changes
9 files changed (+650 additions, -142 deletions)
View changed files
📝
include/strata/dsv41/exl3.hpp(+3 -0)📝
src/dsv41/ds4_gguf.cu(+7 -3)📝
src/dsv41/ds4_iq.cu(+4 -4)📝
src/dsv41/ds4_iq.cuh(+1 -0)📝
src/dsv41/ds4_kernels.cu(+34 -0)📝
src/dsv41/ds4_kernels.cuh(+11 -0)📝
src/dsv41/ds4_model.cu(+317 -45)📝
src/dsv41/ds4_store.hpp(+272 -89)📝
src/dsv41/ds4_tq.cu(+1 -1)📄 Description
Problem and result
With #5453's tier on a DGX Spark, a decoded token still waits for the experts that are in neither the RAM store nor
the page cache. The CPU lane reads them from the SSD and computes them: in the runs below that was 8.1-8.5 misses a
token, and 9.9-10.5 ms a token spent waiting. main's
STRATA_DS4_DISK_SKIP_Wcan leave such experts out by routeweight.
This PR adds a narrower rule, by the router's pick order. It is opt-in, experimental, and changes the answers:
STRATA_DS4_DISK_SKIP_RANK=R(decode): an expert in neither the page cache nor the store is left out when no token ofthe window picked it among its first R picks. Its route weight is lost, as with
DISK_SKIP_W. Its read is queuedbehind the demand reads, so the store learns what the answer uses.
STRATA_DS4_SKIP_PREFETCH_RANK=Nqueues only thosethat some token picked among its first N.
STRATA_DS4_PROMPT_SKIP_RANK=R(prompt): the same rule on the chunked prompt path.With R = 2 for both on top of #5453's tier, #5170's command was faster:
On a server, 480 MMLU questions gave 386 right with the rule against 390 without, which is not a measurable difference
(paired p = 0.45).
Related discussion
#5170. There is no scope agreement yet, so this is a draft.
This PR is stacked on #5453 (also a draft). Its first eight commits are #5453's, and this PR's own are the last four.
The prompt rule needs #5453's in-place prompt flow.
Approach
STRATA_DS4_DISK_SKIP_RANK=R): for each expert the window's routing picked that is in neither thepage cache nor the store, its best rank over the window's tokens decides. If that rank is worse than R, the expert is
left out. Otherwise it is read as before.
never reached the store and stayed a miss. Over an agent benchmark on a GB10 server, the CPU lane's share of the
experts then grew from 5% to 20%.
STRATA_DS4_SKIP_PREFETCH_RANK=N(default: all, as before; 0: none). With R = 2 on a GB10 over 256 decoded tokens,3,107 experts were read behind. 795 of them were used before their slots were taken again, and 1,972 were given up.
Together they were about 100 of the 117 MB a token the SSD read.
STRATA_DS4_PROMPT_SKIP_RANK=R) works on a chunk:One that is in neither the RAM store nor the page cache, and that no token of the chunk picked among its first R,
is not read.
are 0. Its route weights go to 0 before the layer's batches combine.
best_rankfinds each expert's best pick on the device, with the bounds, andzero_picksclears the weights onthe stream the batches run on. The prompt's stream line counts the experts left out.
Compatibility: all three variables are unset by default, and then nothing changes.
Validation
On one DGX Spark (GB10, 128 GB, driver 580.178.04, CUDA 13.0.2 in an Ubuntu 24.04 container, nothing else on the GPU),
with #5170's IQ2_XS pack. #5453's head (
4b63d7e5) and this branch were built from source the same way, withspark/build_engine.sh's flags (sm_121 plus PTX). The command is #5170's, after the same 1,308-token chat prompt,greedy:
Passed:
The runs, in the order they ran. "The rule" is
STRATA_DS4_DISK_SKIP_RANK=2 STRATA_DS4_PROMPT_SKIP_RANK=2, and thedrafter's runs add
--dspark auto --dspark-conf 0.65:"Left out" counts the decode rule's experts a token. The last column is the CPU lane's wait for the store's misses.
The answers, on the same Spark, from Strata's server with a branch that carries #5453's tier, this PR's rules and
other changes:
DS4_UMA_TIER=1 STRATA_DS4_DSPARK_CUM=0.3 DS4_UMA_CTX_GB=3 STRATA_DS4_SKIP_PREFETCH_RANK=2and--dspark-depth 3. The two sides differed only inSTRATA_DS4_DISK_SKIP_RANK=2 STRATA_DS4_PROMPT_SKIP_RANK=2.without the rule and 386 with it. 10 were right only without it and 6 only with it (exact McNemar p = 0.45). On
moral_scenarios the split was 154 against 150 (8 : 4, p = 0.39), and on the other subjects 236 against 236
(2 : 2).
in answer, greedy. Over the seven turns after the first, the first token came at a median of 2.71 s without the
rule and 2.21 s with it. The decode ran at 27.8 and 31.8 tok/s.
Builds of the head:
spark/build_engine.sh's flags, on the Spark:strata-dsv41builds. It is the binaryabove.
tools/dsv41/build_hip_linux.sh strata-dsv41 ds4_iq_testbuilds both.metal/with metal-cpp, targetstrata_ds4, builds.Failed: none observed.
Not run:
--mmap-experts off.Limits
the set: measured on one GB10 with two IQ2_XS sets.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.