Skip to content

Misc. bug: Using draft model with Gemma producing error "get_logits_ith: invalid logits id 0" #13963

Open
@spliznork

Description

@spliznork

Name and Version

.\build\bin\Release\llama-server.exe --version
version: 5561 (8726392)
built with MSVC 19.43.34810.0 for x64

Operating systems

Windows

Which llama.cpp modules do you know to be affected?

llama-server

Command line

.\build\bin\Release\llama-server.exe -m D:\huggingface\hub\models--unsloth--gemma-3-27b-it-GGUF\snapshots\b7609a0532f5be7a679ace6a6ea3382e0ac3228c\gemma-3-27b-it-UD-Q6_K_XL.gguf -md D:\huggingface\hub\models--unsloth--gemma-3-4b-it-GGUF\snapshots\837fb61240cea4985fd23bc904284ee38dd47c1c\gemma-3-4b-it-UD-Q2_K_XL.gguf --flash-attn -ngl 999 -ngld 999 --tensor-split 1,1 --ctx-size 131072

Problem description & steps to reproduce

Apologies, I don't know if this is user error, system error, or software error. Running llama-server with Gemma 3 27b UD Q6_K_XL as main and Gemma 3 4b UD Q2_K_XL as draft. I've tried different variations of both and get the same problem.

I have a dual 3090 setup in Windows. Sending queries fails with the error "get_logits_ith: invalid logits id 0, reason: batch.logits[0] != true". Sometimes the system will run successfully for some number of queries before failing.

I also see a number of warnings(?) like "decode: failed to find KV cache slot for batch of size 10", and significantly reducing the context length and reducing the defrag-thold doesn't reduce their frequency.

Note Gemma 3 27b runs fine without these issues without using a draft model.

First Bad Commit

No response

Relevant log output

ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 2 CUDA devices:
  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 1: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
build: 5561 (8726392d) with MSVC 19.43.34810.0 for x64
system info: n_threads = 12, n_threads_batch = 12, total_threads = 24

system_info: n_threads = 12 (n_threads_batch = 12) / 24 | CUDA : ARCHS = 860 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |

main: binding port with default address family
main: HTTP server is listening, hostname: 127.0.0.1, port: 8080, http threads: 23
main: loading model
srv    load_model: loading model 'D:\huggingface\hub\models--unsloth--gemma-3-27b-it-GGUF\snapshots\b7609a0532f5be7a679ace6a6ea3382e0ac3228c\gemma-3-27b-it-UD-Q6_K_XL.gguf'
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 3090) - 23306 MiB free
llama_model_loader: loaded meta data with 40 key-value pairs and 808 tensors from D:\huggingface\hub\models--unsloth--gemma-3-27b-it-GGUF\snapshots\b7609a0532f5be7a679ace6a6ea3382e0ac3228c\gemma-3-27b-it-UD-Q6_K_XL.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = gemma3
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Gemma-3-27B-It
llama_model_loader: - kv   3:                           general.finetune str              = it
llama_model_loader: - kv   4:                           general.basename str              = Gemma-3-27B-It
llama_model_loader: - kv   5:                       general.quantized_by str              = Unsloth
llama_model_loader: - kv   6:                         general.size_label str              = 27B
llama_model_loader: - kv   7:                           general.repo_url str              = https://huggingface.co/unsloth
llama_model_loader: - kv   8:                      gemma3.context_length u32              = 131072
llama_model_loader: - kv   9:                    gemma3.embedding_length u32              = 5376
llama_model_loader: - kv  10:                         gemma3.block_count u32              = 62
llama_model_loader: - kv  11:                 gemma3.feed_forward_length u32              = 21504
llama_model_loader: - kv  12:                gemma3.attention.head_count u32              = 32
llama_model_loader: - kv  13:    gemma3.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  14:                gemma3.attention.key_length u32              = 128
llama_model_loader: - kv  15:              gemma3.attention.value_length u32              = 128
llama_model_loader: - kv  16:                      gemma3.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  17:            gemma3.attention.sliding_window u32              = 1024
llama_model_loader: - kv  18:             gemma3.attention.head_count_kv u32              = 16
llama_model_loader: - kv  19:                   gemma3.rope.scaling.type str              = linear
llama_model_loader: - kv  20:                 gemma3.rope.scaling.factor f32              = 8.000000
llama_model_loader: - kv  21:                       tokenizer.ggml.model str              = llama
llama_model_loader: - kv  22:                         tokenizer.ggml.pre str              = default
llama_model_loader: - kv  23:                      tokenizer.ggml.tokens arr[str,262208]  = ["<pad>", "<eos>", "<bos>", "<unk>", ...
llama_model_loader: - kv  24:                      tokenizer.ggml.scores arr[f32,262208]  = [-1000.000000, -1000.000000, -1000.00...
llama_model_loader: - kv  25:                  tokenizer.ggml.token_type arr[i32,262208]  = [3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, ...
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 2
llama_model_loader: - kv  27:                tokenizer.ggml.eos_token_id u32              = 106
llama_model_loader: - kv  28:            tokenizer.ggml.unknown_token_id u32              = 3
llama_model_loader: - kv  29:            tokenizer.ggml.padding_token_id u32              = 0
llama_model_loader: - kv  30:               tokenizer.ggml.add_bos_token bool             = true
llama_model_loader: - kv  31:               tokenizer.ggml.add_eos_token bool             = false
llama_model_loader: - kv  32:                    tokenizer.chat_template str              = {{ bos_token }}\n{%- if messages[0]['r...
llama_model_loader: - kv  33:            tokenizer.ggml.add_space_prefix bool             = false
llama_model_loader: - kv  34:               general.quantization_version u32              = 2
llama_model_loader: - kv  35:                          general.file_type u32              = 18
llama_model_loader: - kv  36:                      quantize.imatrix.file str              = gemma-3-27b-it-GGUF/imatrix_unsloth.dat
llama_model_loader: - kv  37:                   quantize.imatrix.dataset str              = unsloth_calibration_gemma-3-27b-it.txt
llama_model_loader: - kv  38:             quantize.imatrix.entries_count i32              = 434
llama_model_loader: - kv  39:              quantize.imatrix.chunks_count i32              = 663
llama_model_loader: - type  f32:  373 tensors
llama_model_loader: - type q8_0:  207 tensors
llama_model_loader: - type q6_K:  228 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q6_K
print_info: file size   = 22.09 GiB (7.03 BPW)
load: special tokens cache size = 6415
load: token to piece cache size = 1.9446 MB
print_info: arch             = gemma3
print_info: vocab_only       = 0
print_info: n_ctx_train      = 131072
print_info: n_embd           = 5376
print_info: n_layer          = 62
print_info: n_head           = 32
print_info: n_head_kv        = 16
print_info: n_rot            = 128
print_info: n_swa            = 1024
print_info: is_swa_any       = 1
print_info: n_embd_head_k    = 128
print_info: n_embd_head_v    = 128
print_info: n_gqa            = 2
print_info: n_embd_k_gqa     = 2048
print_info: n_embd_v_gqa     = 2048
print_info: f_norm_eps       = 0.0e+00
print_info: f_norm_rms_eps   = 1.0e-06
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 0.0e+00
print_info: f_attn_scale     = 7.7e-02
print_info: n_ff             = 21504
print_info: n_expert         = 0
print_info: n_expert_used    = 0
print_info: causal attn      = 1
print_info: pooling type     = 0
print_info: rope type        = 2
print_info: rope scaling     = linear
print_info: freq_base_train  = 1000000.0
print_info: freq_scale_train = 0.125
print_info: n_ctx_orig_yarn  = 131072
print_info: rope_finetuned   = unknown
print_info: ssm_d_conv       = 0
print_info: ssm_d_inner      = 0
print_info: ssm_d_state      = 0
print_info: ssm_dt_rank      = 0
print_info: ssm_dt_b_c_rms   = 0
print_info: model type       = 27B
print_info: model params     = 27.01 B
print_info: general.name     = Gemma-3-27B-It
print_info: vocab type       = SPM
print_info: n_vocab          = 262208
print_info: n_merges         = 0
print_info: BOS token        = 2 '<bos>'
print_info: EOS token        = 106 '<end_of_turn>'
print_info: EOT token        = 106 '<end_of_turn>'
print_info: UNK token        = 3 '<unk>'
print_info: PAD token        = 0 '<pad>'
print_info: LF token         = 248 '<0x0A>'
print_info: EOG token        = 106 '<end_of_turn>'
print_info: max token length = 48
load_tensors: loading model tensors, this can take a while... (mmap = true)
load_tensors: offloading 62 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 63/63 layers to GPU
load_tensors:        CUDA0 model buffer size = 11011.26 MiB
load_tensors:        CUDA1 model buffer size = 11612.91 MiB
load_tensors:   CPU_Mapped model buffer size =  1428.35 MiB
..........................................................................................
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 131072
llama_context: n_ctx_per_seq = 131072
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = 1
llama_context: freq_base     = 1000000.0
llama_context: freq_scale    = 0.125
llama_context:  CUDA_Host  output buffer size =     1.00 MiB
llama_kv_cache_unified_iswa: creating non-SWA KV cache, size = 131072 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =  5120.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =  5120.00 MiB
llama_kv_cache_unified: size = 10240.00 MiB (131072 cells,  10 layers,  1 seqs), K (f16): 5120.00 MiB, V (f16): 5120.00 MiB
llama_kv_cache_unified_iswa: creating     SWA KV cache, size = 1536 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =   324.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =   300.00 MiB
llama_kv_cache_unified: size =  624.00 MiB (  1536 cells,  52 layers,  1 seqs), K (f16):  312.00 MiB, V (f16):  312.00 MiB
llama_context: pipeline parallelism enabled (n_copies=4)
llama_context:      CUDA0 compute buffer size =  1328.51 MiB
llama_context:      CUDA1 compute buffer size =  1124.64 MiB
llama_context:  CUDA_Host compute buffer size =  1046.52 MiB
llama_context: graph nodes  = 2489
llama_context: graph splits = 3
common_init_from_params: KV cache shifting is not supported for this context, disabling KV cache shifting
common_init_from_params: setting dry_penalty_last_n to ctx_size = 131072
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
srv    load_model: loading draft model 'D:\huggingface\hub\models--unsloth--gemma-3-4b-it-GGUF\snapshots\837fb61240cea4985fd23bc904284ee38dd47c1c\gemma-3-4b-it-UD-Q2_K_XL.gguf'
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 3090) - 5484 MiB free
llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 3090) - 4604 MiB free
llama_model_loader: loaded meta data with 40 key-value pairs and 444 tensors from D:\huggingface\hub\models--unsloth--gemma-3-4b-it-GGUF\snapshots\837fb61240cea4985fd23bc904284ee38dd47c1c\gemma-3-4b-it-UD-Q2_K_XL.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv   0:                       general.architecture str              = gemma3
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Gemma-3-4B-It
llama_model_loader: - kv   3:                           general.finetune str              = it
llama_model_loader: - kv   4:                           general.basename str              = Gemma-3-4B-It
llama_model_loader: - kv   5:                       general.quantized_by str              = Unsloth
llama_model_loader: - kv   6:                         general.size_label str              = 4B
llama_model_loader: - kv   7:                           general.repo_url str              = https://huggingface.co/unsloth
llama_model_loader: - kv   8:                      gemma3.context_length u32              = 131072
llama_model_loader: - kv   9:                    gemma3.embedding_length u32              = 2560
llama_model_loader: - kv  10:                         gemma3.block_count u32              = 34
llama_model_loader: - kv  11:                 gemma3.feed_forward_length u32              = 10240
llama_model_loader: - kv  12:                gemma3.attention.head_count u32              = 8
llama_model_loader: - kv  13:    gemma3.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  14:                gemma3.attention.key_length u32              = 256
llama_model_loader: - kv  15:              gemma3.attention.value_length u32              = 256
llama_model_loader: - kv  16:                      gemma3.rope.freq_base f32              = 1000000.000000
llama_model_loader: - kv  17:            gemma3.attention.sliding_window u32              = 1024
llama_model_loader: - kv  18:             gemma3.attention.head_count_kv u32              = 4
llama_model_loader: - kv  19:                   gemma3.rope.scaling.type str              = linear
llama_model_loader: - kv  20:                 gemma3.rope.scaling.factor f32              = 8.000000
llama_model_loader: - kv  21:                       tokenizer.ggml.model str              = llama
llama_model_loader: - kv  22:                         tokenizer.ggml.pre str              = default
llama_model_loader: - kv  23:                      tokenizer.ggml.tokens arr[str,262208]  = ["<pad>", "<eos>", "<bos>", "<unk>", ...
llama_model_loader: - kv  24:                      tokenizer.ggml.scores arr[f32,262208]  = [-1000.000000, -1000.000000, -1000.00...
llama_model_loader: - kv  25:                  tokenizer.ggml.token_type arr[i32,262208]  = [3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, ...
llama_model_loader: - kv  26:                tokenizer.ggml.bos_token_id u32              = 2
llama_model_loader: - kv  27:                tokenizer.ggml.eos_token_id u32              = 106
llama_model_loader: - kv  28:            tokenizer.ggml.unknown_token_id u32              = 3
llama_model_loader: - kv  29:            tokenizer.ggml.padding_token_id u32              = 0
llama_model_loader: - kv  30:               tokenizer.ggml.add_bos_token bool             = true
llama_model_loader: - kv  31:               tokenizer.ggml.add_eos_token bool             = false
llama_model_loader: - kv  32:                    tokenizer.chat_template str              = {{ bos_token }}\n{%- if messages[0]['r...
llama_model_loader: - kv  33:            tokenizer.ggml.add_space_prefix bool             = false
llama_model_loader: - kv  34:               general.quantization_version u32              = 2
llama_model_loader: - kv  35:                          general.file_type u32              = 10
llama_model_loader: - kv  36:                      quantize.imatrix.file str              = gemma-3-4b-it-GGUF/imatrix_unsloth.dat
llama_model_loader: - kv  37:                   quantize.imatrix.dataset str              = unsloth_calibration_gemma-3-4b-it.txt
llama_model_loader: - kv  38:             quantize.imatrix.entries_count i32              = 238
llama_model_loader: - kv  39:              quantize.imatrix.chunks_count i32              = 663
llama_model_loader: - type  f32:  205 tensors
llama_model_loader: - type q2_K:   96 tensors
llama_model_loader: - type q3_K:   87 tensors
llama_model_loader: - type q4_K:    5 tensors
llama_model_loader: - type q6_K:    1 tensors
llama_model_loader: - type iq2_xs:   10 tensors
llama_model_loader: - type iq3_xxs:   10 tensors
llama_model_loader: - type iq3_s:   15 tensors
llama_model_loader: - type iq2_s:   10 tensors
llama_model_loader: - type iq4_xs:    5 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q2_K - Medium
print_info: file size   = 1.64 GiB (3.63 BPW)
load: special tokens cache size = 6415
load: token to piece cache size = 1.9446 MB
print_info: arch             = gemma3
print_info: vocab_only       = 0
print_info: n_ctx_train      = 131072
print_info: n_embd           = 2560
print_info: n_layer          = 34
print_info: n_head           = 8
print_info: n_head_kv        = 4
print_info: n_rot            = 256
print_info: n_swa            = 1024
print_info: is_swa_any       = 1
print_info: n_embd_head_k    = 256
print_info: n_embd_head_v    = 256
print_info: n_gqa            = 2
print_info: n_embd_k_gqa     = 1024
print_info: n_embd_v_gqa     = 1024
print_info: f_norm_eps       = 0.0e+00
print_info: f_norm_rms_eps   = 1.0e-06
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 0.0e+00
print_info: f_attn_scale     = 6.2e-02
print_info: n_ff             = 10240
print_info: n_expert         = 0
print_info: n_expert_used    = 0
print_info: causal attn      = 1
print_info: pooling type     = 0
print_info: rope type        = 2
print_info: rope scaling     = linear
print_info: freq_base_train  = 1000000.0
print_info: freq_scale_train = 0.125
print_info: n_ctx_orig_yarn  = 131072
print_info: rope_finetuned   = unknown
print_info: ssm_d_conv       = 0
print_info: ssm_d_inner      = 0
print_info: ssm_d_state      = 0
print_info: ssm_dt_rank      = 0
print_info: ssm_dt_b_c_rms   = 0
print_info: model type       = 4B
print_info: model params     = 3.88 B
print_info: general.name     = Gemma-3-4B-It
print_info: vocab type       = SPM
print_info: n_vocab          = 262208
print_info: n_merges         = 0
print_info: BOS token        = 2 '<bos>'
print_info: EOS token        = 106 '<end_of_turn>'
print_info: EOT token        = 106 '<end_of_turn>'
print_info: UNK token        = 3 '<unk>'
print_info: PAD token        = 0 '<pad>'
print_info: LF token         = 248 '<0x0A>'
print_info: EOG token        = 106 '<end_of_turn>'
print_info: max token length = 48
load_tensors: loading model tensors, this can take a while... (mmap = true)
load_tensors: offloading 34 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 35/35 layers to GPU
load_tensors:        CUDA0 model buffer size =   623.79 MiB
load_tensors:        CUDA1 model buffer size =  1057.42 MiB
load_tensors:   CPU_Mapped model buffer size =   525.13 MiB
......................................................
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 131072
llama_context: n_ctx_per_seq = 131072
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = 1
llama_context: freq_base     = 1000000.0
llama_context: freq_scale    = 0.125
llama_context:  CUDA_Host  output buffer size =     1.00 MiB
llama_kv_cache_unified_iswa: creating non-SWA KV cache, size = 131072 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =  1536.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =  1024.00 MiB
llama_kv_cache_unified: size = 2560.00 MiB (131072 cells,   5 layers,  1 seqs), K (f16): 1280.00 MiB, V (f16): 1280.00 MiB
llama_kv_cache_unified_iswa: creating     SWA KV cache, size = 1536 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =    90.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =    84.00 MiB
llama_kv_cache_unified: size =  174.00 MiB (  1536 cells,  29 layers,  1 seqs), K (f16):   87.00 MiB, V (f16):   87.00 MiB
llama_context: pipeline parallelism enabled (n_copies=4)
llama_context:      CUDA0 compute buffer size =  1243.51 MiB
llama_context:      CUDA1 compute buffer size =  1075.14 MiB
llama_context:  CUDA_Host compute buffer size =  1041.02 MiB
llama_context: graph nodes  = 1369
llama_context: graph splits = 3
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
srv          init: initializing slots, n_slots = 1
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 131072
llama_context: n_ctx_per_seq = 131072
llama_context: n_batch       = 131072
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = 1
llama_context: freq_base     = 1000000.0
llama_context: freq_scale    = 0.125
llama_context:  CUDA_Host  output buffer size =     1.00 MiB
llama_kv_cache_unified_iswa: creating non-SWA KV cache, size = 131072 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =  1536.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =  1024.00 MiB
llama_kv_cache_unified: size = 2560.00 MiB (131072 cells,   5 layers,  1 seqs), K (f16): 1280.00 MiB, V (f16): 1280.00 MiB
llama_kv_cache_unified_iswa: creating     SWA KV cache, size = 1536 cells
llama_kv_cache_unified:      CUDA0 KV buffer size =    90.00 MiB
llama_kv_cache_unified:      CUDA1 KV buffer size =    84.00 MiB
llama_kv_cache_unified: size =  174.00 MiB (  1536 cells,  29 layers,  1 seqs), K (f16):   87.00 MiB, V (f16):   87.00 MiB
llama_context: pipeline parallelism enabled (n_copies=4)
llama_context:      CUDA0 compute buffer size =  1243.51 MiB
llama_context:      CUDA1 compute buffer size =  1075.14 MiB
llama_context:  CUDA_Host compute buffer size =  1041.02 MiB
llama_context: graph nodes  = 1369
llama_context: graph splits = 3
slot         init: id  0 | task -1 | new slot n_ctx_slot = 131072
main: model loaded
main: chat template, chat_template: {{ bos_token }}
{%- if messages[0]['role'] == 'system' -%}
    {%- if messages[0]['content'] is string -%}
        {%- set first_user_prefix = messages[0]['content'] + '

' -%}
    {%- else -%}
        {%- set first_user_prefix = messages[0]['content'][0]['text'] + '

' -%}
    {%- endif -%}
    {%- set loop_messages = messages[1:] -%}
{%- else -%}
    {%- set first_user_prefix = "" -%}
    {%- set loop_messages = messages -%}
{%- endif -%}
{%- for message in loop_messages -%}
    {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
        {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
    {%- endif -%}
    {%- if (message['role'] == 'assistant') -%}
        {%- set role = "model" -%}
    {%- else -%}
        {%- set role = message['role'] -%}
    {%- endif -%}
    {{ '<start_of_turn>' + role + '
' + (first_user_prefix if loop.first else "") }}
    {%- if message['content'] is string -%}
        {{ message['content'] | trim }}
    {%- elif message['content'] is iterable -%}
        {%- for item in message['content'] -%}
            {%- if item['type'] == 'image' -%}
                {{ '<start_of_image>' }}
            {%- elif item['type'] == 'text' -%}
                {{ item['text'] | trim }}
            {%- endif -%}
        {%- endfor -%}
    {%- else -%}
        {{ raise_exception("Invalid content type") }}
    {%- endif -%}
    {{ '<end_of_turn>
' }}
{%- endfor -%}
{%- if add_generation_prompt -%}
'}}
{%- endif -%}
, example_format: '<start_of_turn>user
You are a helpful assistant

Hello<end_of_turn>
<start_of_turn>model
Hi there<end_of_turn>
<start_of_turn>user
How are you?<end_of_turn>
<start_of_turn>model
'
main: server is listening on http://127.0.0.1:8080 - starting the main loop
srv  update_slots: all slots are idle
srv  params_from_: Chat format: Content-only
slot launch_slot_: id  0 | task 0 | processing task
slot update_slots: id  0 | task 0 | new prompt, n_ctx_slot = 131072, n_keep = 0, n_prompt_tokens = 1891
slot update_slots: id  0 | task 0 | kv cache rm [0, end)
slot update_slots: id  0 | task 0 | prompt processing progress, n_past = 1891, n_tokens = 1891, progress = 1.000000
slot update_slots: id  0 | task 0 | prompt done, n_past = 1891, n_tokens = 1891
slot      release: id  0 | task 0 | stop processing: n_past = 1947, truncated = 0
slot print_timing: id  0 | task 0 |
prompt eval time =    1422.92 ms /  1891 tokens (    0.75 ms per token,  1328.95 tokens per second)
       eval time =    2336.81 ms /    57 tokens (   41.00 ms per token,    24.39 tokens per second)
      total time =    3759.74 ms /  1948 tokens
slot print_timing: id  0 | task 0 |
draft acceptance rate = 0.52542 (   31 accepted /    59 generated)
srv  update_slots: all slots are idle
srv  log_server_r: request: POST /v1/chat/completions 127.0.0.1 200
srv  params_from_: Chat format: Content-only
slot launch_slot_: id  0 | task 14 | processing task
slot update_slots: id  0 | task 14 | new prompt, n_ctx_slot = 131072, n_keep = 0, n_prompt_tokens = 4283
slot update_slots: id  0 | task 14 | n_past = 7, cache_tokens.size() = 1947, seq_id = 0, pos_min = 412, n_swa = 1024
slot update_slots: id  0 | task 14 | forcing full prompt re-processing due to lack of cache data (likely due to SWA, see https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
slot update_slots: id  0 | task 14 | kv cache rm [0, end)
slot update_slots: id  0 | task 14 | prompt processing progress, n_past = 2048, n_tokens = 2048, progress = 0.478170
slot update_slots: id  0 | task 14 | kv cache rm [2048, end)
slot update_slots: id  0 | task 14 | prompt processing progress, n_past = 4096, n_tokens = 2048, progress = 0.956339
slot update_slots: id  0 | task 14 | kv cache rm [4096, end)
slot update_slots: id  0 | task 14 | prompt processing progress, n_past = 4283, n_tokens = 187, progress = 1.000000
slot update_slots: id  0 | task 14 | prompt done, n_past = 4283, n_tokens = 187
decode: failed to find KV cache slot for batch of size 3
decode: failed to find KV cache slot for batch of size 2
slot      release: id  0 | task 14 | stop processing: n_past = 5495, truncated = 0
slot print_timing: id  0 | task 14 |
prompt eval time =    3225.61 ms /  4283 tokens (    0.75 ms per token,  1327.81 tokens per second)
       eval time =   39301.62 ms /  1213 tokens (   32.40 ms per token,    30.86 tokens per second)
      total time =   42527.24 ms /  5496 tokens
slot print_timing: id  0 | task 14 |
draft acceptance rate = 0.71911 (  681 accepted /   947 generated)
srv  update_slots: all slots are idle
srv  log_server_r: request: POST /v1/chat/completions 127.0.0.1 200
srv  params_from_: Chat format: Content-only
slot launch_slot_: id  0 | task 283 | processing task
slot update_slots: id  0 | task 283 | new prompt, n_ctx_slot = 131072, n_keep = 0, n_prompt_tokens = 3060
slot update_slots: id  0 | task 283 | n_past = 7, cache_tokens.size() = 5495, seq_id = 0, pos_min = 3959, n_swa = 1024
slot update_slots: id  0 | task 283 | forcing full prompt re-processing due to lack of cache data (likely due to SWA, see https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
slot update_slots: id  0 | task 283 | kv cache rm [0, end)
slot update_slots: id  0 | task 283 | prompt processing progress, n_past = 2048, n_tokens = 2048, progress = 0.669281
slot update_slots: id  0 | task 283 | kv cache rm [2048, end)
slot update_slots: id  0 | task 283 | prompt processing progress, n_past = 3060, n_tokens = 1012, progress = 1.000000
slot update_slots: id  0 | task 283 | prompt done, n_past = 3060, n_tokens = 1012
decode: failed to find KV cache slot for batch of size 17
get_logits_ith: invalid logits id 0, reason: batch.logits[0] != true

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions