• Jesse Gross's avatar
    runner.go: Make KV entry accounting more robust · 65973ceb
    Jesse Gross authored
    The structure of the accounting for KV cache shifting was carried
    over from the old runner but it now doesn't feel natural with the new
    runner. There are a number of invariants that should hold true but
    are difficult to reason about. There is at least one bug report
    that would imply that the invariants are not holding.
    
    This reduces the number of implicit assumptions and is more forgiving
    of unexpected situations. It also improves behavior around which input
    tokens are kept when truncation occurs.
    
    Bug #7545
    65973ceb
cache.go 5.58 KB