tt: fix offloading-connector store-job assert that killed TT prod (#393) #394
No reviewers
Labels
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack!394
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/inc393-offload-assert"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A request aborted during chunked prefill can kill TT EngineCore while the host-tier connector builds store jobs. The fix caps finished-request offloads at computed tokens and skips/logs/counts any remaining malformed request store attempt before reserving host slots.
Root cause and evidence
The image recipe pins TT plugin
bef89e429e202caa38d3e3c8a24da4e8cc02405a, whose installer selects vLLM 0.26.0. Fetched the exact offloading scheduler from tag commit568afb3a13806beb53bb2e6bd518269357b237c0; its line 975 matches the reported assertion.vLLM collects hashes for the entire prompt but allocates device blocks only for admitted chunks. On finish (including abort),
_build_store_jobsusesreq.num_tokensas if the entire prompt had been computed. For a 6,144-token prompt aborted after one 2,048-token chunk, the remaining key slice contains two entries and the block slice contains zero.offload_prompt_onlycaps at the full prompt, so it does not prevent the mismatch.This mechanism is reproduced with the actual pinned upstream scheduler/connector definitions. The specific production trigger remains a hypothesis: the brief contains no offending request-state dump, and the supplied crash.log is empty. The report distinguishes the reproduced defect from an unconfirmed abort/disconnect attribution and provides file:line evidence for the full chain.
Change
vllm:kv_offload_store_skipped_mismatch_total, with its metric definition registered by the TT spec.QWEN36_KV_HOST_TIER_STORE_GUARD=0retains upstream assertions for tests; the cause fix stays enabled.CPU validation
Before, with the plugin from base
08cacdbe95b6b47427c192f0026659ae809048cb:After:
All 12 new tests pass; 28 total pass and three existing staging-ring tests skip because torch is absent. Includes the unpatched negative control, admission/preemption aborts, prefix hits, 2048/256-token hash sizes, resumed block replacement, prompt-only decode, default guard/strict mode, stats export/reset, pending transfers and block-reuse flushing.
vLLM and torch are not installed on this host. The minimal fixture executes unchanged upstream scheduler, connector, offload state and stats definitions; request/config/backend/device dependencies are stubbed. All 49 retained functions/methods were AST-compared with the downloaded pinned source. No installs or devices are needed.
check-cited-records.py: OK.check-gate-parity.py --all: OK with 16 stale-record warnings, not card certification. No commit-hook failure occurred. CPU evidence is committed inbench/runs/inc393-offload-cpu-20261110.jsonl; no new PP or TG speed number.Unverified and shipping
No card, full installed-vLLM/TTScheduler integration, model correctness, sustained P/D soak or performance validation was run. No image was built or shipped and no production/cluster host was accessed. The change is in an already-mounted Python file; owner-controlled shipping must carry the new overlay (or bake it into a future image), restart, verify banners/metric registration, and re-gate the 52-GiB configuration on cards with cancellation/resume, healthy concurrent requests, prefix reuse and a soak. Existing card gates were not restamped.
Incident report:
docs/incidents/2026-11-09-tt-offload-assert.md.Impl-Model: openai/gpt-6-astra
verdict: approve
tier: T1 (module change to a live, already-mounted serving file)
Model: ollama/agent-dense (session already on agent-dense — swap precondition satisfied, not a failed swap).
rationale: Correct production fix. A finished/aborted request mid-chunked-prefill was sized to its full prompt (
req.num_tokens) in_build_store_jobs, so the offload-key slice could out-length the block-id slice and trip thelen(offload_keys) == len(offload_block_ids)assert that killed TT EngineCore on 2026-11-09. The fix bounds finished-request offloads tonum_computed_tokens(cause) plus a default-on per-request range guard that skips/logs/counts any malformed store before reserving host slots. Scoped instance-locally to the TT connector (guard is idempotent, other connectors untouched). CPU evidence is strong: 12 new tests + 28 retained pass (3 torch staging-ring tests skip), with a true negative control (unpatched HEAD reproduces the exact AssertionError), 2048/256-token hash sizes, resumed-block replacement, preemption, and prefix hits. Additive-only surface (new fixture + test + docs); no secrets, no bypass patterns in the diff.concerns:
QWEN36_KV_HOST_TIER_STORE_GUARDdefaults ON — on merge this is a standing behavior change to the live TT connector (default-on mismatch guard). Intentional (it is the fix), but flagging for deliberate close-out rather than silent promotion.tree_dirty: trueand the specific prod trigger is a stated hypothesis (crash.log empty, no request-state dump). The failure mechanism is reproduced and bounded; only the exact triggering request is unconfirmed. Acceptable for a correctness fix.Cards skipped
Cards unavailable on
cfx-llm0for PR #394f671839e2e7240db3f1e982a525f0deaeadd1aa3.systemctl is-active tenstorrent-serving.service=active(needinactive)53999408kB (need >= 4000000)No slot taken, no boot. This skip is green.
Review (orchestra, Claude Opus 5.5; Codex-authored so model-diverse) @
f671839e: LAND.f671839e2e4529efeb17Cards skipped
Cards unavailable on
cfx-llm0for PR #3944529efeb17bd551a5911cb0330e4d3051cf15a6b.systemctl is-active tenstorrent-serving.service=active(needinactive)28760972kB (need >= 4000000)No slot taken, no boot. This skip is green.
Owner decision 2026-11-12: merge without the card gate. cards-fresh on
4529efebwas NOT measured ("serving active or MemAvailable low": TT prod serving, RTX reserved for MTP training, so a card run = full outage). All other checks green (run 12407). Card validation happens at TT deploy, which needs a TT restart anyway.agent-gateway closeout (merged): cleared
agent:*labels.Hermes kanban card (if any) is left for Hermes to archive/complete.