mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4286] [Engine] add opt-in huge-page backing to DeepSeek's registered RAM store #4986
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#4986
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/4286
Author: @yhfgyyf
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:codex/dsv41-block-pinned-hugepages📝 Commits (1)
c10a381[Engine] add opt-in huge pages for the DeepSeek registered RAM store📊 Changes
11 files changed (+918 additions, -9 deletions)
View changed files
📝
CMakeLists.txt(+6 -0)📝
docs/DEEPSEEK41.md(+9 -0)➕
docs/benchmarks/dsv41-pcie-20261021/README.md(+138 -0)➕
docs/benchmarks/dsv41-pcie-20261021/historical_transfer.cpp(+121 -0)➕
docs/benchmarks/dsv41-pcie-20261021/measurements.csv(+25 -0)➕
docs/benchmarks/dsv41-pcie-20261021/provenance.json(+316 -0)➕
docs/benchmarks/dsv41-pcie-20261021/recompute.py(+31 -0)📝
src/dsv41/ds4_model.cu(+7 -0)📝
src/dsv41/ds4_store.hpp(+33 -9)➕
src/dsv41/ds4_store_pages.hpp(+77 -0)➕
tests/dsv41/store_pages_test.cpp(+155 -0)📄 Description
Problem and result
The DeepSeek RAM store already registers host-memory chunks for its optional GPU zero-copy path. Its original allocator does not align those chunks to 2 MiB or request and fault huge pages before registration. This allocator observation comes from source inspection of
4b9e05a2; it is not a claim of a reproduced upstream regression.This change adds opt-in huge-page backing on Linux CUDA, preserves the default path, and accounts for padding in the existing RAM budget. On the submitted revision, a same-day IQ2_XS comparison of the original 64-slot chunks against 40 aligned chunks with 100% THP measured decode 13.64 → 17.17 token/s (+25.84%). Prefill was effectively unchanged: 1046.44 → 1050.65 token/s (+0.40%). These are results for the combined tested configuration, not a claim that the page-size option alone gives this gain.
Related discussion
Open and closed issues/PRs were searched before submission. #4123 covers the broader DeepSeek/Maya engine update; this PR remains limited to the existing RAM-store allocator. No maintainer scope agreement is claimed, and no default changes or broader port are included.
Approach
MADV_HUGEPAGE, and fault it before the existing CUDA registration callback.DS4_STORE_ZC=1 DS4_STORE_HUGE_PAGES=1; the option is off by default. The measured 40-chunk model configuration also usedDS4_STORE_CHUNK_SLOTS=256.Validation
Tested head:
c10a381ed169a651b1b565d9eeaf385606136797; parent/control build:4b9e05a2a806a3fe24f7b2560d98626c37dade35. Both used llama.cpp3cf03257f219afbe7334045ff7c6a06ac68c627d. The 4,958 head source files and 4,951 parent source files were checked against the local manifests before testing.Host: RTX PRO 6000 Blackwell 96 GB, active PCIe 5.0 x16, i7-14700KF, 192 GB RAM, Linux 6.8.0-138, NVIDIA 595.104.02, CUDA 13.2.51, GCC 11.4. No inference service or toolchain download ran alongside the measured GPU processes. The original service was restored afterward.
Passed
sm_120: completestrata-dsv41builds for head and parent; CTest passed. The head binary SHA256 was2319c76b2e7d56d8ef77e209500a067aca244a5b496802760c324569bc2ddf6b.gfx1201: completestrata-dsv41build and CTest passed with isolated ROCm7.10.0a20251120, AMD Clang 22.0.0git and GCC 11 headers. Binary SHA256:ff2dffeb0928258453dacf02810c276940c82f65273eee7906514f5079c8c4b9. Initial compiler detection selected an incomplete GCC 12 header tree; explicitly selecting the installed GCC 11 resolved that configuration failure. No production-source change was needed.zc_stage, and CUDA H2D readback: 3,493,601,280 checked bytes per mode, zero differences. Separate 1 GiB and 4 GiB synthetic arenas passed full CPU/SM/CE byte comparisons in both modes.Unprofiled model comparison
Only DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ2_XS and its paired Engram table were used. Fixed LongSWE input: 16,179 tokens; fixed output: 512 tokens; greedy seed 1234; chunk/window 8192; context 32768; DSpark/vision off; 16 CPU threads; uniform initial expert profile; prefix reuse and VRAM expert exchange off. Explicit
--vram-experts 0.5produced the same 4,693 VRAM experts and 45.65 GB expert allocation in every run. Both arms had the same 10,240 RAM slots and 116.518 GB budget.Control A used the existing 64-slot chunks and ordinary pages (160 registration chunks). Candidate B used 256-slot chunks (40 registrations) and verified 100% THP. All other arguments and environment settings were fixed, including
DS4_STORE_ZC=1,DS4_STORE_ZC_FRAC=100,DS4_STORE_PREGROW=1,DS4_STORE_RESERVE=0,DS4_STORE_BG=0,DS4_STORE_PRELOAD=1, andDS4_NO_EOS=1.One A warmup was excluded, then ABBA ran without a profiler or logits dump:
The summary divides fixed work by each arm's mean phase time. Decode counts 511 post-prefill steps for 512 outputs. All four generated token sequences were identical. B2 had two store evictions versus zero in the other runs, and slightly more demand reads; this difference is retained rather than claiming identical cache events. No failed store reads occurred. GPU-active samples were PCIe 5.0 x16; no unrelated GPU compute process appeared.
Failed / unresolved
Not run
Limits
The option stays off by default. Results cover one host, input and expert-memory configuration; the small prefill change is not evidence of a meaningful prefill improvement. THP advice is not a guarantee, and the runtime's chunk count is configurable rather than always 40. Existing historical byte-integrity failures remain unresolved.
The historical 2026-10-21 copy measurements included in this PR came from a separate experimental engine and remain separate from the current results. Their 24 timing rows, hashes and arithmetic were recomputed successfully. Historical data, provenance and limitations.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.