Skip to content

dflash: prime the ctx-acc pool at the head's row count (Ripple first-request 500) - #350

Merged
AzeezIsh merged 1 commit into
mainfrom
fix/hip-ripple-ctx-acc-prime
Nov 12, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
fix/hip-ripple-ctx-acc-prime

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Problem

With Ripple-65B + DFlash2 on strix-hip, the first request after boot returned HTTP 500 (Prefill start error: cuMemsetD8Async failed: status 1). Later requests were fine. A bisect on framework (f270) showed it on every commit back to the pre-merge Ripple branch.

Cause

On AMD, the factory pre-allocates one drafter context accumulator before KV sizing. It sized that buffer from ATLAS_DFLASH_CTX_WINDOW, falling back to 4096 rows (209,715,200 B for Ripple). Ripple's DFlash2 mixes sliding and full layers, so its head takes its window from --dflash-window-size and uses 8192 rows at max_seq_len 8192. Request 1 popped the half-size buffer, and acquire_ctx_acc zeroed 8192 rows into it, so HIP returned InvalidValue. That failure path frees the buffer, so request 2 allocated the right size.

Fix

layer_attention::ctx_capacity runs the head's own resolve_context_window, and the prime now uses it. Uniform drafters resolve to the same 4096 as before, so their size is unchanged. Unit test: ctx_capacity(Some(16384), ripple, 8192) == 8192.

Verification

  • framework f273, Ripple + DFlash2 at util 0.97: pool primed at 419,430,400 B (8192 rows), 0 prefill-start errors, request 1 == request 2 (greedy), rustfmt clean.
  • DevLab runner 43113541101: carry check passes probe, json_schema, tools, no-tool and join, with no first-request error. The score leg 422s at MAX_BATCH=1 (one-row arena, a config limit). Runner 43113545907: tok_step 2.62–2.70, the same as before.

🤖 Generated with Claude Code

…request 500)

The factory's early pool prime sized the accumulator from
ATLAS_DFLASH_CTX_WINDOW or 4096, but a drafter that mixes sliding and full
layers (Ripple-65B's DFlash2) resolves its window from --dflash-window-size:
8192 rows at max_seq_len 8192. The first request popped the 4096-row buffer
and acquire_ctx_acc zeroed 8192 rows into it, so HIP returned InvalidValue
("cuMemsetD8Async failed: status 1") and the request 500'd. The failed path
freed the buffer, so later requests allocated the right size and passed.

Share resolve_context_window with the prime through ctx_capacity, so both
size the buffer the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit 96acfcf into main Nov 12, 2026
22 of 27 checks passed
AzeezIsh pushed a commit that referenced this pull request Nov 12, 2026
…-f341)

Campaign against frozen main f3f700a (#343 strict-spec batching + #350/#351
kv_budget/dflash follow-ups). Ten required gates run on two exclusive GB10
boxes; records split b4ee (echolp, ttft x2, ssm, decode-floor, concurrency,
vision, video) / f341 (bfcl-subset, agentic-webserver).

video-fidelity FAILS its gate floor: backend-parity leg — mp4 (32f/8fps)
samples to 16 groups/928 tok while the zero-delay gif fixture lands at 4
groups/244 tok; deterministic divergence between the ffmpeg subprocess and
in-process gif decoders on this tree. Record committed is the earlier
ffmpeg-absent run (7/13 legs, 6 skipped); the full-ffmpeg rerun scored
12/13 and wrote no record because the run ended Failed.

Required manual fixes this campaign needed: libssl-dev + ffmpeg on the
gate boxes, soundfile in the bfcl venv, and a serve-override restoring the
bfcl recipe's shell-quoted default_chat_template_kwargs as raw JSON.
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