mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5171] [Engine] dsv41 0.2.10: under a one-node binding the CPU lane's copy goes into one NUMA part sized by the whole machine's free RAM, leaving that node about 1 GiB free (0.2.9 split it in two) #3075
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#3075
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?
Originally created by @Norhiro on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5171
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On a 2-socket host, with the serve started bound to NUMA node 0 (CPU affinity and
MPOL_BIND, the equivalent ofnumactl --cpunodebind=0 --membind=0), 0.2.10's DeepSeek V4.1 engine copies the whole CPU lane (117 GB) into one part on node 0 (126 GiB). Node 0 is left with about 1 GiB free; node 1 keeps about 100 GiB free. 0.2.9, with the same command and binding, makes 2 parts, one per node.Consequences seen here:
CONSTRAINT_MEMORY_POLICY, nodemask=0), while node 1 had 95.6 GiB free. With ordinary (unbound orMPOL_PREFERRED) memory pressure the engine survived 60 GiB more: that memory spilled to node 1.Expected: either the copy is split across the nodes as in 0.2.9, or the fit check counts only the memory the process may use on its allowed nodes, or the start-up prints a warning when one part is chosen on a multi-node host.
What works (measured, 0.2.10)
MPOL_BIND)MPOL_PREFERRED)--mmap-experts onEach run had 60 GiB of extra memory taken on node 0 by a
MPOL_PREFERREDprocess; none was killed. Unbound, 0.2.10 equals 0.2.9 on varied prompts (6.85 vs 6.95 tok/s, 36 samples each, 95% CI of the ratio 0.88-1.08). So the practical answer is: do not bind.--mmap-experts onunder a binding was the worst choice here (swap full, pressure near oomd's limit during load).Suspected cause (unconfirmed static analysis, src/dsv41/ds4_model.cu)
node_threads()(around line 186) is new in 0.2.10 in dropping CPUs outsidesched_getaffinity; under a node-0 binding it returns node 0 only.nh = min(2, cores.size())(around line 5892), so 1, andnode_map(bytes, 0, 1)does nombind: the copy follows the process policy onto node 0.ram_avail()(around line 226):/proc/meminfoMemAvailable and cgroupmemory.max, not the memory policy orcpuset.mems, so it counts node 1's free memory.mbinds part 1 to node 1 (a VMA policy overrides the task'sMPOL_BIND).A patch, built and tried (against v0.2.10 / main
ffa80d7)The patch is below (src/dsv41/ds4_model.cu only, +75 lines). It does two things:
bound_nodes_avail(): on Linux, when the process may allocate on some nodes only (Mems_allowed_list, or a strictMPOL_BINDfromget_mempolicy), it sums MemFree + Active(file) + Inactive(file) + KReclaimable over those nodes (node meminfo).ram_avail()takes the minimum of that and MemAvailable. Unbound andMPOL_PREFERREDprocesses are unchanged.DS4_COPY_NUMAis unset).Result on this host (one start each, then one request, answered correctly):
fit the RAM this process can get (121.4 GB beside 9 GB for the rest)(before: 252.1 GB), and the new linethe CPU lane's copy goes into 1 NUMA part: this process may run on 1 of the host's 2 NUMA nodes (its CPU affinity), so the copy and its threads stay there; started unbound, it takes 2 parts and both nodes' threads. The 117.7 GB copy still fits 121.4 GB (node 0's reclaimable page cache counts), so it is still taken as one part. The budget is now right, but here it does not change the outcome.So the patch makes the situation visible and the budget honest. Keeping headroom on a bound node would take a policy choice I left to you: a larger margin when bound, counting only MemFree + Inactive(file), or refusing the one-part copy when another node has room. Not run: memory pressure against the patched engine, a start from a cold page cache, Windows or macOS (the new code is Linux-only and returns "no limit" elsewhere).
dsv41-numa-bound-fit.patch (against
ffa80d7)Smallest steps or command that reproduce it
numactl --cpunodebind=0 --membind=0 python serve/server.py --engine strata --config cfg-ds-0210.json, with the config runningbuild/strata-dsv41 --pack <deepseek-v4.1-flash-ist-das-2.00bpw> --max-context 8192 --eos 1 --dspark auto --dspark-conf 0.65(the serve adds--serve --layer-split auto).--mmap-experts auto: ... fit the RAM this process can get (252.1 GB ...)andcopied into RAM (117.0 GB, 1 NUMA part), 6 threads./sys/devices/system/node/node0/meminfoMemFree is about 1 GiB.strata-dsv41at 15-16 GiB.The same with 0.2.9 prints
copied into RAM (117.1 GB, 2 NUMA parts), 12 threads.Reproduction status
Reproduced locally
Strata version
Strata 0.2.10 (
ffa80d7, engine 0.1.56), own AVX build (STRATA_ISA_FLOOR=avx); compared with 0.2.9Graphics card, memory and system
RTX 5060 Ti 16 GB + RTX 3060 12 GB (layer split), 2 x Xeon E5-2630 v2 (AVX only, 2 NUMA nodes x 126 GiB), Fedora 44, kernel 7.2.5, driver 610.57.04, systemd-oomd on
Model, size and settings
DeepSeek V4.1 Flash, IST-DAS 2.00 bpw pack (117 GB on the CPU lane), --max-context 8192, --mmap-experts auto (default)
Logs
0.2.10 under the node-0 binding:
0.2.9, same binding:
Kernel (memory bound to node 0 by another process, node 1 MemFree 95.6 GiB):
systemd-oomd during a 0.2.10 load right after a 0.2.9 run:
@github-actions[bot] commented on GitHub (Nov 4, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 4, 2026):
Thanks, this follows the format now.