Skip to content

Eval bug: failed to restore kv cache on gpt-oss:120b with parallel processing #17527

Closed

Description

@lostmsu

Name and Version

version: 7157 (583cb83)
built with clang version 19.1.5 for x86_64-pc-windows-msvc

Operating systems

Windows

GGML backends

CUDA

Hardware

RTX 5060 Ti + 9950x + 96 GB RAM

Models

--gpt-oss-120b-default (see below for extra parameters that might affect it)

Problem description & steps to reproduce

I am running llama-server with

      --gpt-oss-120b-default
      --ctx-size 0
      --kv-unified
      --jinja
      --chat-template-kwargs {\"reasoning_effort\":\"high\"}
      -ub 2048 -b 2048
      --cpu-moe --n-gpu-layers 999
      --prio -1
      --parallel 8

And two parallel agentic workflows: one via llama.vscode, another via codex.

Both contexts are far from 64K (somewhere in 2xK each). Yet, llama-server falls back to full prompt re-processing "due to lack of cache data".

First Bad Commit

No response

Relevant log output

srv  params_from_: Chat format: GPT-OSS
slot get_availabl: id  7 | task -1 | selected slot by LCP similarity, sim_best = 0.901 (> 0.100 thold), f_keep = 0.823
slot launch_slot_: id  7 | task -1 | sampler chain: logits -> logit-bias -> penalties -> dry -> top-n-sigma -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
slot launch_slot_: id  7 | task 60314 | processing task
slot update_slots: id  7 | task 60314 | new prompt, n_ctx_slot = 131072, n_keep = 0, task.n_tokens = 27291
slot update_slots: id  7 | task 60314 | n_past = 24582, slot.prompt.tokens.size() = 29882, seq_id = 7, pos_min = 29755, n_swa = 128
state_read_meta: failed to find available cells in kv cache
state_seq_set_data: error loading state: failed to restore kv cache
slot update_slots: id  7 | task 60314 | failed to restore context checkpoint (pos_min = 21700, pos_max = 24516, size = 99.068 MiB)
slot update_slots: id  7 | task 60314 | forcing full prompt re-processing due to lack of cache data (likely due to SWA or hybrid/recurrent memory, see https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)

Activity

  1. added
    bug
    performance
    and removed on Nov 30, 2025
  2. added theissue type on Nov 30, 2025
  3. Orion-zhen commented on Dec 1, 2025

    @Orion-zhen

    Having the same issue, but not in parallel processing.

    • OS: Arch Linux
    • GGML Backend: Vulkan + amdvlk
    • Hardware: AMD Strix Halo (AI Max+ 395) w/ 8060S
    • Model: GPT-OSS-120B

    Problem description:

    The issue occurs randomly. When simultaneously loading GPT-OSS-120B and other models, and alternately chatting between the two, there is a probability of triggering this bug when returning to GPT-OSS-120B. Similarly, interrupting the generation process of GPT-OSS-120B and then restarting the generation also has a chance of triggering this bug.

  4. lostmsu commented on Dec 3, 2025

    @lostmsu
    Author

    I don't seem to experience the bug with --swa-full. I believe it should be on for gpt-oss by default.

  5. ggerganov commented on Dec 3, 2025

    @ggerganov
    Member

    The state restore logic has to be extended to not search for contiguous slot of KV cells here:

    const auto sinfo = find_slot(ubatch, true);

    I.e. it should be changed to:

    const auto sinfo = find_slot(ubatch, false);

    And then the data reading should taking into the sinfo.idxs.

    Not too complicated, if someone wants to give it a shot. Otherwise I'll fix it sometime later when I need it.

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

    bugperformanceserver

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions