You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples/ChatDemo clamps maxResponseTokens to 896 on iOS (ChatModel.swift) for pipelined chat models. This is a deliberate workaround, not a product decision — remove it when the upstream fix lands.
Why
The iOS on-device compiler miscompiles the pipelined engine's specialization when the bound KV cache state's seq dim is ≥2048: output is corrupt from token 1 at impossible speed (~10× the bandwidth floor). Capacity ≤1024 is clean (token-exact vs the fp32 oracle); macOS is clean at every size. A full cache evict does not help, and .fixedSize (4096 upfront) rides the broken shape on every turn — so the only safe envelope today is keeping history + prompt + maxTokens ≤ 1024 per turn.
Device-bisected 2026-07-24 on nanbeige4.2-3b (iPhone 17 Pro, iOS 27 beta 24A5380h). The bug is shape-triggered, so it affects any dynamically-sized-KV bundle driven past capacity 1024 on iOS — bench-sized runs (g≤256) never see it.
Affected
ChatDemo iOS with any dynamic-KV pipelined catalog model and a long response budget
Not affected: macOS (all sizes), fixed-seqDim exports, generation within capacity 1024
What
Examples/ChatDemoclampsmaxResponseTokensto 896 on iOS (ChatModel.swift) for pipelined chat models. This is a deliberate workaround, not a product decision — remove it when the upstream fix lands.Why
The iOS on-device compiler miscompiles the pipelined engine's specialization when the bound KV cache state's seq dim is ≥2048: output is corrupt from token 1 at impossible speed (~10× the bandwidth floor). Capacity ≤1024 is clean (token-exact vs the fp32 oracle); macOS is clean at every size. A full cache evict does not help, and
.fixedSize(4096 upfront) rides the broken shape on every turn — so the only safe envelope today is keepinghistory + prompt + maxTokens ≤ 1024per turn.Upstream report with the full bisect matrix: apple/coreai-models#124
Device-bisected 2026-07-24 on
nanbeige4.2-3b(iPhone 17 Pro, iOS 27 beta 24A5380h). The bug is shape-triggered, so it affects any dynamically-sized-KV bundle driven past capacity 1024 on iOS — bench-sized runs (g≤256) never see it.Affected
Exit criteria
ChatModel.swiftand the note inModelRuntime.swift