Skip to content

[BUG]: InteractiveExecutor when using MTMD with a limited context size, a NoKvSlot error occurs #1355

@aropb

Description

@aropb

Description

InteractiveExecutor when using MTMD with a limited context size, a NoKvSlot error occurs

InferInternal()
...

var result = await Context.DecodeAsync(_embeds, LLamaSeqId.Zero, batch, _pastTokensCount);

Variable for example:
Context.ContextSize = 1792
_pastTokensCount = 551
_embeds.Count = 1
_session_tokens.Count = 550
_embed_inps.Count = 213

The error occurs only when adding an image and using MTMD.

I've been trying to figure out what's going on for hours now. The variables show that there is still a free context for tokens. There is no shift. And an error occurs. Obviously, the context is overflowing, but what and why are the current variables (_pastTokensCount, _embeds.Count) it doesn't reflect I don't understand.

Environment & Configuration

  • Operating system: Windows
  • .NET runtime version: 10.0.4
  • LLamaSharp version: 0.26.0
  • CUDA version (if you are using cuda backend): 12.9
  • CPU & GPU device: RTX 5090

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