mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4016] [Engine] dsv41: --numa-experts bands — every NUMA node serves the CPU lane #4879
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#4879
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/4016
Author: @chimpera
Created: 10/24/2026
Status: 🔄 Open
Base:
main← Head:pr/dsv41-numa-bands📝 Commits (1)
b3aaeb7dsv41: --numa-experts bands — every NUMA node serves the CPU lane📊 Changes
4 files changed (+269 additions, -66 deletions)
View changed files
📝
docs/DEEPSEEK41.md(+13 -0)📝
src/dsv41/ds4_main.cpp(+7 -1)📝
src/dsv41/ds4_model.cu(+245 -65)📝
src/dsv41/ds4_model.hpp(+4 -0)📄 Description
Problem and result
On a host with more than two NUMA nodes, the CPU expert lane places its
copied experts on the first two nodes only (the part layout: whole rows of
each matrix a node,
NH = min(2, nodes)), and the other nodes' cores andmemory bandwidth stand idle while routed experts compute. On a 4-node
ThreadRipper, decode runs at 30.2 tok/s with half the machine unused.
With
--numa-experts bands, every 128-row band of every expert matrix isplaced on node
(band + expert) % nodes: the same one copy of the model inRAM, every node's cores and its local memory serving — 44.8 tok/s on the
same host, same day, same configuration (+48%), outputs identical token for
token. The default (
parts) is unchanged;bandsis opt-in and declineswith a note when it cannot serve (one node, n_ff/dim not a multiple of 128
rows, an EXL3 pack).
Related discussion
none (a focused, opt-in performance change with its benchmark; opened straight as a PR per CONTRIBUTING)
Approach
the per-node region is one slot-stride sized for the worst node share
(ceil of bands / nodes), so slot addressing stays pure arithmetic —
band
bof expertesits atregion[(b + e) % NN] + lay[r] + (b / NN) * band bytes. The(b + e)rotation makes one node's bands anarithmetic progression with step NN (position
b / NNfor every expert)and spreads each matrix's remainder bands across nodes.
ones whose bands live on its node (one CAS to skip). The part layout's
dispatch is untouched behind the same
run_nodes.+64 * row_b(whole rows; the up matrix with its own role's row width),pass rows
[0, 64)relative to that base (the kernels walk rows from thebase pointer they are given), and the iq kernels' output pointers are
pre-offset the same way (they index output by the row range's start).
and compares them against the model file, byte for byte.
NH guard uses — so any GGUF mix of expert formats serves.
parts(the default) every stock operand is takenunchanged; the only part-path changes are the dispatch lambda signature
(
(item, pool), pool ignored) and pool count bookkeeping. Docs:docs/DEEPSEEK41.mdgains a "Computers with several NUMA nodes" sectionwith the measured numbers.
Validation
Environment: ThreadRipper Pro 5965WX (4 NUMA nodes, Zen 3, AVX2, 24
threads), RTX 5090 + RTX 3090, CUDA 13.4 (archs 86;120), the official
IQ2_XS 2.25-bpw set. Revision: this branch (single commit on
7dd5cf18).Where two instances ran at once, the second lane's copy was capped
(
DS4_COPY_GB=110) equally on both sides of every comparison.Passed:
cmake -S . -B build-dsv41 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=86;120 -DSTRATA_BUILD_DSV41=ON -DSTRATA_ENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.4/bin/nvcc && cmake --build build-dsv41 -j --target strata-dsv41— clean, on thebare
7dd5cf18+ this commit and inside our patched tree.--numa-expertsunset (parts), RTX 3090, greedyA/B against reference outputs the stock build produced — 4/4 prompts
identical, re-run on the final commit (the 4 prompts and the comparison
command are in the validation log).
--numa-experts bands=2, forced on the 4-node host):boot self-check "256 sampled bands match the model file"; greedy A/B 4/4
identical; decode median 20.7 tok/s (vs 18.4 parts).
--numa-experts bands): boot self-check passes;greedy A/B 4/4 identical; decode median 25.9 tok/s (vs 18.4 parts on the
same card, same cap, same day).
median on this branch (same protocol:
bench.py --rounds 3 --warmup --only mid.txt), outputs bit-identical across the switch (4/4). Anenv-gated build of the same algorithm measured 44.8 the same morning —
both runs cited as measured; the spread is boot-to-boot.
Failed:
Not run:
CMake guard next to
STRATA_BUILD_DSV41; there is no SYCL variant of thelane. Not applicable rather than skipped.
node-count-generic (clamped at 8), but no 6/8-node host was available.
bands=2on this 4-node host exercises the multi-node path at a countthe part layout also serves.
bands=2on 4-nodehardware, which is not the same memory topology.
no EXL3 pack was at hand to show the note.
Limits
part layout already uses both nodes there. What remains is finer-grained
balance (whole 128-row bands vs half-range parts).
layout); it is a tripwire, not a full verification.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.