Repository navigation
Conversation
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
[Medium impact] The PR appears safe to merge; no new actionable issue was established. SummaryThe model loop now reads fresh input after cadence pacing, so input and resets received during the wait can reach the upcoming step.
All supplied previous threads are resolved and unnumbered, so they receive no numbered finding entries. Tests were not rerun during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Check whether ranks should stop] --> B[Read input and run queued messages]
B --> C[Wait for cadence]
C --> D[Agree preparation is complete]
D --> E[Read fresh input and apply reset]
E --> F[Agree to run the step]
F --> G[Discard earlier generation timing]
G --> H[Run model step]
H --> I[Publish output or keep buffered timing]
Reviews (18) · Last reviewed commit: "Merge main into the contribution branch" · Reviewed by Greptile |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Thanks @ZenAlexa , this is indeed an issue. With our current design, we need to do two paces for the model loop and UI loop. Your PR should address issue with the model pace order But model pace will only happen when BLOCK mode is used in BACKPRESSUE, and happens when model generation is faster than UI rate (which defaults to 60hz), which is rare. |
Keep event collection immediately after model pacing. Restore the terminal lifecycle path for separate follow-up. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
Yep, I agree on keeping this PR tight 👍 One detail I found while tracing it: I’ve trimmed #573 down to the ordering change and one focused regression. The terminal message settlement is a real lifecycle issue with its own boundary, so I’ve taken it out of this PR and will keep that work separate. |
…anup-investigate-the-large-input-to-model-step Signed-off-by: Ziming Wang <zimingwang945@gmail.com> # Conflicts: # flashdreams/flashdreams/api_v2/loop.py
|
Caught up with #548's multi-session lifecycle in The model loop now reads once before cadence for lifecycle and finished-state decisions, then folds in one more event-buffer snapshot after cadence before the step. Queued state messages keep their once-per-model-step ordering. The focused CPU suite passes all 61 tests (•̀ᴗ•́)و |
|
Yep, the race exists on current |
|
The second
|
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
I've synced the cadence fix with current The regression continues to reproduce the stale input on the base branch and passes with the post-wait read. |
|
I checked the post-cadence queue concern against the shutdown contract: queued operations are discarded when the loop closes. Reset events use the event-buffer generation, and session replacement goes through the UI loop. I'm keeping one message snapshot per iteration here. |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
@gtong-nv, the two snapshots now preserve rank-zero input ownership across the current |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Preserve post-pacing input refresh and rank agreement alongside the current client file-selection and UI request lifecycle. Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
…o-model-step Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
|
I rechecked the current head |
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
Signed-off-by: Ziming Wang <zimingwang945@gmail.com>
November 16 mainline integration
Merged
main@5b23817a1eddinto85439c3d3ae8through a normal merge. The three contribution source and test files retain their previous contents. The eight existing skill metadata checks passed. Runtime, GPU and end-to-end latency checks were not rerun for this documentation-only mainline delta. Earlier runtime measurements remain tied to their recorded revisions.Why
Input that arrives during cadence pacing should reach the upcoming model step. A reset during that wait should also select the new generation before the step starts. Addresses #543.
Changes
IProfiler. Discard buffered timing and input samples when the final synchronized generation changes.Merged main
1448d5a1intoc073b056. The profiler callbacks follow the interface added in #634. Shutdown settlement remains outside this change.Current validation (2026-11-01)
Revision
130b4c016211already contains main9d98934d9652, so no additional merge or code change was needed. The post-pacing read, reset generation and distributed readiness agreements retain their existing behavior.On macOS arm64 with Python 3.12.14, PyTorch 2.9.1, NumPy 2.4.6, pytest 9.2.0, aiortc 1.15.0 and aiohttp 3.14.5, the actual V2 runtime and profiler suite passed 546 tests with four tests outside the
ci_cpuselection. No selected cases failed or skipped. The separate existing step-agreement suite passed 19 tests, including two-process Gloo execution. This environment satisfies the exercised dependencies' declared version ranges and differs from the complete Linux lockfile matrix. Scoped Ruff 0.12.7 import-order and formatting checks, Python syntax and contribution whitespace checks passed.GPU generation, native presentation, browser display and end-to-end latency were not rerun. Earlier performance and device evidence retain their recorded revisions.
Earlier validation
On
c073b056, macOS arm64 with Python 3.12.14 and PyTorch 2.14.1:all_reduce.git diff --checkpassed.Earlier isolated CPU measurements
The earlier comparison against main
fd52f1a1used three fresh-process pairs. These measurements were not rerun for the profiler merge.The extra broadcast and readiness reduction cost about 252 µs per step in that isolated CPU run. The fresh read removes one 33.3 ms scheduling interval from the event path. Multi-rank GPU generation and model end-to-end latency remain unmeasured.
Earlier main integration (2026-10-23)
Merged main
cb4f8527into4acae025, retaining the 0.2 release and packaging changes. The contribution implementation is unchanged.On macOS arm64 with Python 3.12.14 and PyTorch 2.9.1, the V2, profiler and two-process Gloo suite completed with 511 passed, one failed and four deselected. The failed step-failure scenario could not write its rank result because the local disk was full, then reached its process deadline. After freeing space, the same scenario passed in 10.16 seconds. The independent source-loaded cadence/reset scenario also consumed the new input at the next step and discarded the old generation’s buffered timing.
GPU generation, native presentation, browser display and end-to-end latency were not rerun. Earlier performance measurements retain their recorded revisions. Contribution whitespace checks passed.
Project CI: Please run the current-head multi-rank GPU generation and model latency checks on the project runners. The CPU cadence, event-buffer, and Gloo agreement results above are ready for review.