[GH-ISSUE #2048] unexpected error in llama server update_slots - exiting main loop #1183

Closed
opened 2026-04-12 10:58:01 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @mofanke on GitHub (Jan 18, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2048

[1704891429] sampled token: 29896: '1'
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 256
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 128
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 64
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 32
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 16
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 8
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 4
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 2
[1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 1
[1704891429] update_slots : failed to decode the batch, n_batch = 1, ret = 1
[1704891429] unexpected error in llama server update_slots - exiting main loop
[1704891429]
llama server shutting down

ollama is still running , and not respond for chat api

Originally created by @mofanke on GitHub (Jan 18, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2048 [1704891429] sampled token: 29896: '1' [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 256 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 128 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 64 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 32 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 16 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 8 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 4 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 2 [1704891429] update_slots : failed to find free space in the KV cache, retrying with smaller n_batch = 1 [1704891429] update_slots : failed to decode the batch, n_batch = 1, ret = 1 [1704891429] unexpected error in llama server update_slots - exiting main loop [1704891429] llama server shutting down ollama is still running , and not respond for chat api
GiteaMirror added the bug label 2026-04-12 10:58:01 -05:00
Author
Owner

@mofanke commented on GitHub (Jan 18, 2024):

This question involves the occurrence of probabilistic behavior when a large model's output keeps repeating.
and must restart the ollama process to fix

<!-- gh-comment-id:1898418224 --> @mofanke commented on GitHub (Jan 18, 2024): This question involves the occurrence of probabilistic behavior when a large model's output keeps repeating. and must restart the ollama process to fix
Author
Owner

@luoluoter commented on GitHub (Feb 5, 2024):

ollama version is 0.1.23; i get the same problem like you

keep trap in this loop, request hang and endless print logs like you post

unless i restart ollama service

<!-- gh-comment-id:1926164956 --> @luoluoter commented on GitHub (Feb 5, 2024): ollama version is 0.1.23; i get the same problem like you keep trap in this loop, request hang and endless print logs like you post unless i restart ollama service
Author
Owner

@jyomu commented on GitHub (Feb 15, 2024):

The same issue is present in version 0.1.24.

<!-- gh-comment-id:1945921956 --> @jyomu commented on GitHub (Feb 15, 2024): The same issue is present in version 0.1.24.
Author
Owner

@pdevine commented on GitHub (Mar 11, 2024):

I haven't been able to reproduce this in the current version. Are you still seeing it? What platform are you using?

<!-- gh-comment-id:1989146681 --> @pdevine commented on GitHub (Mar 11, 2024): I haven't been able to reproduce this in the current version. Are you still seeing it? What platform are you using?
Author
Owner

@luoluoter commented on GitHub (Mar 12, 2024):

I have already updated to a version higher than v0.1.25, and it seems that the issue no longer occurs after v0.1.25.

I am still using ollama(at least v0.1.27) on Linux(and MacOS), and it works really well!

<!-- gh-comment-id:1990711900 --> @luoluoter commented on GitHub (Mar 12, 2024): I have already updated to a version higher than v0.1.25, and it seems that the issue no longer occurs after v0.1.25. I am still using ollama(at least v0.1.27) on Linux(and MacOS), and it works really well!
Author
Owner

@kcramp858 commented on GitHub (Apr 2, 2024):

This still happens on 1.3.0.. turning off # "format": "json" fixes it.

<!-- gh-comment-id:2030936458 --> @kcramp858 commented on GitHub (Apr 2, 2024): This still happens on 1.3.0.. turning off # "format": "json" fixes it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1183