Skip to content

Add fail-closed W2 restage safety probes - #6

Open
OmarB97 wants to merge 1 commit into
kacper-daftcode:mainfrom
OmarB97:work/ds4-w2-2-restage-safety
Open

Add fail-closed W2 restage safety probes#6
OmarB97 wants to merge 1 commit into
kacper-daftcode:mainfrom
OmarB97:work/ds4-w2-2-restage-safety

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jul 12, 2026

Copy link
Copy Markdown

Why

The runtime fix needs reproducible fail-closed probes, not only a successful production canary. Reviewers need focused checks for page residency, shard retry behavior, bounded pack construction, cgroup semantics, and cleanup policy.

What changed

  • Adds checkpoint-residency and next-shard retry probes.
  • Adds store and MXFP4 stream-safety suites plus GPU backend assertions.
  • Adds the guarded restage memory watchdog and its focused unit test.
  • Ignores deployment-specific private controller/provenance files while allowing only sanitized public evidence.

How to review

Start with tools/w2_restage_watchdog.py, then inspect tools/test_store_safety.py and the two smaller residency/stream probes. Confirm the watchdog distinguishes the soft memory.high boundary from hard memory.max/host floors and fails closed on incomplete metrics.

Evidence

On the frozen exact image, store safety passed 37/37, MXFP4 stream safety passed 10/10, checkpoint mappings dropped at the intended lifecycle boundaries, and a 48-layer constrained pack build stayed below 2 GiB with no swap or cgroup failure event. The guarded real restage completed all 46 checkpoint shards and 43 expert layers without swap, hard-limit, or OOM events.

Verification

  • python3 -m pytest tools/ds4_eval/tests/test_watchdog.py -q — 3 passed
  • Targeted ruff check and ruff format --check on the new safety tools
  • python3 -m py_compile on all files in this PR
  • git diff --check

Risks / gaps

The GPU/store suites require the baked CUDA environment and are therefore recorded as exact-image evidence rather than rerun by lightweight GitHub CI. tools/test_store_backends.py retains one upstream pre-existing unused local outside this PR's added assertions; no source byte was changed to hide that unrelated lint debt.

Collaborators

  • Omar Baradei — operator and safety policy.
  • Codex — probe implementation, guarded execution, and PR preparation.

the-crypt-keeper pushed a commit to the-crypt-keeper/vLLM-sm89 that referenced this pull request Aug 4, 2026
… in responses

vLLM 0.25.1 renamed the response field to `reasoning` (OpenAI spelling), but
DeepSeek's API and every client honouring their thinking-mode contract read
`reasoning_content`. The block was returned all along under a name nothing
looked for, so agent harnesses silently dropped the model's monologue on every
tool-carrying turn and it re-derived state from scratch.

The request path was never broken -- _normalize_messages_before accepts either
spelling and chat_utils renders both back into the assistant turn. Only the two
response serializers omitted the alias.

Measured on deep-swe (15 tasks, seed 0, mini-swe-agent, identical sampler):

              | before | after | DeepSeek cloud
  PASS        |   2/15 |  7/15 | 7/15
  terminated  |   7/15 | 12/15 | 15/15
  exceptions  |     10 |     3 | 0

Per-step token profile converges on cloud's: 95,521 -> 132,504 input tokens per
step (cloud 136,561) and 854 -> 655 output (cloud 636). The broken arm was
lighter on input because it discarded the monologue, and heavier on output
because the model kept re-deriving what it had already worked out.

Remaining 3 are AgentTimeoutError at 10800s -- wall clock, not crashes.

Patch count 73 -> 75. gen_patches.py --verify and --check both clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant