Skip to content

Requests that branch from a shared prefix re-prefill it at the default --scheduler-checkpoint-extra-work-fraction (0.05) #292

Closed as not planned

Description

@iein

Problem

At the default --scheduler-checkpoint-extra-work-fraction (0.05), a request that shares a prefix with an earlier request often re-prefills the whole prefix instead of reusing it. On e774a46, the same probes reused the shared 4K-token system prompt.

Setup: four DGX Spark (GB10) hosts, TP4 over --roce-ring, GLM-5.3 Flash FP4-Local core gb10-tp4-202611101725, --scheduler-policy throughput, a fresh server for each run, main 6b68b9b.

Probe (three runs each) Tokens reused at 0.05 Tokens reused at 0.25
Same 4K-token system prompt, different user message 4,010 in two runs, 0 in one about 4,010
Same history, different last user message 0 in all three (1.50 s time to first token) about 4,010

At 0.05, the server reported 11 checkpoints skipped as work_budget and 14 as unknown_cost. At 0.25, once checkpoint costs are learned, time to first token for the branched request drops from 1.46 s to 0.22–0.32 s. The first request on each new prefix takes about 0.3–0.5 s longer, because it captures the checkpoint.

Likely cause

The checkpoint at the end of the shared system prompt does not fit the extra-work budget that 0.05 allows. The scheduler skips it, so later requests have no checkpoint at the branch point to resume from. unknown_cost skips suggest that checkpoints are also skipped before their capture cost has been measured. Neither cause has been isolated.

Not established

  • Whether TP1 or other models are affected.
  • Whether the right fix is a different default fraction or a budget rule that always allows a checkpoint at a shared prefix.
  • Runtimes after 6b68b9b have not been probed.

Related history

This issue first reported a 9–14x slowdown of concurrent requests at the default fraction. Rank zero's scheduler thread spent its time requoting snapshot selections on every commit. #309 fixed that stall, and #296 moves the remaining selection work into checkpoint_planning_scope. The earlier comments on this issue record those measurements.

Activity

  1. iein commented on Nov 14, 2026

    @iein
    ContributorAuthor

    Cause. For one or two snapshot destinations, select_snapshots (helios/src/scheduler/cache_memory.rs) clones a BTreeSet of excluded pages for every candidate pair. service_participants, called from commit, runs outside checkpoint_planning_scope, so this repeats for every prefill capacity.

    Fix: #296 (on 7006928, same selections): count each pair's union by merging the sorted page lists, and open checkpoint_planning_scope in service_participants. A test checks the result against exhaustive search on 2,000 random layouts.

    Same 32-request workload, fresh server, 240 s cap:

    Runtime Wall Completed Optional captures
    7006928 144.4 s 32 5
    with fix, two runs 73.2 s, 73.2 s 32 64

    correct.py passes 544/544, and throughput and time to first token match e774a46.

    Branch reuse needs a larger extra-work fraction. At the default 0.05, a request sharing a 4K-token system prompt with an earlier one reuses at most 9 tokens, because the system-prompt checkpoint doesn't fit the budget. At --scheduler-checkpoint-extra-work-fraction 0.25, after costs warm, it reuses 4,010 tokens (time to first token 1.46 s → 0.22–0.32 s), matching e774a46. The first request on each new prefix pays about 0.3–0.5 s more.

    Not run: other models, TP1.

  2. iein commented on Nov 15, 2026

    @iein
    ContributorAuthor

    Update on main 6b68b9b (includes #309), same setup, default extra-work fraction, fresh server:

    • Stall: fixed by Reduce CPU cost of snapshot selection and eviction quotes #309. The table-lookup group takes 67.9 s and 66.3 s (58.9 s on e774a46), with all 64 endpoint checkpoints captured. Compute checkpoint selections once per service-rate pass #296 now contains only the remaining checkpoint_planning_scope change, which brings it to 59.5–60.0 s.
    • 33K-token prompt extended by 19 tokens: fixed. Time to first token is 0.28 s.
    • Branch reuse of a shared 4K-token system prompt: still lost. Of three probes, a second request with the same system prompt and a different user message reused 4,010 tokens in two and 0 in one. A request with the same history and a different last user message reused 0 tokens in all three (1.50 s time to first token). The server reported 11 work_budget and 14 unknown_cost checkpoint skips. At --scheduler-checkpoint-extra-work-fraction 0.25, both cases reuse about 4,010 tokens.

    I'm narrowing this issue to the branch-reuse loss at the default fraction.

  3. changed the title [-]Optional prefix checkpoints stall TP4 scheduling since #285: distinct-prompt requests run 9–14× slower[/-] [+]Branch reuse of shared prefixes is lost at the default checkpoint extra-work fraction[/+] on Nov 15, 2026
  4. changed the title [-]Branch reuse of shared prefixes is lost at the default checkpoint extra-work fraction[/-] [+]Requests that branch from a shared prefix re-prefill it at the default `--scheduler-checkpoint-extra-work-fraction` (0.05)[/+] on Nov 18, 2026
  5. iein commented on Nov 18, 2026

    @iein
    ContributorAuthor

    Closing. Whether a shared prefix is reused here comes down to the checkpoint work budget, which is a deployment setting. Setting --scheduler-checkpoint-extra-work-fraction 0.25 gives the reuse this workload needs. The stall this issue first reported is fixed by #309, and #296 carries the remaining scope change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions