[GH-ISSUE #5651] 2nd prompt never completes #3525

Closed
opened 2026-04-12 14:13:40 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Konuralpkilinc on GitHub (Jul 12, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5651

What is the issue?

Whenever i try to give the second prompt on any GGUF models ollama fails here is the logs

time=2024-07-12T15:47:23.505Z level=INFO source=sched.go:738 msg="new model will fit in available VRAM in single GPU, loading" model=/home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 gpu=GPU-eb3a6957-5b68-4958-c313-3b20f0815e4d parallel=4 available=33768079360 required="12.4 GiB"
time=2024-07-12T15:47:23.506Z level=INFO source=memory.go:309 msg="offload to cuda" layers.requested=-1 layers.model=33 layers.offload=33 layers.split="" memory.available="[31.4 GiB]" memory.required.full="12.4 GiB" memory.required.partial="12.4 GiB" memory.required.kv="8.0 GiB" memory.required.allocations="[12.4 GiB]" memory.weights.total="10.5 GiB" memory.weights.repeating="10.4 GiB" memory.weights.nonrepeating="102.6 MiB" memory.graph.full="1.1 GiB" memory.graph.partial="1.3 GiB"
time=2024-07-12T15:47:23.507Z level=INFO source=server.go:375 msg="starting llama server" cmd="/tmp/ollama3602127725/runners/cuda_v11/ollama_llama_server --model /home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 --ctx-size 16384 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --parallel 4 --port 40663"
time=2024-07-12T15:47:23.508Z level=INFO source=sched.go:474 msg="loaded runners" count=1
time=2024-07-12T15:47:23.508Z level=INFO source=server.go:563 msg="waiting for llama runner to start responding"
time=2024-07-12T15:47:23.513Z level=INFO source=server.go:604 msg="waiting for server to become available" status="llm server error"
INFO [main] build info | build=1 commit="a8db2a9" tid="139871727800320" timestamp=1720799243
INFO [main] system info | n_threads=24 n_threads_batch=-1 system_info="AVX = 1 | AVX_VNNI = 0 | AVX2 = 0 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | FMA = 0 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 0 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 0 | " tid="139871727800320" timestamp=1720799243 total_threads=48
INFO [main] HTTP server listening | hostname="127.0.0.1" n_threads_http="47" port="40663" tid="139871727800320" timestamp=1720799243
llama_model_loader: loaded meta data with 19 key-value pairs and 291 tensors from /home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 (version GGUF V2)
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = llama
llama_model_loader: - kv 1: general.name str = LLaMA v2
llama_model_loader: - kv 2: llama.context_length u32 = 4096
llama_model_loader: - kv 3: llama.embedding_length u32 = 4096
llama_model_loader: - kv 4: llama.block_count u32 = 32
llama_model_loader: - kv 5: llama.feed_forward_length u32 = 11008
llama_model_loader: - kv 6: llama.rope.dimension_count u32 = 128
llama_model_loader: - kv 7: llama.attention.head_count u32 = 32
llama_model_loader: - kv 8: llama.attention.head_count_kv u32 = 32
llama_model_loader: - kv 9: llama.attention.layer_norm_rms_epsilon f32 = 0.000001
llama_model_loader: - kv 10: general.file_type u32 = 10
llama_model_loader: - kv 11: tokenizer.ggml.model str = llama
llama_model_loader: - kv 12: tokenizer.ggml.tokens arr[str,32000] = ["", "", "", "<0x00>", "<...
llama_model_loader: - kv 13: tokenizer.ggml.scores arr[f32,32000] = [0.000000, 0.000000, 0.000000, 0.0000...
llama_model_loader: - kv 14: tokenizer.ggml.token_type arr[i32,32000] = [2, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, ...
llama_model_loader: - kv 15: tokenizer.ggml.bos_token_id u32 = 1
llama_model_loader: - kv 16: tokenizer.ggml.eos_token_id u32 = 2
llama_model_loader: - kv 17: tokenizer.ggml.unknown_token_id u32 = 0
llama_model_loader: - kv 18: general.quantization_version u32 = 2
llama_model_loader: - type f32: 65 tensors
llama_model_loader: - type q2_K: 65 tensors
llama_model_loader: - type q3_K: 160 tensors
llama_model_loader: - type q6_K: 1 tensors
llm_load_vocab: special tokens cache size = 259
llm_load_vocab: token to piece cache size = 0.1684 MB
llm_load_print_meta: format = GGUF V2
llm_load_print_meta: arch = llama
llm_load_print_meta: vocab type = SPM
llm_load_print_meta: n_vocab = 32000
llm_load_print_meta: n_merges = 0
llm_load_print_meta: vocab_only = 0
llm_load_print_meta: n_ctx_train = 4096
llm_load_print_meta: n_embd = 4096
llm_load_print_meta: n_layer = 32
llm_load_print_meta: n_head = 32
llm_load_print_meta: n_head_kv = 32
llm_load_print_meta: n_rot = 128
llm_load_print_meta: n_swa = 0
llm_load_print_meta: n_embd_head_k = 128
llm_load_print_meta: n_embd_head_v = 128
llm_load_print_meta: n_gqa = 1
llm_load_print_meta: n_embd_k_gqa = 4096
llm_load_print_meta: n_embd_v_gqa = 4096
llm_load_print_meta: f_norm_eps = 0.0e+00
llm_load_print_meta: f_norm_rms_eps = 1.0e-06
llm_load_print_meta: f_clamp_kqv = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale = 0.0e+00
llm_load_print_meta: n_ff = 11008
llm_load_print_meta: n_expert = 0
llm_load_print_meta: n_expert_used = 0
llm_load_print_meta: causal attn = 1
llm_load_print_meta: pooling type = 0
llm_load_print_meta: rope type = 0
llm_load_print_meta: rope scaling = linear
llm_load_print_meta: freq_base_train = 10000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn = 4096
llm_load_print_meta: rope_finetuned = unknown
llm_load_print_meta: ssm_d_conv = 0
llm_load_print_meta: ssm_d_inner = 0
llm_load_print_meta: ssm_d_state = 0
llm_load_print_meta: ssm_dt_rank = 0
llm_load_print_meta: model type = 7B
llm_load_print_meta: model ftype = Q2_K - Medium
llm_load_print_meta: model params = 6.74 B
llm_load_print_meta: model size = 2.63 GiB (3.35 BPW)
llm_load_print_meta: general.name = LLaMA v2
llm_load_print_meta: BOS token = 1 ''
llm_load_print_meta: EOS token = 2 '
'
llm_load_print_meta: UNK token = 0 ''
llm_load_print_meta: LF token = 13 '<0x0A>'
llm_load_print_meta: max token length = 48
time=2024-07-12T15:47:23.765Z level=INFO source=server.go:604 msg="waiting for server to become available" status="llm server loading model"
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: yes
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: Tesla V100-SXM2-32GB, compute capability 7.0, VMM: yes
llm_load_tensors: ggml ctx size = 0.27 MiB
llm_load_tensors: offloading 32 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 33/33 layers to GPU
llm_load_tensors: CPU buffer size = 41.02 MiB
llm_load_tensors: CUDA0 buffer size = 2653.31 MiB
llama_new_context_with_model: n_ctx = 16384
llama_new_context_with_model: n_batch = 512
llama_new_context_with_model: n_ubatch = 512
llama_new_context_with_model: flash_attn = 0
llama_new_context_with_model: freq_base = 10000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init: CUDA0 KV buffer size = 8192.00 MiB
llama_new_context_with_model: KV self size = 8192.00 MiB, K (f16): 4096.00 MiB, V (f16): 4096.00 MiB
llama_new_context_with_model: CUDA_Host output buffer size = 0.55 MiB
llama_new_context_with_model: CUDA0 compute buffer size = 1088.00 MiB
llama_new_context_with_model: CUDA_Host compute buffer size = 40.01 MiB
llama_new_context_with_model: graph nodes = 1030
llama_new_context_with_model: graph splits = 2
INFO [main] model loaded | tid="139871727800320" timestamp=1720799246
time=2024-07-12T15:47:26.280Z level=INFO source=server.go:609 msg="llama runner started in 2.77 seconds"
ggml_cuda_compute_forward: MUL failed
CUDA error: unspecified launch failure
current device: 0, in function ggml_cuda_compute_forward at /go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda.cu:2283
err
GGML_ASSERT: /go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda.cu💯 !"CUDA error"

to visualize things i use the Open WebUI here are some screenshots
image
image

OS

Linux

GPU

Nvidia

CPU

Other

Ollama version

0.2.1

Originally created by @Konuralpkilinc on GitHub (Jul 12, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5651 ### What is the issue? Whenever i try to give the second prompt on any GGUF models ollama fails here is the logs time=2024-07-12T15:47:23.505Z level=INFO source=sched.go:738 msg="new model will fit in available VRAM in single GPU, loading" model=/home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 gpu=GPU-eb3a6957-5b68-4958-c313-3b20f0815e4d parallel=4 available=33768079360 required="12.4 GiB" time=2024-07-12T15:47:23.506Z level=INFO source=memory.go:309 msg="offload to cuda" layers.requested=-1 layers.model=33 layers.offload=33 layers.split="" memory.available="[31.4 GiB]" memory.required.full="12.4 GiB" memory.required.partial="12.4 GiB" memory.required.kv="8.0 GiB" memory.required.allocations="[12.4 GiB]" memory.weights.total="10.5 GiB" memory.weights.repeating="10.4 GiB" memory.weights.nonrepeating="102.6 MiB" memory.graph.full="1.1 GiB" memory.graph.partial="1.3 GiB" time=2024-07-12T15:47:23.507Z level=INFO source=server.go:375 msg="starting llama server" cmd="/tmp/ollama3602127725/runners/cuda_v11/ollama_llama_server --model /home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 --ctx-size 16384 --batch-size 512 --embedding --log-disable --n-gpu-layers 33 --parallel 4 --port 40663" time=2024-07-12T15:47:23.508Z level=INFO source=sched.go:474 msg="loaded runners" count=1 time=2024-07-12T15:47:23.508Z level=INFO source=server.go:563 msg="waiting for llama runner to start responding" time=2024-07-12T15:47:23.513Z level=INFO source=server.go:604 msg="waiting for server to become available" status="llm server error" INFO [main] build info | build=1 commit="a8db2a9" tid="139871727800320" timestamp=1720799243 INFO [main] system info | n_threads=24 n_threads_batch=-1 system_info="AVX = 1 | AVX_VNNI = 0 | AVX2 = 0 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | FMA = 0 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 0 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 0 | " tid="139871727800320" timestamp=1720799243 total_threads=48 INFO [main] HTTP server listening | hostname="127.0.0.1" n_threads_http="47" port="40663" tid="139871727800320" timestamp=1720799243 llama_model_loader: loaded meta data with 19 key-value pairs and 291 tensors from /home/udemirezen/.ollama/models/blobs/sha256-c0dd304d761e8e05d082cc2902d7624a7f87858fdfaa4ef098330ffe767ff0d3 (version GGUF V2) llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output. llama_model_loader: - kv 0: general.architecture str = llama llama_model_loader: - kv 1: general.name str = LLaMA v2 llama_model_loader: - kv 2: llama.context_length u32 = 4096 llama_model_loader: - kv 3: llama.embedding_length u32 = 4096 llama_model_loader: - kv 4: llama.block_count u32 = 32 llama_model_loader: - kv 5: llama.feed_forward_length u32 = 11008 llama_model_loader: - kv 6: llama.rope.dimension_count u32 = 128 llama_model_loader: - kv 7: llama.attention.head_count u32 = 32 llama_model_loader: - kv 8: llama.attention.head_count_kv u32 = 32 llama_model_loader: - kv 9: llama.attention.layer_norm_rms_epsilon f32 = 0.000001 llama_model_loader: - kv 10: general.file_type u32 = 10 llama_model_loader: - kv 11: tokenizer.ggml.model str = llama llama_model_loader: - kv 12: tokenizer.ggml.tokens arr[str,32000] = ["<unk>", "<s>", "</s>", "<0x00>", "<... llama_model_loader: - kv 13: tokenizer.ggml.scores arr[f32,32000] = [0.000000, 0.000000, 0.000000, 0.0000... llama_model_loader: - kv 14: tokenizer.ggml.token_type arr[i32,32000] = [2, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, ... llama_model_loader: - kv 15: tokenizer.ggml.bos_token_id u32 = 1 llama_model_loader: - kv 16: tokenizer.ggml.eos_token_id u32 = 2 llama_model_loader: - kv 17: tokenizer.ggml.unknown_token_id u32 = 0 llama_model_loader: - kv 18: general.quantization_version u32 = 2 llama_model_loader: - type f32: 65 tensors llama_model_loader: - type q2_K: 65 tensors llama_model_loader: - type q3_K: 160 tensors llama_model_loader: - type q6_K: 1 tensors llm_load_vocab: special tokens cache size = 259 llm_load_vocab: token to piece cache size = 0.1684 MB llm_load_print_meta: format = GGUF V2 llm_load_print_meta: arch = llama llm_load_print_meta: vocab type = SPM llm_load_print_meta: n_vocab = 32000 llm_load_print_meta: n_merges = 0 llm_load_print_meta: vocab_only = 0 llm_load_print_meta: n_ctx_train = 4096 llm_load_print_meta: n_embd = 4096 llm_load_print_meta: n_layer = 32 llm_load_print_meta: n_head = 32 llm_load_print_meta: n_head_kv = 32 llm_load_print_meta: n_rot = 128 llm_load_print_meta: n_swa = 0 llm_load_print_meta: n_embd_head_k = 128 llm_load_print_meta: n_embd_head_v = 128 llm_load_print_meta: n_gqa = 1 llm_load_print_meta: n_embd_k_gqa = 4096 llm_load_print_meta: n_embd_v_gqa = 4096 llm_load_print_meta: f_norm_eps = 0.0e+00 llm_load_print_meta: f_norm_rms_eps = 1.0e-06 llm_load_print_meta: f_clamp_kqv = 0.0e+00 llm_load_print_meta: f_max_alibi_bias = 0.0e+00 llm_load_print_meta: f_logit_scale = 0.0e+00 llm_load_print_meta: n_ff = 11008 llm_load_print_meta: n_expert = 0 llm_load_print_meta: n_expert_used = 0 llm_load_print_meta: causal attn = 1 llm_load_print_meta: pooling type = 0 llm_load_print_meta: rope type = 0 llm_load_print_meta: rope scaling = linear llm_load_print_meta: freq_base_train = 10000.0 llm_load_print_meta: freq_scale_train = 1 llm_load_print_meta: n_ctx_orig_yarn = 4096 llm_load_print_meta: rope_finetuned = unknown llm_load_print_meta: ssm_d_conv = 0 llm_load_print_meta: ssm_d_inner = 0 llm_load_print_meta: ssm_d_state = 0 llm_load_print_meta: ssm_dt_rank = 0 llm_load_print_meta: model type = 7B llm_load_print_meta: model ftype = Q2_K - Medium llm_load_print_meta: model params = 6.74 B llm_load_print_meta: model size = 2.63 GiB (3.35 BPW) llm_load_print_meta: general.name = LLaMA v2 llm_load_print_meta: BOS token = 1 '<s>' llm_load_print_meta: EOS token = 2 '</s>' llm_load_print_meta: UNK token = 0 '<unk>' llm_load_print_meta: LF token = 13 '<0x0A>' llm_load_print_meta: max token length = 48 time=2024-07-12T15:47:23.765Z level=INFO source=server.go:604 msg="waiting for server to become available" status="llm server loading model" ggml_cuda_init: GGML_CUDA_FORCE_MMQ: yes ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 1 CUDA devices: Device 0: Tesla V100-SXM2-32GB, compute capability 7.0, VMM: yes llm_load_tensors: ggml ctx size = 0.27 MiB llm_load_tensors: offloading 32 repeating layers to GPU llm_load_tensors: offloading non-repeating layers to GPU llm_load_tensors: offloaded 33/33 layers to GPU llm_load_tensors: CPU buffer size = 41.02 MiB llm_load_tensors: CUDA0 buffer size = 2653.31 MiB llama_new_context_with_model: n_ctx = 16384 llama_new_context_with_model: n_batch = 512 llama_new_context_with_model: n_ubatch = 512 llama_new_context_with_model: flash_attn = 0 llama_new_context_with_model: freq_base = 10000.0 llama_new_context_with_model: freq_scale = 1 llama_kv_cache_init: CUDA0 KV buffer size = 8192.00 MiB llama_new_context_with_model: KV self size = 8192.00 MiB, K (f16): 4096.00 MiB, V (f16): 4096.00 MiB llama_new_context_with_model: CUDA_Host output buffer size = 0.55 MiB llama_new_context_with_model: CUDA0 compute buffer size = 1088.00 MiB llama_new_context_with_model: CUDA_Host compute buffer size = 40.01 MiB llama_new_context_with_model: graph nodes = 1030 llama_new_context_with_model: graph splits = 2 INFO [main] model loaded | tid="139871727800320" timestamp=1720799246 time=2024-07-12T15:47:26.280Z level=INFO source=server.go:609 msg="llama runner started in 2.77 seconds" ggml_cuda_compute_forward: MUL failed CUDA error: unspecified launch failure current device: 0, in function ggml_cuda_compute_forward at /go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda.cu:2283 err GGML_ASSERT: /go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda.cu:100: !"CUDA error" to visualize things i use the Open WebUI here are some screenshots ![image](https://github.com/user-attachments/assets/f0b9cbd0-4f9f-4da4-83c4-a441e32f5186) ![image](https://github.com/user-attachments/assets/f03b16d9-3073-49f7-8b2c-6d80bf833675) ### OS Linux ### GPU Nvidia ### CPU Other ### Ollama version 0.2.1
GiteaMirror added the bug label 2026-04-12 14:13:40 -05:00
Author
Owner

@Konuralpkilinc commented on GitHub (Jul 12, 2024):

here are my chat parameters (i am new to LLM's i tried to change the context length but still got errors). If it is related to the parameter limitations can you recommend me some new configurations

image

when i tried to change the context length i got this error :

/go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda/template-instances/../mmq.cuh:2422: ERROR: CUDA kernel mul_mat_q has no device code compatible with CUDA arch 700. ggml-cuda.cu was compiled for: CUDA_ARCH_LIST

<!-- gh-comment-id:2225559577 --> @Konuralpkilinc commented on GitHub (Jul 12, 2024): here are my chat parameters (i am new to LLM's i tried to change the context length but still got errors). If it is related to the parameter limitations can you recommend me some new configurations ![image](https://github.com/user-attachments/assets/9556c647-157d-4070-ab64-91d130ec62b6) when i tried to change the context length i got this error : /go/src/github.com/ollama/ollama/llm/llama.cpp/ggml/src/ggml-cuda/template-instances/../mmq.cuh:2422: ERROR: CUDA kernel mul_mat_q has no device code compatible with CUDA arch 700. ggml-cuda.cu was compiled for: __CUDA_ARCH_LIST__
Author
Owner

@rick-github commented on GitHub (Jul 12, 2024):

Based on your last comment it sounds like some parts of your hardware don't support the version of ollama you are using. Since your first prompt worked, it could be that the issue is dependent on some aspects of the model that are exercised when you add more data to the context. If that's the case, maybe a different model will work better. llama-2 is relatively old now, you can find newer models on https://ollama.com/library.

<!-- gh-comment-id:2225619238 --> @rick-github commented on GitHub (Jul 12, 2024): Based on your last comment it sounds like some parts of your hardware don't support the version of ollama you are using. Since your first prompt worked, it could be that the issue is dependent on some aspects of the model that are exercised when you add more data to the context. If that's the case, maybe a different model will work better. llama-2 is relatively old now, you can find newer models on https://ollama.com/library.
Author
Owner

@rick-github commented on GitHub (Jul 13, 2024):

Version 0.2.2 has fixes for V100 GPUs, try upgrading.

<!-- gh-comment-id:2226661166 --> @rick-github commented on GitHub (Jul 13, 2024): Version 0.2.2 has fixes for V100 GPUs, try upgrading.
Author
Owner

@Konuralpkilinc commented on GitHub (Jul 16, 2024):

I have updated the ollama version and everything is fixed. Thanks @rick-github

<!-- gh-comment-id:2230842141 --> @Konuralpkilinc commented on GitHub (Jul 16, 2024): I have updated the ollama version and everything is fixed. Thanks @rick-github
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3525