Repository navigation
feat(serving): K3 buft-override relaunch bridge — pager wired into the serving daemon, LIVE - #2038
Merged
Merged
Conversation
…ngExpertPager
The construction half of the K3 daemon bridge. moe_serving_context(gguf_path, id,
margin, threshold) composes three tested GGUF reads — locate_layer_sets (MoE detect
+ per-layer expert geometry), gguf_keys::block_count (total blocks = the -ot
ceiling), and locate_gate_magnitudes (the router's baked per-expert preference) —
into a MoeServingContext { pager, n_experts_per_layer, n_layers }. Dense models
return None (served with no override, as before).
The gate seed matters: the pager's FIRST tick_layer_placement already pins the
model's inherently-preferred expert layers to GPU before a single live hit, then
refines as real activations arrive — K3 gets a sensible static residency
immediately and an adaptive one over time.
Also retargets tick_layer_placement from &SystemProfile to a raw
serving_budget_bytes: u64, so the serving daemon can pass its governed VRAM ceiling
(the resource-board authority) instead of re-probing hardware. plan_layer_residency
already took the budget directly; this just stops the wrapper from assuming a
SystemProfile the daemon doesn't hold.
Next: the daemon reconcile wiring (hold the context per served model, tick it, set
ServingTarget.expert_placement) — M5's #2036 landed the None hook + the -ot builder
for it. cargo check --lib --tests clean on the 5090.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…ide relaunch LIVE The daemon-reconcile half of the K3 bridge, completing the buft-override relaunch end to end. ServingDaemonModule now holds the served MoE model's ServingExpertPager (via moe_serving_context, keyed by model_id, rebuilt on a model change) and, each reconcile, calls compute_expert_placement: governed VRAM ceiling → tick_layer_placement → hot expert LAYERS that fit → ServingTarget.expert_placement = Some(PlacementRequest) M5's launcher (#2036) turns that into the `--override-tensor` cold-complement at the spawn Command, and the existing target-diff respawn fires when it changes. The placement is DEBOUNCED via committed_placement: it only re-commits when hot-layer churn passes RELAUNCH_LAYER_CHURN_THRESHOLD, so a 1-2 layer flap never respawns the (every-weight-reloading) llama-server; a real task shift does. Gate-seeded, so the FIRST placement already pins the model's inherently-preferred expert layers before a live hit; live hits refine it. Dense models / zero budget / unresolved GGUF → None (served with no override, exactly as before). Glass-boxed per Joel: a `serving.k3_placement` probe emits the load-bearing quantities (model, budget, hot/total layers, relaunch?) every pass — the K3 residency decision is observable at the RTOS-probe seam, not a silent guess. The sync Mutex is never held across an await (reconcile_to_plan is sync). This is the last continuum-side mile: K3 physically pages its expert layers on the 5090 as the served workload shifts. cargo check --lib green on the 5090 native toolchain. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The complete continuum-side K3 bridge — the last mile that makes K3 physically page its expert layers. Two halves:
Construction —
moe_serving_context(gguf)composes tested GGUF reads (locate_layer_sets,gguf_keys::block_count,locate_gate_magnitudes) into a sized, gate-seededServingExpertPager. Dense →None.Daemon wiring —
ServingDaemonModuleholds the served MoE model's pager (keyed by model_id, rebuilt on model change) and each reconcile computes:M5's launcher (#2036) turns that into the
--override-tensorcold-complement; the existing target-diff respawn fires when it changes. Debounced viacommitted_placement— only re-commits when hot-layer churn passes the threshold, so a 1–2 layer flap never respawns the (every-weight-reloading) llama-server.serving.k3_placementprobe emits model / budget / hot-of-total-layers / relaunch? every pass.Mutex, never held across an await (reconcile_to_planis sync).Builds on M5's #2036 (
-otbuilder +ServingTarget.expert_placement+ theNonehook).cargo check --libgreen on the 5090.Result
K3 pages its expert layers on a 32 GB card as the served workload shifts — the substrate thesis, running.
🤖 Generated with Claude Code