fix(mocker): stabilize replay KVBM ordering [DYN-3850] - #12326
Conversation
Signed-off-by: PeaBrane <yanrpei@gmail.com>
|
👋 Hi PeaBrane! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
WalkthroughChangesThe pipeline gains an optional ordered transfer-start mechanism using chained asynchronous signals. Replay-bench builds enable this behavior and sort G2 router events by sequence hash for deterministic ordering. A test verifies transfer starts follow batch order despite task scheduling. Replay determinism
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
|
🎯 Code Coverage (details) 🔗 Commit SHA: ae41f05 | Docs | Datadog PR Page | Give us feedback! |
|
/ok test c4a7067 |
|
/ok to test c4a7067 |
Signed-off-by: PeaBrane <yanrpei@gmail.com>
|
/ok to test f40bc61 |
|
/ok to test ae41f05 |
Summary
ordered_transfer_startspipeline mode that preserves batch-input order through synchronous transfer reservation/publicationreplay-benchreplay-benchthrough the Python binding crate for high-level replay buildsProduction behavior is unchanged by default:
ordered_transfer_startsdefaults tofalse, and the mocker enables it only behind the existing replay feature.Root cause
An intermittent vLLM-disaggregated replay mismatch shifted a subset of decode-admit, destination-activation, and terminal timestamps by exact 0.123076 ms increments. Event-level instrumentation showed that Tokio could schedule same-batch G1→G2 tasks in different reservation orders (for example
32,32,32,29versus32,29,32,32). That changed which block group completed first and, independently, same-timestamp lifecycle publication could assign router-event IDs in executor order.The fix orders only the synchronous reservation start and replay router-event publication. It does not serialize transfer completion or the data path.
Validation
cargo fmt --all -- --checkcargo test -p kvbm-engine --no-default-features ordered_transfer_starts_ignore_task_schedule_ordercargo test -p dynamo-mocker --features replay-bench,kvbm-offload g1_to_g2_completion_feeds_g3_with_presence_policycleanlint/format matrix passed forlib/kvbm-engine,lib/mocker, andlib/bindings/python3bbd0fe36efb8ddfe1af7fceae1c6ab3357fcf9d5aebb3c5b1ae2a2a4cebb98b)9f7c4c2f027b30df6b95e14db6d6603f904284625849eb68c35e730f7e23ae90)f0fef647a549713ec261fdc4ff558478caaf78001042f1c5bb933b8f7774f40e)Summary by CodeRabbit