[GH-ISSUE #9171] Crashes when running deepseek-r1:671b because K-shift #31731

Closed
opened 2026-04-22 12:27:17 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @myoldcat on GitHub (Feb 17, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9171

What is the issue?

When running the deepseek-r1:671b model, if the chain of thought is relatively long, the model crashes.
The log shows: The current context does not support K-shift

Relevant log output

Feb 17 11:29:30 ubuntu ollama[734313]: time=2025-02-17T11:29:30.763Z level=DEBUG source=cache.go:231 msg="context limit hit - shifting" id=0 limit=2048 input=2048 keep=5 discard=1021
Feb 17 11:29:30 ubuntu ollama[734313]: llama.cpp:11942: The current context does not support K-shift
Feb 17 11:29:30 ubuntu ollama[734313]: SIGSEGV: segmentation violation
Feb 17 11:29:30 ubuntu ollama[734313]: PC=0x7ff76a858cd7 m=14 sigcode=1 addr=0x22b403fbc
Feb 17 11:29:30 ubuntu ollama[734313]: signal arrived during cgo execution
Feb 17 11:29:30 ubuntu ollama[734313]: goroutine 214 gp=0xc000605340 m=14 mp=0xc000680708 [syscall]:
Feb 17 11:29:30 ubuntu ollama[734313]: runtime.cgocall(0x55f1fccbd3a0, 0xc00031dba0)
Feb 17 11:29:30 ubuntu ollama[734313]:         runtime/cgocall.go:167 +0x4b fp=0xc00031db78 sp=0xc00031db40 pc=0x55f1fc115c2b
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama._Cfunc_llama_decode(0x7ff4058e12d0, {0x1, 0x7ff405d4a2d0, 0x0, 0x0, 0x7ff406400f20, 0x7ff406402f30, 0x7ff405ef58f0, 0x7ff38121c900})
Feb 17 11:29:30 ubuntu ollama[734313]:         _cgo_gotypes.go:545 +0x4f fp=0xc00031dba0 sp=0xc00031db78 pc=0x55f1fc4cabef
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama.(*Context).Decode.func1(0x55f1fc4d9beb?, 0x7ff4058e12d0?)
Feb 17 11:29:30 ubuntu ollama[734313]:         github.com/ollama/ollama/llama/llama.go:163 +0xf5 fp=0xc00031dc90 sp=0xc00031dba0 pc=0x55f1fc4cd915
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama.(*Context).Decode(0x55f1fdb43c20?, 0x0?)
Feb 17 11:29:30 ubuntu ollama[734313]:         github.com/ollama/ollama/llama/llama.go:163 +0x13 fp=0xc00031dcd8 sp=0xc00031dc90 pc=0x55f1fc4cd793
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.(*Server).processBatch(0xc0003557a0, 0xc0008ba060, 0xc00031df20)
Feb 17 11:29:30 ubuntu ollama[734313]:         github.com/ollama/ollama/llama/runner/runner.go:434 +0x23f fp=0xc00031dee0 sp=0xc00031dcd8 pc=0x55f1fc4d89df
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.(*Server).run(0xc0003557a0, {0x55f1fd2eaf40, 0xc0006930e0})
Feb 17 11:29:30 ubuntu ollama[734313]:         github.com/ollama/ollama/llama/runner/runner.go:342 +0x1d5 fp=0xc00031dfb8 sp=0xc00031dee0 pc=0x55f1fc4d8415
Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.Execute.gowrap2()
Feb 17 11:29:30 ubuntu ollama[734313]:         github.com/ollama/ollama/llama/runner/runner.go:975 +0x28 fp=0xc00031dfe0 sp=0xc00031dfb8 pc=0x55f1fc4dd308

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

ollama 0.5.11

Originally created by @myoldcat on GitHub (Feb 17, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9171 ### What is the issue? When running the deepseek-r1:671b model, if the chain of thought is relatively long, the model crashes. The log shows: The current context does not support K-shift ### Relevant log output ```shell Feb 17 11:29:30 ubuntu ollama[734313]: time=2025-02-17T11:29:30.763Z level=DEBUG source=cache.go:231 msg="context limit hit - shifting" id=0 limit=2048 input=2048 keep=5 discard=1021 Feb 17 11:29:30 ubuntu ollama[734313]: llama.cpp:11942: The current context does not support K-shift Feb 17 11:29:30 ubuntu ollama[734313]: SIGSEGV: segmentation violation Feb 17 11:29:30 ubuntu ollama[734313]: PC=0x7ff76a858cd7 m=14 sigcode=1 addr=0x22b403fbc Feb 17 11:29:30 ubuntu ollama[734313]: signal arrived during cgo execution Feb 17 11:29:30 ubuntu ollama[734313]: goroutine 214 gp=0xc000605340 m=14 mp=0xc000680708 [syscall]: Feb 17 11:29:30 ubuntu ollama[734313]: runtime.cgocall(0x55f1fccbd3a0, 0xc00031dba0) Feb 17 11:29:30 ubuntu ollama[734313]: runtime/cgocall.go:167 +0x4b fp=0xc00031db78 sp=0xc00031db40 pc=0x55f1fc115c2b Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama._Cfunc_llama_decode(0x7ff4058e12d0, {0x1, 0x7ff405d4a2d0, 0x0, 0x0, 0x7ff406400f20, 0x7ff406402f30, 0x7ff405ef58f0, 0x7ff38121c900}) Feb 17 11:29:30 ubuntu ollama[734313]: _cgo_gotypes.go:545 +0x4f fp=0xc00031dba0 sp=0xc00031db78 pc=0x55f1fc4cabef Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama.(*Context).Decode.func1(0x55f1fc4d9beb?, 0x7ff4058e12d0?) Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/llama.go:163 +0xf5 fp=0xc00031dc90 sp=0xc00031dba0 pc=0x55f1fc4cd915 Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama.(*Context).Decode(0x55f1fdb43c20?, 0x0?) Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/llama.go:163 +0x13 fp=0xc00031dcd8 sp=0xc00031dc90 pc=0x55f1fc4cd793 Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.(*Server).processBatch(0xc0003557a0, 0xc0008ba060, 0xc00031df20) Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner/runner.go:434 +0x23f fp=0xc00031dee0 sp=0xc00031dcd8 pc=0x55f1fc4d89df Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.(*Server).run(0xc0003557a0, {0x55f1fd2eaf40, 0xc0006930e0}) Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner/runner.go:342 +0x1d5 fp=0xc00031dfb8 sp=0xc00031dee0 pc=0x55f1fc4d8415 Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner.Execute.gowrap2() Feb 17 11:29:30 ubuntu ollama[734313]: github.com/ollama/ollama/llama/runner/runner.go:975 +0x28 fp=0xc00031dfe0 sp=0xc00031dfb8 pc=0x55f1fc4dd308 ``` ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version ollama 0.5.11
GiteaMirror added the bug label 2026-04-22 12:27:17 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 17, 2025):

#5975

<!-- gh-comment-id:2662890045 --> @rick-github commented on GitHub (Feb 17, 2025): #5975
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31731