Skip to content

residency config #1119: a hyphen typo silently disables the tier, and nothing gates the expert-stream knob reaching its decision #1122

Description

@localai-bot

A fresh review of PR #1119 (head 4f71c69b4, row ENG-RESIDENCY-CONFIG, spec .agents/specs/weight-residency-config.md, implementing #1110) returned FAIL: 2 high, 3 medium, 8 low, and 14 of 69 claims about the code wrong. The mechanism is largely right; these are the load-bearing exceptions.

H1 — a misspelled TOP-LEVEL key is silently ignored, while the header says it is an error

include/vllm/config/weight_residency.h:132-138 claims a typo "is an error". Measured through the product parser:

{"vllm-cpp":{"mmap":{"enabled":true}}}   -> ACCEPTED, empty=1   (NO refusal)
{"VLLM_CPP":{"mmap":{"enabled":true}}}   -> ACCEPTED, empty=1   (NO refusal)
{"vllm_ccp":{...}} / {"vllmcpp":{...}}   -> ACCEPTED, empty=1   (NO refusal)
control {"vllm_cpp":{"mmapp":{...}}}     -> REFUSED: unknown key "vllm_cpp.mmapp"

RejectUnknownKeys enumerates inside vllm_cpp; nothing enumerates the document. The hyphenated spelling is the most likely typo of all, because every CLI flag around it is hyphenated — and it starts a server that does not borrow its weights, which the operator meets as an OOM kill. That is precisely the failure the refusal exists to prevent. tests/vllm/config/test_weight_residency_config.cpp:21 repeats the claim and its refused[] list omits the case, so no gate can see it.

Fix: enumerate the top-level document (refuse anything not in offload_backend/uva/prefetch/vllm_cpp), with a test per spelling — or delete the claim from the header, the test header and docs/USAGE.md:3336 and record the hazard under ## Owed.

M2 — surviving mutation: nothing gates expert_stream.enabled reaching the streaming decision

src/vllm/config/weight_residency.cpp:360-366. Rewiring ResolveExpertStreamRequested to read ActiveWeightResidencyConfig().mmap instead of .expert_stream — same type, adjacent field — leaves all four suites GREEN (config 11/138, reach 5/39, serve 5/55, mixed_slot 1/181), on both heads.

So the headline knob, the one the 370 GiB case exists for, could silently not stream. The pure ExpertStreamRequestedFrom test covers the decision; the wrapper's wiring to the correct field is untested, while the env-name half is covered.

Fix: a dedicated test binary (the latch is process-wide) that installs {expert_stream:true} with no env set and asserts ResolveExpertStreamRequested() == true, as test_weight_residency_reach.cpp:134-168 already does for mmap.

H2 — the public ABI comment for offload_config is now false

include/vllm.h:429-435 still says "ACCEPTED BUT NOT YET ACTED ON … no weight moves yet". After this row the same string also carries vllm_cpp, which does move weights, and test_weight_residency_reach.cpp:170-192 asserts new VLLM_ERR_INVALID_ARGUMENT refusals through vllm_engine_load. A C client is told the field is inert. Violates ## Shared seams and ## Public documents (the C API changed).

M1 — the late-install throw fires on a legitimate two-model process, and its reason is false for 2 of 5 knobs

weight_residency.cpp:236-247. Measured through the public ABI: load model A with no residency config, then load model B whose --offload-config carries vllm_cppmodel B cannot load (rc=2 VLLM_ERR_MODEL_LOAD). The spec justifies this as "the knobs latched during the first load", which is false for mmap (GgufLoadPolicy::FromEnv() runs per load) and for prefault (this change deleted its static). Only expert_stream and the slot store genuinely latch. The header's THE LATCH paragraph still lists prefault's static and claims every knob latches, contradicted by the same header at :200. And test_weight_residency_config.cpp:387 is named "…still allows an install" while its body asserts CHECK_THROWS_AS.

Fix: narrow the refusal to the knobs that latch, or keep it and correct all three sentences plus the test name.

M3 — "the line reports what the engine will use" is false

model_loader.cpp:1284,1292. It prints installed.Describe() — the fields the operator set, not the resolved values. The row's own CASE 5 proves it: with VT_MOE_EXPERT_STREAM=0 it asserts the output contains expert_stream=on while the engine runs it off. Reading the global back is still the correct mechanism (it proves the install ran); only the sentence is wrong. test_serve_residency_config.cpp:51 and :237 state opposite positions.

Low

  • L1 ExtObject hardcodes the vllm_cpp. prefix, so {"vllm_cpp": 5} reports "vllm_cpp.vllm_cpp" must be a JSON object; the test uses CHECK_THROWS_AS only, so the wrong path passes.
  • L2 The relaxed atomic is sound — no config state is published through the flag, so release/acquire is not required — but 5e82f8e04's stated reason ("that call takes the mutex, so it synchronises with nothing weaker") is untrue as written: a mutex acquire does not synchronise-with a relaxed store made outside it. Correct the reason to "install and resolve are never concurrent on any production path", or use release/acquire.
  • L3 ActiveWeightResidencyConfig() returns a reference after releasing the mutex, so resolvers read unsynchronised while the lock gives false assurance (pre-existing).
  • L4 --offload-config is silently dropped on the pooling and transcription entry points (server_main.cpp:946-1001 returns before the parse); not a regression but unrecorded.
  • L5 The config surface does not reach vllm-cli, the binary the same USAGE section uses for the env form, with no note saying why.
  • L6 docs/ENVIRONMENT.md:110-111 enumerate a resolution that is false when a config is present (VT_MOE_EXPERT_STREAM_SLOTS=0 with slots:8000 resolves to 8000, not 64), contradicting the row's own override clause.
  • L7 DescribeEnvOverrides reports presence, so VT_MOE_EXPERT_STREAM_SLOTS=banana is announced as an override although the resolver ignores it — and the comment cites that very fact as a reason not to read the value.
  • L8 EnvOn cited at gguf_keep_quant.cpp:60-65, actually 61-66; the two index rows are inserted three lines from the end of a 329-line file rather than appended.

Cleared, checked

The upstream mirror is byte-identical and include/vllm/config/offload.h is unchanged; the mirrored parser genuinely does not enumerate and its validator reads fields, so a sibling key is invisible to both. Precedence (env > config > default) holds for all five knobs in both directions. The reachability chain through both entry points is pinned. #1109 is genuinely fixed — both doc sites now say on, matching the code, and no "off" statement survives anywhere in docs/ or .agents/.

Gate on the reviewed head: build rc 0 with zero warnings, ctest 504/504 rc 0, all five focused-suite counts matching the implementer's report exactly.

Owning row: ENG-RESIDENCY-CONFIG.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions