Repository navigation
Conversation
| # A default value "None" means a computed default value will be used. | ||
| mem_fraction_static: Optional[float] = None | ||
| max_prefill_tokens: Optional[int] = None | ||
| max_prefill_tokens: int = 16384 |
There was a problem hiding this comment.
@merrymercy I can change this back to None and add some code to automatically compute this value to avoid the OOM. Can you let me know what the best way to compute this value? much thanks!
There was a problem hiding this comment.
this looks good. We will use chunked prefill to solve this ultimately
| for _ in range(global_config.num_continue_decode_steps): | ||
| self.num_generated_tokens += len(self.running_batch.reqs) | ||
| self.total_decoded_tokens += len(self.running_batch.reqs) | ||
| # TODO (min): use cuda events for better timing measurements. |
There was a problem hiding this comment.
do not use cuda events here as we want to measure something more end-to-end
There was a problem hiding this comment.
Sure. cpu time measurement isn't always accurate though. but it is like not a big deal here. I will remove this line.
| return | ||
|
|
||
| # Update batch tensors | ||
| self.decode_forward_ct = (self.decode_forward_ct + 1) % (1 << 30) |
There was a problem hiding this comment.
it is also used somewhere else
There was a problem hiding this comment.
I did NOT remove this. I just moved it into the place where the decode is actually done. Also, I removed the overflow avoidance code since python int are big int and never overflows.
There was a problem hiding this comment.
sorry, I miseed that change. Please move the code back here as we want to keep def forward_step(self): as short as possible. It is the highest level of scheduling so we want to make it short and easy to understand.
| # TODO (min): use cuda events for better timing measurements. | ||
| start_tic = time.time() | ||
| self.forward_decode_batch(self.running_batch) | ||
| self.total_decoding_seconds += time.time() - start_tic |
There was a problem hiding this comment.
we want something more end-to-end, so we do not use this fine-grained measurement.
If you want more fine-grained measurements, you can implement other stats.
There was a problem hiding this comment.
sorry, I am confused. This is not much more finegrained than before. The code before just include time from idle time because calls to the print stats function. This just calls the time a bit more frequently? At least from the screenshot I have added here, the before and after measurement are pretty much the same.
There was a problem hiding this comment.
the old code also includes prefilling time and any possible overhead in the entire loop.
There was a problem hiding this comment.
Understood. I guess I misunderstood the goals here. I think the old code included idle time between request and report low throughput for the first decode call. But I guess it is intended.
I prefer just close this PR since there isn't much left in the PR after this is undone. It is totally OK for me.
…ny traffic Root (R3a, measured boot 1 vs boot 2 of window-flip-0828): _pp_wait_for_dict_readiness decided progress from the SHARED CHAN_DICT posted/consumed counters. CHAN_DICT is one wire demultiplexed by __msg_type__ (admission_decision / proxy / output). Boot 1's livelock froze ALL traffic, the counters froze, the gate fired twice -- loud death. Boot 2's sgl-project#971 fix (correctly) kept the upstream busy posting admission_decision messages, so consumed < posted held at every poll, the gate early-returned every time, and PP2 sailed into the unbounded output receive -- silent wedge, zero firings. A compensator whose trigger condition was supplied by a foreign defect, disarmed by the foreign fix. Fix: per-KIND accounting riding the EXISTING chan axis as a sub-channel (dict|<kind>, KIND_SEP) -- same single writer, same atomic replace, same sweep; no second mechanism. The drains keep the shared wire counter as sole authority (counting kinds separately there would leave unmatched messages behind -- the module docstring reconciles the two questions). Only the readiness gate reads the kind axis, and only after kind_axis_covers proves the sender labels everything it posts; unlabelled traffic degrades the gate to byte-identical pre-sgl-project#974 behaviour. Helpers module-level, not methods: the method form broke the one-name-at-a-time stand-in holders (797: 31 -> 24, measured), now pinned by its own test arm. Tests: test_pp_readiness_per_kind_974.py, 11 arms in-process with two real PhaseFlipCounters (no gloo pair -- Corpse-F structurally unreachable): boot 2's disarm shape red-first (8 failed / 2 passed pre-fix, the 2 being the directions that must not move), healthy-kind progress unchanged, no-upstream still raises, kind-axis mutant re-arms the disarm, sweep covers sub-channel files. 13 baselined modules byte-identical + 14 counter-importers green, count probes OK.
void-relay launched-verdict) into merge/flip-window-0828 Root fix for boot 2's ring wedge: pp_void_relay_launched_verdict stops a retraction-less zero-offer void from travelling to a never-launched rank (unmatched -> stash -> positional mis-consume by the next healthy generation -> one rank's live batch emptied -> ring one message short). Legacy byte-identical when the launched chain is absent. Terrain overlap with sgl-project#973/sgl-project#974 in scheduler_pp_mixin.py reviewed at merge.
…ed chain The merge gate on b3a2a59 surfaced the same interface drift sgl-project#978's own branch repaired once in test_pp_retracted_pass_void_797.py, in two more modules its neighbour set did not include: the event loop now passes launched_chain= to _pp_send_admission_decision (798's recorder stub: TypeError unexpected keyword) and calls _pp_note_launched_chain (631's _Rank: AttributeError -- it takes shipping methods unbound one name at a time). Repairs follow the in-file conventions: 798's recorder accepts and ignores the kwarg exactly as it ignores expects_output (the 797 repair verbatim); 631's _Rank takes the SHIPPING _pp_note_launched_chain unbound like its twelve neighbours -- its own docstring guarantees stand-in tolerance (sgl-project#787). No assertion touched. Solo re-runs: 631 6 passed, 798 7 passed; merge-tip failure set now byte-identical to baseline (the two known test_collective_family_siblings_610 assertions). Named for the sgl-project#978 desk strand, not fixed here: _pp_note_launched_chain as a self.-method repeats the one-name-at-a-time holder-binding class that sgl-project#973 and sgl-project#974 each just converted to module-level functions after measured breakage; third module falls to it here.
fixed the stats for decoding
Before:

After:

Modification
Checklist
pre-commit run --all-filesor other linting tools are used to fix potential lint issues.