Repository navigation
Prefill one queued request during single-lane ATOM decode - #255
Closed
gspark-etri wants to merge 5 commits into
Closed
gspark-etri wants to merge 5 commits into
gspark-etri wants to merge 5 commits into
Conversation
This was referenced Oct 23, 2026
gspark-etri
added a commit
that referenced
this pull request
Oct 30, 2026
…285) AtomBatcher(remote_prefetch=True) / serve_batched.py --pd-prefetch-next: with a single decode lane and remote-only PD, submit the next queued prompt to the producer while the current request decodes, so its KV is ready when the lane frees. One prefetch at a time; the source slot stays reserved until the owner has imported the KV (also after cancel or producer error). Off by default; rejected unless single-lane, remote-only, with a prefill worker. With a prefix cache the prefetched prompt is re-sent in full and overwrites the restored prefix (correct, but forfeits cache savings). From #255 (3e16c33), code and tests only. Refs #253 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Landed on optimus-rm via #285. Closing; the branch is archived locally (experiment records and evidence included). |
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.
Background
B1 ATOM PD submits the next remote prefill only after its decode lane becomes free. Producer compute is therefore serialized with current-request decode. This draft lets one queued request prefill while that lane decodes, keeping its result reserved until owner-thread KV import completes.
Changes
AtomBatcher(remote_prefetch=True)andserve_batched.py --pd-prefetch-next; restricted to single-lane ATOM remote-only PD, with invalid CLI routes rejected before model loading.Verification
Code3e16c33, based on273952a. CPU fake Rebellions SDK with real tiny-LM TorchPrefillEngine KV and independent greedy outputs; not hardware performance evidence.
remote_prefetchAPI; invalid CLI route reached model loading before the validation was added.opt_prime/:CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=2 MKL_NUM_THREADS=2 PYTHONPATH=. /home/gspark/venvs/pt213/bin/python -m pytest -q: 511passed,34skipped,253subtests,150.28s; one existing unfused flex-attention warning.opt_prime/examples/pd/http_matrix/experiments/2026-10-24-atom-prefetch253.md, logs inevidence253/.Compatibility and limits
B1 remote-only and opt-in; no default promotion. Early requests cannot skip transferring a cached prefix. No within-request layer/chunk export is added (separate#47). Actual KONI RNGD-to-ATOM validation now passes: 48 timed batches, 8 fixed-output groups, 4 normal-EOS groups, cancellation/reuse, producer-exit isolation and new-request/readiness503. Same warm engine, three alternating off/on repeats: c4 throughput gains +40.87% (input128/output32), +25.75% (128/128), +31.57% (8192/32), +23.48% (8192/128); c1 -0.19% to -0.03%. One RNGD + one ATOM, width8192 research producer, B1 decoder, cache off. Completed measured producer host-call intervals overlap other-request decode in36/60 enabled calls versus0/60 disabled; this is not device-kernel tracing. Qwen3-4B now also passes48timed batches,8fixed-output/4EOS groups and the same live cancellation/producer-exit gates. Its c4 median gains are +25.70% (128/32), +41.00% (128/128), +21.20% (8192/32), +33.89% (8192/128); c1 remains near neutral. Qwen3-0.6B also passes48timed batches,8fixed-output/4EOS groups and cancellation/producer-exit checks. Its c4 median gains are +14.61% (128/32), +48.79% (128/128), +9.40% (8192/32), +37.74% (8192/128); c1 -1.20% to +0.05%. Gemma3-1B also passes48timed batches,8fixed-output/4EOS groups and cancellation/producer-exit checks. Its c4 median gains are +14.12% (128/32), +52.71% (128/128), +12.57% (8192/32), +47.87% (8192/128); c1 -0.78% to +1.36%. Allfour models192timed batches now complete. This ATOM-path validation does not resolve separate GPU numerical issue#256; no universal speedup claim. Reproducer atom_pipeline.py and raw evidence253/atom253-koni-a.json are included.
Related Issue
Refs#253; does not close it. Stacked on#250. Keep draft until hardware validation and review; maintainer merges.