Repository navigation
r40-integration: dsv41 runtime + slot-sampler reuse on strix/master - #273
baraxnaxgaming-commits wants to merge 6 commits into
Conversation
(cherry picked from commit e630361)
…tention) from vcruz305 runtime/deepseek41 Ported 5210c7c..runtime/deepseek41 (16 commits, C++ only). One conflict resolved in llama-kv-cache-dsv4.cpp: kept our GGML_TYPE_F16 forcing for the indexer KV cache (fused indexer kernels read f16 only) while taking their V4.1 filter_lid/reuse_lid layer-sharing wiring and ratio_kv. (cherry picked from commit 1815db8)
…builds - llama_context::set_sampler: re-registering the same sampler pointer is now a no-op (graph inputs hold the pointer; backend_init asserts !is_init) - common_sampler_reuse(): in-place re-init when the effective sampling config is unchanged (params equality gate + grammar/rbudget rebuild + reset), keeping the chain pointer stable for graph reuse - server load_task: try sampler reuse before rebuilding; unregister old sampler only on mode flips; slot release no longer unregisters (fixes the double-reserve trap: reset+load cost two sched_reserve passes per request) A/B (stories260K, -bs, identical back-to-back requests): baseline reserves on every request (7 reserve passes), patched reserves only on cold start and on actual param changes (5 total). Identical-request latency 21.5-23.3ms -> 15.1-16.5ms. (cherry picked from commit 81ba428488c3651a158e6a4ec938b11fd8f39013)
deepseek41.cpp relied on unity-batch ordering to see deepseek4.cpp's
dsv4_rope_attn_factor / dsv4_build_state_{restore,snapshot} and the
extern dsv4_view_2d. Adding the file shifts the batch so deepseek4.cpp
and glm5-next.cpp share a TU, where glm5-next's file-static
dsv4_view_2d collides with the extern definition (-fpermissive error).
Declare the shared helpers explicitly in deepseek41.cpp and use a local
dsv41_view_2d copy instead of declaring dsv4_view_2d extern, so the
file compiles in any unity grouping.
deepseek4.cpp's extern dsv4_view_2d and glm5-next.cpp's file-static one collide (-fpermissive) whenever a batch shift puts them in the same TU. Excluding both from unity build makes the grouping deterministic.
glm5-next.cpp has a file-static dsv4_view_2d and includes models.h, so the shared extern declaration collides in every TU (extern declared, static defined). deepseek41.cpp uses its own local copy; deepseek4.cpp defines-before-use. No header declaration is needed.
|
Hi @baraxnaxgaming-commits, thanks for this, and welcome! DeepSeek V4.1 support and cheaper sampler setup are both things we want, so it's great to see them come in. We'd like to land them a bit differently: DeepSeek V4.1: let's take it from upstream. ggml-org/llama.cpp merged V4.1 support in ggml-org#31086, which superseded the vcruz305 branch this PR is ported from (ggml-org#28696). We'd rather bring that in with an upstream sync than carry a separate port, so the two versions don't drift apart. If you want to help, testing V4.1 on Strix Halo once it lands would be really useful. One thing we hit while testing this branch: the change to the layer-reuse check in Could you split these into their own PRs on master?
On measurements: the decode numbers in the description compare two builds of your own branch. Our contributing guide asks for a comparison against the PR's merge-base on master, so for the sampler PR a before/after on master would be ideal. Running the server with backend sampling on would show the effect best, since without it the reserve this PR saves wasn't happening anyway. Thanks again, and happy to help if anything here is unclear. |
|
Thanks for the thorough review — all three points confirmed against the code on my side:
Split as requested:
DeepSeek V4.1: dropped from this PR — will come in with an upstream sync of ggml-org#31086. Happy to test V4.1 on Strix Halo (gfx1151, 128GB) once it lands on master. Measurements: acknowledged on the merge-base comparison — #274/#275 will carry before/after against the PR merge-base on master (backend sampling on for the sampler PR), posted as comments. |
Summary
Rebases the 6 commits from
opt/set-sampler-noreserve-strixonto currentmaster(169 commits, tip Nov 10) — clean rebase, no conflicts.DeepseekV41ForCausalLM), runtime (engram + hyper-connections + sparse attention, from vcruz305runtime/deepseek41), unity-build linkage fixes (shared dsv4 helpers, separate TUs for deepseek4/glm5-next,dsv4_view_2dkept out of models.h)Validation (halo-A, Nov 9)
build 12344 @ 8eeb54cde)-ngl 999 --parallel 1 -c 65536, graphs off, Ornith-1.5-35B-Q8_0 — Q8_0 decode is the path the merged MMVQ/gate-re-base commits touch):