Repository navigation
Support MLA for DeepSeek-V2 with Triton - step 1 - #905
Conversation
|
@ispobock Nice work! |
Logits diffHF: sglang MLA: Benchmark
main branch + triton kernel: main branch + flashinfer kernel: MLA (this PR): reproduce: Evaluationmmlu average accuracy:
gsm8k accuracy:
reproduce: |
|
Hi @ispobock Very impressive throughput improvement, may you test the eval, such as MMLU and gsm8k, and also do a regression test on Llama 3 8B Instruct with/without FlashInfer? Thanks. |
|
Hi @ispobock You may add |
|
After completing the benchmark and evaluation, we might add a switch to the MLA feature, keeping FlashInfer as the default for now on DeepSeek V2. Currently, even the main branch struggles with running DeepSeek V2 on H100s due to issues with Triton's implementation. #913 We could look into adding weight fusion support in another PR. Special thanks to @ispobock's contribution and @grimoire for previously implementing the MLA version of DeepSeek V2 in LMDeploy PyTorch Engine, which has been incredibly helpful and inspiring. https://github.com/InternLM/lmdeploy/pull/1621/files The initial MLA implementation on Triton significantly outperforms MHA on Triton. We're considering incorporating MLA Attention into FlashInfer moving forward and would appreciate if @ispobock could explore this possibility. Looking forward to an update from @yzh119. Do you have any suggestions? Thanks. @merrymercy @Ying1123 @hnyls2002 @yzh119 |
Benchmark result is updated. |
|
A100 80G |
|
After this commit 94b1578, when we want to use MLA, we should add |
|
A100 80G x8 |
zhyncs
left a comment
There was a problem hiding this comment.
overall LGTM cc @merrymercy @Ying1123 @hnyls2002 @yzh119
|
LGTM. Very nice work!! 🎉 |
|
hold on |
|
@ispobock We may add a regression testing with Llama 3. |
There is an issue when disabling flashinfer, let me fix it. |
ok |
|
Evaluated the average accuracy on mmlu by Llama-3-8B:
DeepSeek-V2-Lite:
|
|
TP cases # flashinfer
python -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V2-lite --disable-radix-cache --trust-remote-code --tp 2
# triton
python -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V2-lite --disable-radix-cache --trust-remote-code --tp 2 --disable-flashinfer
# mla
python -m sglang.launch_server --model-path deepseek-ai/DeepSeek-V2-lite --disable-radix-cache --trust-remote-code --tp 2 --enable-mlapython3 -m sglang.bench_serving --backend sglang
python3 benchmark/mmlu/bench_sglang.py --nsub 10 |
|
Conclusion:
|
|
Great work! I might have some bandwidth to work on flashinfer's MLA next week. |
…, so 411 declines have no verdict Routing from the write-side agent (sgl-project#872) narrowed Posten 0 correctly: the store is healthy, 24277 canonical pages live during the R7 window, and the historic "store is empty" readings probed a path this boot does not use. So the 671 refused walks are a MATCH problem, not a content problem. The question that follows immediately is the one nobody could answer: a walk that matches nothing should fall through to an L3 prefetch, and prefetch was attempted on only 264 of 675 sampled walks. THE OBVIOUS ANSWER IS WRONG, and the code says why. It is tempting to read the 411 as the same MambaComponent refusal declining twice -- one root, two numbers. It is not: * The prefetch anchor IS mamba-gated, but by an aliasing the base contract does not describe. base_prefix_cache.py:201-210 separates `last_host_node` (the L3 prefetch anchor) from `best_match_node` (the validator-consensus L2 anchor) -- two fields, two purposes. UnifiedRadixCache sets them equal under HiCache (unified_radix_cache.py:1443-1449). Deliberate and commented, but it contradicts the field's own documentation, and two fields that are documented different and implemented identical are a drift source (sgl-project#747's shape). Named, not changed here. * Even so, the refusal does NOT decline the prefetch. Total refusal leaves best_match_node at the root, and the caller admits the root on purpose: `locally_eligible = last_host_node.backuped or last_host_node is self.tree_cache.root_node` (scheduler.py:4933-4935). A cold request with no match is supposed to prefetch. The first term holds. * The second term (>= 256 new tokens) holds for agent prompts of thousands. That leaves the rate limiter -- AND THERE THE EVIDENCE STOPS, which is the actual finding. None of the three terms is counted or logged. The 411 declines are silent. Nobody can attribute them from this boot, and no amount of re-reading the log will change that. eligible = (locally_eligible and prefetch_length >= self.prefetch_threshold and not self.cache_controller.prefetch_rate_limited()) Three unrelated verdicts wearing one boolean, remedies in three different files. The sgl-project#914 shape one module over: blame without a defect. So this is an instrument and NOT a policy change. The three terms are the same three, evaluated in the same order, with the same outcome; `eligible` is now `reason is None`, one expression, so the predicate and its explanation cannot drift apart the way sgl-project#747 records these very lineages drifting. The first failing term is named rather than all of them -- a request can trip several, and summing them would double-count exactly as `refused_tokens_by_component` is documented to. Not env-gated, unlike the sgl-project#904 match census. That one builds an object and walks validators a second time, so it pays for itself only when armed. This is one integer increment on a path that already builds a RadixKey and takes a host lock -- and a counter you must remember to arm cannot answer "was it ever tried", which is the whole question. `attempted` is counted alongside the refusals so the denominator is local (sgl-project#873: a denominator reconstructed from another log is how a narrowed candidate set reads as a decomposition), and an unrecorded gate says "no observation" rather than a silent zero (sgl-project#829). HYPOTHESIS, RECORDED AS ONE. prefetch_capacity_limit is `0.5 * mem_pool_host.size` (cache_controller.py:729), and that size is not constant across a phase flip: sgl-project#905 measured the two host tiers at 703472 rows (PP) and 30518 (TP), 23x apart, putting the TP-phase budget near 15259 tokens -- under four prefetches of the 4096 this window actually completed, against 5 concurrent requests per flip. The order of magnitude fits 411/675, and I am deliberately not fitting it exactly: the PP phase has ample budget, so the number cannot come from there alone. If it holds, the same host-tier asymmetry behind sgl-project#905's double-free is also starving the TP-phase prefetch budget -- one defect, two effects, to be checked rather than assumed. The counter decides it on the next boot instead of re-arguing it. RED-FIRST, four mutants, each red, restored green (14 tests): revert to the shipped conjunction (no counter) ......... 4 failed eligible computed twice instead of derived from reason . 2 failed attempts not counted (denominator lost) ................ 2 failed no-observation reported as attempted=0 ................. 1 failed ONE SELF-INFLICTED DEFECT, found and fixed in the same pass, recorded because the form is evidently easy to commit. My first version of test_the_rate_limit_check_is_still_called_at_most_once counted occurrences in the function's RAW source and went red because a PRE-EXISTING comment at :2674 mentions `prefetch_rate_limited()`. That is the sgl-project#908 substring defect -- prose used to reach a verdict about code -- in a test of mine, an hour after I rejected the same form in someone else's patch. Comment lines are now stripped before counting. GATE test/registered/unit/mem_cache serial, CVD="": 3 failed, 1950 passed, 1658 skipped. Both axes agree (summary 3, ANSI-stripped extraction 3). Two are test_acceptance_emitters_758::RefillTiming, baseline-proven pre-existing earlier in this branch; the third is test_pool_invariant_double_owned_912, a concurrently-developed test belonging to sgl-project#912 and untouched by this commit. The sgl-project#904 census suite is green against this change (62 passed together with the sgl-project#913/sgl-project#914/sgl-project#915 suites), which is the regression that matters: note_refused gained an optional third argument and its existing callers must not care.
… suite relit against the sgl-project#856 contract) into the flip train
…ker per abort The abort path is the leading candidate for the rank-local slot divergence behind the PP output-ring wedges, and the code says why itself. `abort_request` carries sgl-project#631 pin 4 verbatim: "an abort applied on one rank before its peers DIVERGES THE REPLICATED LIVE SET mid-flip" -- and the guard that prevents it is conditional, `if window is not None and window.active`. The `phase_flip_abort_window` is activated only on arming and drained after the cutover, so OUTSIDE an armed flip `_abort_request_now` runs directly, on whichever rank processes it, in whichever pass it lands. The hazard is recognised, named, and closed only inside the flip window. THE CHECK COULD NOT BE MADE, WHICH IS THE POINT OF THIS COMMIT. Grepping the three wedge logs for an abort near the onset returns nothing -- and that nothing is worthless. Every marker inside `_abort_request_now` is `logger.debug` and the boots run `log_level='info'`: measured, ZERO DEBUG lines in boot_accept2e0827_0827_0454, boot_accept2e0827b6_0827_0613 and boot_802f_staged1_0822_1716. So "no abort before the wedge" is a LOGGING GAP, not a finding. This is the marker-absence trap sgl-project#843 hit on this same path ("the only refusal marker was a logger.debug on a boot running log_level='info', so it could never appear"), and reporting the null as evidence would have been the second instance. ONE SUMMARY LINE, not the per-request ones. `abort_all` can name the whole live set, so promoting those would trade a blind spot for a flood -- the sgl-project#801 void-streak shape in reverse. This says an abort happened, when, whether the flip window deferred it, and what it targeted, which is everything the discriminator needs to place it against a wedge onset. `deferred` is now read once into a local and used for both the log and the branch, so the line cannot disagree with the path taken. WHAT THE SAME SWEEP DID FIND, recorded because it is real and does NOT support the abort hypothesis: * Boot 1's wedge onset (last progress 05:08:59) is preceded by EIGHT SECONDS by `sgl-project#905 HOST-POOL DOUBLE-FREE about to raise ... 8192 of 8192 index(es) are in range but not allocated, span [3530, 14937]` on all three ranks, and the `[sgl-project#703 flip-writeback]` drain fails with it. Boot-1-specific: zero such lines in boot 6 and zero in 1712. The magnitude is the same 8192 the sgl-project#927 hit prefix carries, on the HOST pool rather than the device one, which is worth linking rather than filing twice. * Specimen 1712 shows a rank-local admission-congruence retraction (`sgl-project#797 PP-ADMISSION pass voided on rank 1 ... told=147456 local=139264`) -- that is the in-loop site, already covered by the void relay whose default sgl-project#801 widened. * So the three wedges do NOT share one proximate cause in these logs, and the single-class assumption should not be carried further without evidence. NO BEHAVIOUR CHANGE. The branch is byte-identical; only the marker is new. Import smoke + wiring check green (the marker precedes both branches, and the branch reads the same `deferred` the line printed).
…asure WHY, with a denominator Boot 29 re-admitted the same four requests nine to thirteen times each and 714 of 771 `#969B READMIT-MATCH` lines carried ` host_hit=0`, so every lap re-prefilled ~33k tokens to buy one output token. The standing user design (Cutover-Full-Reset-Re-Entry, 2026-08-28) is "flip = zero everything, re-admit by HiCache READ" -- which PRESUPPOSES the host/storage copy survives the flip. It does not, and three candidates look identical downstream (an empty prefix_indices): the device tree was dropped and nothing re-read; the host pool was cleared (`sgl-project#905 HOST-POOL CLEAR`, 63 times against 51 flips, emitted one line BEFORE the RESIDENTS RELEASED line that promises the read-through); or the storage tier was never consulted. THE DISCRIMINATOR IS THE CLEAR EPOCH ACROSS TWO CONSULTS OF THE SAME RID, not the tier states at one instant. `clear_between > 0` on an empty match says a host-pool clear fell between that rid's previous consult and this one; `no_clear_between` REFUTES the clear for that observation. The counter-evidence that makes this a measurement rather than a confirmation is already in boot 29: 54 re-admissions DID recover (host_hit=28297) and prefetch_registration does not correlate with recovery (HIT/False=40, HIT/True=17, MISS/False=666, MISS/True=48). DENOMINATOR LAW IN THE SHAPE, not in the memory: every observation increments `seen` and EXACTLY ONE outcome bucket; the tier flags are counted independently beside them so overlapping causes stay visible instead of a decision tree eating them; an unreadable probe increments `probe_unreadable` rather than silently scoring a tier absent. Emission inherits #1058b's lesson rather than re-learning it: wall-clock cadence plus unconditional emission at teardown and on the scheduler's death path, so `seen=0` is a printed measurement ("the consult was never reached on this rank") and not a missing line. REACHABILITY IS NOT ASSUMED: the census sits behind the same SEAM_READMIT_ATTR guard as `#969B READMIT-MATCH`, which emitted 771 lines on boot 29. Present AND populated, argued from a measured line count rather than from the code shape -- the check sgl-project#1059 did not make. MATCHED CHECK for this edit's failure class (an instrument that is wired and never executes, or an emitter gated on an observation count -- both invisible to py_compile and to an import smoke): the census arithmetic is driven directly, asserting one-bucket-per-observation, the clear-epoch discriminator on all three of its states, the unreadable-probe path, the seen=0 print, and a DANGER-DIRECTION MUTANT (drop the per-rid epoch stamp -> every empty match scores clear_unknown and both real buckets stay 0). 6/6 green, and it demonstrated it can fail (first run red on a real assertion bug). ruff clean on the added lines. MEASURE ONLY. Nothing is gated, refused or repaired on this boot. Evidence: /spinning/evidence-665-f1/specimen_1059uw_boot29_prefill_loop/
… (905 double, 1035c stub) Two test stand-ins that the branch's new production contracts outgrew (sgl-project#624/sgl-project#978 stand-in-drift class). Production is the reviewed, accepted contract in both cases and is NOT touched; only the stand-ins move. DRIFT 1 -- the sgl-project#905 census-scheduler double missed the A12.2 cutover clearer. test/registered/scheduler/seam_census_double.py:417 (FaithfulCensusScheduler) binds the REAL Scheduler.readmit_seam_residents, which since the slice-3 fix calls self._clear_prefetch_deferral_for_reissue(population) at python/sglang/srt/managers/scheduler.py:5810 (definition :6292, lifecycle CLEARER (c) in the table at :5969). The double bound the caller but not the helper -> AttributeError, surfacing as "retry() exceed maximum number of retries". Fix: bind BOTH real methods (_clear_prefetch_deferral_for_reissue and the _clear_prefetch_deferral_fields it calls) from the real class, not a no-op. A no-op stand-in would be the W29 direction again: the double would pass a cutover that never cleared, i.e. exactly the defect the clearer exists for. The A12.2 fields are deliberately NOT pre-planted on FaithfulReq -- the real Req does not declare them either (no occurrence in schedule_batch.py); they are planted dynamically by _apply_prefetch_deferral and every reader uses getattr(..., default). Absence is the faithful state. This is the same edit the slice-3 fix already made in the two sibling doubles (test/registered/unit/managers/test_seam_readmission_w31.py:87-89 and test_prefetch_deferral_1068.py:195-197); the 905 double was the one instance missed by that sweep. DRIFT 2 -- the #1035c stub missed the termination protocol. python/sglang/srt/mem_cache/hybrid_cache/hybrid_cache_controller.py:752 reads operation.is_terminated() DIRECTLY (branch commit 846c679, slice 2 fix 4). That override is a FULL replacement of the base probe -- one batch_exists call over the whole span, no per-batch loop -- so the base class's per-batch guard never reaches it, and the class-agnostic getattr form at managers/cache_controller.py:851 is a different pass and does not apply here. The stub at test/registered/unit/mem_cache/test_zero_answer_partition_1035c.py:172 built the operation without the protocol. Fix: the stub answers is_terminated() -> False (a live operation, which is what all four fixtures are about), modelling StorageOperation.is_terminated at managers/cache_controller.py:287. mark_terminate is deliberately NOT added: this path never calls it, and a stub method nothing drives is surface without a contract behind it. hybrid_cache_controller.py:752 is NOT weakened to a getattr. TALLY (hermetic: CUDA_VISIBLE_DEVICES="", PYTHONPATH=<worktree>/python, pytest -q -p no:cacheprovider, per file, run once each) test_seam_census_double_905.py before 6 failed / 14 passed after 0 failed / 20 passed test_zero_answer_partition_1035c.py before 4 failed / 5 passed after 0 failed / 9 passed THE FOUR 905 REDS THAT PRE-DATE THIS BRANCH test_every_resident_is_retracted_readmitted_and_off_the_live_set, test_no_row_belongs_to_nobody_afterwards, test_the_drop_evicted_before_it_ reset, test_the_seam_stamped_its_own_retractions were already RED at the pin 228a66d, so the branch gate counted only the other two as truly new. They go GREEN here with the same stand-in fix and no further edit. Their pin-era cause is therefore not present on this branch: the sgl-project#1068 slice work rewrote the production seam and this suite together (git diff 228a66d..HEAD touches seam_census_double.py +47/-33 and test_seam_census_double_905.py +60), and the clearer binding was the last piece missing. Not carried forward as debt -- the file is 20/20. Checks: both files run once each (above); import smoke of sglang.srt.managers.scheduler and sglang.srt.mem_cache.hybrid_cache.hybrid_cache_controller OK; ruff check and ruff format --check clean on both files. No production file touched.
…dules, decided per file WHY: four modules could not be COLLECTED on this tree, so EVERY gate baseline here ended rc=3 / VERDICT: INCONCLUSIVE -- an automated NEW=0/GONE=0 verdict was structurally impossible, which cost half a verdict cycle on 2026-09-11. The exit code is not the tree's redness: gate_tier2_partitioned.py:614-616 is `if inconclusive and rc == 0: rc = 3`. NOT A SKIP (sgl-project#910): a skip can darken a working test; here it darkens nothing -- there is nothing behind these imports to run -- so it would only make rc=3 permanent under a friendlier name. sgl-project#905's form instead: delete a retired promise with its reason, and leave ONE tripwire that fires the day the mechanism returns and NAMES the arms then owed. DECIDED PER FILE, not in bulk: DELETED test_phase_flip_decode_relay_631.py (7 tests). Its only subject was `phase_flip_resident_carry.reseed_decode_input_relay`, deleted by 069f98c "[sgl-project#969 CUT K] Delete the resident carry: the cutover is a re-entry, not object surgery" -- also standing user design (a flip nulls everything and re-admits through HiCache; object surgery at the cutover is the root class of ~15 boot killers). A retired promise. DELETED test_pp_proxy_stamp_631.py. It bound `SchedulerPPMixin.pp_flip_drain_tensor_dicts` at CLASS-BODY level (:334), which is why it failed at import while test_pp_presence_stash_on_real_wire_800.py, which names the same symbol inside a function, still collects. THE RENAME HYPOTHESIS IS REFUTED: `pp_flip_drain_leftover_dicts` is not the same mechanism under a new name. Its own docstring calls it "CORPSE S DONE CORRECTLY" and records that the old drain was kind-blind and ATE AN OWED OUTPUT (PP1, 07:33:30Z), while the successor demultiplexes first; HANDOFF_656.md:1348 says "Do not re-enable pp_flip_drain_tensor_dicts as written". The promise it carried is held by the successor, which six live test modules already cover, so retiring this file loses no coverage. REWROTE test_phase_flip_spec_seam_631.py: dropped the dead `harvest_resident_batches` import and the THREE tests that drove it, two of them sgl-project#905-shape falsifiers whose counterfactual can no longer be constructed. The seven tests over `_reachable_batches` and `clear_spec_info_for_unspeculated_phase` -- both live -- survive unchanged. REWROTE test_phase_flip_draft_bootstrap_631.py, three separate repairs: (a) dropped the dead `ResidentCarryError` import; (b) retired the cap-refusal test and the two-ceilings-agree pin. The product states the reason itself (phase_flip_draft_bootstrap.py:456-461): the defect-M ceiling is gone with the carry, "a count above the cap can no longer be the signature of a corrupted carried set -- it would just be the load", and BOTH copies of IN_FLIGHT_CHUNKED_ALLOWANCE are gone, so there is no second ceiling to agree with; (c) FIXED FIVE STALE-DOUBLE FAILURES that only appeared once the module could be collected again: `retune_carried_batches_for_phase` enumerates through `_harvest(scheduler)` -> `scheduler._resident_batches()`, which sgl-project#969 moved ONTO the Scheduler (scheduler.py:7040, "eight lines replacing harvest_resident_batches ... 911 LOC"), and this file's SimpleNamespace double predates that move. The double now BINDS THE PRODUCT'S OWN METHOD rather than copying its eight lines: the identity dedupe is load-bearing (running_batch is normally an alias of one slot) and a second copy is free to drift. NO production file was touched -- `_resident_batches` exists and has live callers (phase_flip_runtime.py:941/3765), so this was test drift, not a product defect, and I verified that before editing anything. TRIPWIRE test_1347_retired_631_mechanisms_stay_retired.py, three assertions over the retired mechanisms, each naming the arms owed on red and where to recover them (04cd920). CAN-FAIL PROVEN, four mutants, all fire: re-importable resident carry -> red; the kind-blind drain back on the mixin -> red; the SUCCESSOR also gone -> red (so the file cannot pass by the whole family vanishing, the green-by-vacancy direction); the arming allowance back -> red. MEASURED: 47 tests collect and 47 pass across the two rewritten modules plus the tripwire (before: 0 collected, 4 modules uncollectable, 11 pytest ERROR entries). Running them was not optional -- collection alone would have traded rc=3 for five new GENUINE names.
…oaded increment; follower limit is absolute Boot xsn119 (58e574f), rid eb03bfc5 (Q1 prefix 4316 + ~6.8k appendix -> LONG -> P): P READ THE STORE for the first time on this form -- PP0 '#1028B FETCH CAP kv=4308 claimed=4095 caps={mamba: 4095}', anchor at 4094, 'sgl-project#905 PREFETCH-COMPLETE completed=4095' -- but told carried `prefetch_loaded_tokens_by_reqid` = 4031 (64 pages were already in PP0's host tree from the Q2 miss, loaded = 4095 - 64). PP1 registered [0, 4031): no anchor in range, '#1028B FETCH CAP kv=4030 claimed=0 ... anchors (0, -1)', completed 0, and the named Weg2StoreToldMismatch (told=4031 own_loaded=0) stopped the group -- the refusal worked as designed, the quantity was wrong. Fix: told = the terminated prefetch's COMPLETED PREFIX (sgl-project#1175 `completed_prefetch_tokens` = matched + loaded on the tree that has it; None -> 0), and `_prefetch_kvcache(limit_tokens=)` is an absolute prefix end (`_match_end = min(_match_end, told)`), so every follower registers [0, told) with the anchor inside. Admission compares each rank's completed prefix to told and returns the rank's own loaded increment as the credit. Tests: test_weg2_store_told_1400: 14 passed (two new: told = completed prefix with 64 pre-existing pages; follower refuses on a shorter completed prefix even after loading something).
…tch SGLANG_WEG2_TOLD_PROBE_TREE_KEY, default off) 27B agent boots 0925/0926 (bar1agent 1922/2206, nvfp4bar1agent 2328, bar1final 0145): every P leg cached_tokens=0. PP0's store read found the previous turn's prefix in the arena (sgl-project#1439 ARENA-PRESENT leading_complete= 22934 first_stem=c90c5e64, sgl-project#905 PREFETCH-COMPLETE completed=22934), then the sgl-project#1416 clamp probe asked the same arena with UNIGRAM keys (first_stem=f9ec16cd, leading_complete=0, sgl-project#1035 R13 EMPTY KV PREFIX) and clamped told to 0 (sgl-project#1416 ANCHOR-CLAMP completed=22934 anchored=0) -- sgl-project#1419 caps every rank's match at told, so P re-prefilled the whole prompt. The tree keys bigram (is_eagle / SGLANG_HICACHE_BIGRAM_KEYS, sgl-project#1233: c90c5e64 bigram vs f9ec16cd unigram); the probe passed origin_input_ids[:told] as plain ids. Since xsn171 (first clamp boot) every clamp answered anchored=0. Switch on: RadixKey(ids[:told+bigram], is_bigram=tree.is_eagle), sgl-project#1442 handoff keys substituted like _storage_hit_query. Off: byte-identical. Decision stays on PP0 only (told on the wire), followers unchanged. Tests: test_weg2_store_told_1400.py 24 passed (+5: off reproduces the 0, on keeps told, on still clamps beyond the leading run, unigram tree unchanged, handoff keys). UNIFY (UN6, Operator 26.09. Vorrang): pick of desk/27b-pprefix-0926 (4d216bb, PX) onto the unified head, clean. Modellneutral (NF MTP bigram alike), switch default off. dup_defs_gate vs 27b-rc9-103712cdb2 + nf-rc2.1l-d1c7094ba6: 0 new. test27b.sh: test_weg2_store_told_1400.py 24 passed.
…very shared/deep virtual page a target forward writes must be owned and published on the GPU map; CPU test Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ast the new reservation on publication (sgl-project#905) A just-finished request's extra verify under the overlap scheduler can write deep KV past its reservation; those entries still pointed at an earlier occupant's released private pages whose physical units now belong to other pages, corrupting a cached prefix's Scheme-C latent row ('malformed TP gap8 stream before scatter'). Point the tail at private page 0 (never reserved; physical unit 0 is the padding sink). CPU test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checks every settle member; the termination collective carries the rid NF h18 fe799c4 died twice on D with a gloo collective mismatch (16:23:24Z "8 vs 4", boot ..._1014_161406; 16:38:56Z "16 vs 4", boot ..._1014_162636). Same chain both times: - a read record differs by rank under the Form A END vote (TP0's span base 0, the workers' 19008/67584: TP0 'matched=0 completed_synced=0' vs '19072'), so _1471_short (from the rank's own record) is set on TP0 only; - the sgl-project#1471 settle tick: '#1471w SETTLE-WRITER rid=weg2-10-28 (6-68) ... action=reread' on TP0 ONLY, the next tick TP0's action is 'decide' -- and loop 1 skipped _refetch (the progress check's collectives: can_terminate_prefetch MAX, the reap MIN) for a decide/wait member; - TP0's next collective was the next member's while the workers checked the skipped one: TP0 'sgl-project#905 ... req=weg2-12-29 completed=96256 min_synced=62848' (the workers' 10-28 number), TP1/TP2 'req=weg2-10-28 completed=62848'; in death 2 TP1/TP2 6-68 (94336/67584) vs TP0 10-71 (67584/67584) -- two rids in one collective. TP0 deferred and re-issued alone, its prefetch thread ran an operation the workers did not, the claim reduces met with different sizes. STORE-HELD-DECIDE ruled out: it decides on the reduced END and the absolute deliverable, the W88-REROUTE lines of death 1 (store_held=62848 / 95680, cycles=2 bound=1) are identical on all three ranks, death 2 has no fallback in its window; pinned below on the Form A END harness. (2) SETTLE-UNIFORM-1014 (SGLANG_WEG2_SETTLE_UNIFORM_CHECK, default on): loop 1 of the settle tick runs _refetch(req, now, allow_reissue=False) for every non-capwait member on every rank; the rank-local writer action shapes only the vote (_pre/_dec), never whether a collective is entered. A wait member is checked, never re-read. Off: the old skip. (3) PREFETCH-RID-NET-1014 (SGLANG_WEG2_PREFETCH_RID_NET, default on): can_terminate_prefetch carries the rid's fingerprint (crc32, 30 bit) as h and -h in the same MAX (5 slots on every rank). max != min = the ranks stand at different rids; every rank sees it alike, answers 'not done' and logs PREFETCH-RID-MISMATCH -- nothing reaped, no rid's numbers mixed into another, no one-sided DEFERRED/re-issue, no gloo abort. Off: the 3-slot form. Tests (pytest_gedeckelt.sh, no GPU): test_weg2_h18_settle_uniform_rid_net_1014 (new, 11): the h18 tick on three ranks with TP0 'decide' / workers 'poll' runs the same progress checks; RANK-EQUALITY MUTANT: the switch off (the h18 code) splits the ranks (TP0 first at 12-29); a wait member is checked but not re-read; defaults on; the net: same rid terminates, the h18 pairing (12-29 vs 10-28) is 'not done' and named on both sides, net off cannot see it, the fingerprint is stable; STORE-HELD-DECIDE on the real drain chain with the metal's Form A bases answers alike on every rank on every pass, its mutant on completed_local splits them. Regression (42 files touching the settle, the progress check, the store-short drain): 409 passed + the 2 adapted pins (xsn296 window 6000 -> 9000, h45 termination tensor len 3 -> 5): 28 passed. 9 failures (test_prefetch_progress_symmetry_580 x8, test_allreduce_admission_pin_1537 p5) are red at the base 82263ce as well, not touched.
…every rank checks every settle member; a rid mismatch at the termination collective stops the group by name Cherry-pick of 5456b18 onto h16 (a2cfc77), with the net changed to the user law raenge-nie-uneins-crash-stop (29.08.: a detected rank disagreement is a CRASH/STOP, never a 'not done' and on). The h18 chain (NF fe799c4, D 16:23:24Z "8 vs 4", 16:38:56Z "16 vs 4"): a read record differs by rank under the Form A END vote, _1471_short is set on TP0 only, '#1471w SETTLE-WRITER ... action=reread' on TP0 only, next tick 'decide' -- and loop 1 of the settle tick skipped _refetch (the progress check's collectives) for a decide/wait member; TP0's next collective met the workers' skipped rid (TP0 'sgl-project#905 ... req=weg2-12-29 ... min_synced=62848' vs TP1/TP2 'req=weg2-10-28'), TP0 deferred and re-issued alone, the prefetch threads fell out of step. The path exists unchanged on h16 (span bases, _zero/_1471_short, settle writer, the decide skip). SETTLE-UNIFORM-1014 (SGLANG_WEG2_SETTLE_UNIFORM_CHECK, default on): every rank runs the progress check for every non-capwait settle member; the rank-local action shapes only the vote. PREFETCH-RID-NET-1014 (SGLANG_WEG2_PREFETCH_RID_NET, default on): can_terminate_prefetch carries the rid's fingerprint (crc32 30 bit, h and -h in the same MAX; 5 slots on every rank). max != min is seen alike on every rank: every rank raises PrefetchRidMismatch (a RuntimeError) 'PREFETCH-RID-MISMATCH rids=[local=... h=... group_max_h=... group_min_h=...]' -- the group stops by name. The settle's five 'the hold must never die on a top-up' handlers re-raise it (_prefetch_rid_stop()), so it is never swallowed into 'complete'. Tests (pytest_gedeckelt.sh, no GPU, on h16): test_weg2_h18_settle_uniform_rid_net_1014: the h18 tick on three ranks runs the same checks; RANK-EQUALITY MUTANT (switch off = the h18 code) splits the ranks; wait checked, not re-read; the net: same rid terminates, the h18 pairing raises the named stop on both sides, net off cannot see it, the settle handlers re-raise it, a stop raised inside the settle tick escapes; the two STORE-HELD-DECIDE cases skip (not on this line) + the two adapted pins (xsn296 window, h45 tensor len 5): 28 passed, 2 skipped.
Motivation
MLA implementation.
Modification