Skip to content

Misc. bug: fit params does not take vision encoders into account #18181

@verygreen

Description

@verygreen

Name and Version

ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 5 CUDA devices:
Device 0: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
Device 1: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
Device 2: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
Device 3: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, compute capability 12.0, VMM: yes
Device 4: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, compute capability 12.0, VMM: yes
version: 7474 (f9ec885)
built with GNU 15.2.1 for Linux x86_64

Operating systems

Linux

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

llama-server

Command line

./build/bin/llama-server -m /usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/Q8_0/Qwen3-VL-235B-A22B-Instruct-Q8_0-00001-of-00006.gguf --mmproj /usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/mmproj-F32.gguf --port 8081 --host 0.0.0.0 --no-mmap

Problem description & steps to reproduce

Loading up the model like this (it's an unsloth q8_0 quant) results in a visible cuda malloc failure on warmup, but the server keeps starting and then enters a seemingly normal state, but when you give it a request to process it then dies with another malloc failure.

First Bad Commit

b1f3a6e

I think it's the autofit params because without it nothing would even start?

Relevant log output

$ ./build/bin/llama-server -m /usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/Q8_0/Qwen3-VL-235B-A22B-Instruct-Q8_0-00001-of-00006.gguf --mmproj /usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/mmproj-F32.gguf --port 8081 --host 0.0.0.0 --no-mmap
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 5 CUDA devices:
  Device 0: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
  Device 1: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
  Device 2: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes
  Device 3: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, compute capability 12.0, VMM: yes
  Device 4: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, compute capability 12.0, VMM: yes
main: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
build: 7474 (f9ec8858e) with GNU 15.2.1 for Linux x86_64
system info: n_threads = 56, n_threads_batch = 56, total_threads = 112

system_info: n_threads = 56 (n_threads_batch = 56) / 112 | CUDA : ARCHS = 890,1200 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 | 

init: using 111 threads for HTTP server
start: binding port with default address family
main: loading model
srv    load_model: loading model '/usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/Q8_0/Qwen3-VL-235B-A22B-Instruct-Q8_0-00001-of-00006.gguf'
common_init_result: fitting params to device memory, for bugs during this step try to reproduce them with -fit off, or provide --verbose logs if the bug only occurs with -fit on
llama_params_fit_impl: projected memory use with initial parameters [MiB]:
llama_params_fit_impl:   - CUDA0 (NVIDIA GeForce RTX 4090)                          :  24082 total,  28124 used,   4436 deficit
llama_params_fit_impl:   - CUDA1 (NVIDIA GeForce RTX 4090)                          :  24082 total,  27717 used,   4029 deficit
llama_params_fit_impl:   - CUDA2 (NVIDIA GeForce RTX 4090)                          :  24082 total,  24682 used,    995 deficit
llama_params_fit_impl:   - CUDA3 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition):  97250 total, 106608 used,   9919 deficit
llama_params_fit_impl:   - CUDA4 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition):  97250 total, 101170 used,   4481 deficit
llama_params_fit_impl: projected to use 288303 MiB of device memory vs. 266748 MiB of free device memory
llama_params_fit_impl: cannot fulfill margin of 1024 MiB on all devices, need to use 28982 MiB less in total
llama_params_fit_impl: context size reduced from 262144 to 90368 -> need 31537 MiB less memory in total
llama_params_fit_impl: entire model should be fit across devices by reducing context
llama_params_fit_impl: with only dense weights in device memory there is a total surplus of 232762 MiB
llama_params_fit_impl: filling dense-only layers back-to-front:
llama_params_fit_impl:   - CUDA4 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition): 95 layers,  26964 MiB used,  69723 MiB free
llama_params_fit_impl:   - CUDA3 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition):  0 layers,      0 MiB used,  96688 MiB free
llama_params_fit_impl:   - CUDA2 (NVIDIA GeForce RTX 4090)                          :  0 layers,      0 MiB used,  23687 MiB free
llama_params_fit_impl:   - CUDA1 (NVIDIA GeForce RTX 4090)                          :  0 layers,      0 MiB used,  23687 MiB free
llama_params_fit_impl:   - CUDA0 (NVIDIA GeForce RTX 4090)                          :  0 layers,   1640 MiB used,  22047 MiB free
llama_params_fit_impl: converting dense-only layers to full layers and filling them front-to-back with overflow to next device/system memory:
llama_params_fit_impl:   - CUDA0 (NVIDIA GeForce RTX 4090)                          :  8 layers ( 1 overflowing),  22414 MiB used,   1273 MiB free
llama_params_fit_impl:   - CUDA1 (NVIDIA GeForce RTX 4090)                          :  8 layers ( 0 overflowing),  22662 MiB used,   1024 MiB free
llama_params_fit_impl:   - CUDA2 (NVIDIA GeForce RTX 4090)                          :  9 layers ( 1 overflowing),  22079 MiB used,   1607 MiB free
llama_params_fit_impl:   - CUDA3 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition): 35 layers ( 1 overflowing),  95521 MiB used,   1167 MiB free
llama_params_fit_impl:   - CUDA4 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition): 35 layers ( 0 overflowing),  94327 MiB used,   2360 MiB free
llama_params_fit: successfully fit params to free device memory
llama_params_fit: fitting params to free memory took 9.25 seconds
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4090) (0000:82:00.0) - 23687 MiB free
llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4090) (0000:c1:00.0) - 23687 MiB free
llama_model_load_from_file_impl: using device CUDA2 (NVIDIA GeForce RTX 4090) (0000:c2:00.0) - 23687 MiB free
llama_model_load_from_file_impl: using device CUDA3 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition) (0000:01:00.0) - 96688 MiB free
llama_model_load_from_file_impl: using device CUDA4 (NVIDIA RTX PRO 6000 Blackwell Workstation Edition) (0000:81:00.0) - 96688 MiB free
llama_model_loader: additional 5 GGUFs metadata loaded.
llama_model_loader: loaded meta data with 44 key-value pairs and 1131 tensors from /usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/Q8_0/Qwen3-VL-235B-A22B-Instruct-Q8_0-00001-of-00006.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              = qwen3vlmoe
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Qwen3-Vl-235B-A22B-Instruct
llama_model_loader: - kv   3:                           general.finetune str              = Instruct
llama_model_loader: - kv   4:                           general.basename str              = Qwen3-Vl-235B-A22B-Instruct
llama_model_loader: - kv   5:                       general.quantized_by str              = Unsloth
llama_model_loader: - kv   6:                         general.size_label str              = 235B-A22B
llama_model_loader: - kv   7:                            general.license str              = apache-2.0
llama_model_loader: - kv   8:                           general.repo_url str              = https://huggingface.co/unsloth
llama_model_loader: - kv   9:                   general.base_model.count u32              = 1
llama_model_loader: - kv  10:                  general.base_model.0.name str              = Qwen3 VL 235B A22B Instruct
llama_model_loader: - kv  11:          general.base_model.0.organization str              = Qwen
llama_model_loader: - kv  12:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen3-VL-...
llama_model_loader: - kv  13:                               general.tags arr[str,1]       = ["unsloth"]
llama_model_loader: - kv  14:                     qwen3vlmoe.block_count u32              = 94
llama_model_loader: - kv  15:                  qwen3vlmoe.context_length u32              = 262144
llama_model_loader: - kv  16:                qwen3vlmoe.embedding_length u32              = 4096
llama_model_loader: - kv  17:             qwen3vlmoe.feed_forward_length u32              = 12288
llama_model_loader: - kv  18:            qwen3vlmoe.attention.head_count u32              = 64
llama_model_loader: - kv  19:         qwen3vlmoe.attention.head_count_kv u32              = 4
llama_model_loader: - kv  20:                  qwen3vlmoe.rope.freq_base f32              = 5000000.000000
llama_model_loader: - kv  21: qwen3vlmoe.attention.layer_norm_rms_epsilon f32              = 0.000001
llama_model_loader: - kv  22:               qwen3vlmoe.expert_used_count u32              = 8
llama_model_loader: - kv  23:            qwen3vlmoe.attention.key_length u32              = 128
llama_model_loader: - kv  24:          qwen3vlmoe.attention.value_length u32              = 128
llama_model_loader: - kv  25:                          general.file_type u32              = 7
llama_model_loader: - kv  26:                    qwen3vlmoe.expert_count u32              = 128
llama_model_loader: - kv  27:      qwen3vlmoe.expert_feed_forward_length u32              = 1536
llama_model_loader: - kv  28:         qwen3vlmoe.rope.dimension_sections arr[i32,4]       = [24, 20, 20, 0]
llama_model_loader: - kv  29:              qwen3vlmoe.n_deepstack_layers u32              = 3
llama_model_loader: - kv  30:               general.quantization_version u32              = 2
llama_model_loader: - kv  31:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  32:                         tokenizer.ggml.pre str              = qwen2
llama_model_loader: - kv  33:                      tokenizer.ggml.tokens arr[str,151936]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  34:                  tokenizer.ggml.token_type arr[i32,151936]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  35:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  36:                tokenizer.ggml.eos_token_id u32              = 151645
llama_model_loader: - kv  37:            tokenizer.ggml.padding_token_id u32              = 151654
llama_model_loader: - kv  38:                tokenizer.ggml.bos_token_id u32              = 151643
llama_model_loader: - kv  39:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  40:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
llama_model_loader: - kv  41:                                   split.no u16              = 0
llama_model_loader: - kv  42:                                split.count u16              = 6
llama_model_loader: - kv  43:                        split.tensors.count i32              = 1131
llama_model_loader: - type  f32:  471 tensors
llama_model_loader: - type q8_0:  660 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q8_0
print_info: file size   = 232.77 GiB (8.51 BPW) 
load: printing all EOG tokens:
load:   - 151643 ('<|endoftext|>')
load:   - 151645 ('<|im_end|>')
load:   - 151662 ('<|fim_pad|>')
load:   - 151663 ('<|repo_name|>')
load:   - 151664 ('<|file_sep|>')
load: special tokens cache size = 26
load: token to piece cache size = 0.9311 MB
print_info: arch             = qwen3vlmoe
print_info: vocab_only       = 0
print_info: no_alloc         = 0
print_info: n_ctx_train      = 262144
print_info: n_embd           = 4096
print_info: n_embd_inp       = 16384
print_info: n_layer          = 94
print_info: n_head           = 64
print_info: n_head_kv        = 4
print_info: n_rot            = 128
print_info: n_swa            = 0
print_info: is_swa_any       = 0
print_info: n_embd_head_k    = 128
print_info: n_embd_head_v    = 128
print_info: n_gqa            = 16
print_info: n_embd_k_gqa     = 512
print_info: n_embd_v_gqa     = 512
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     = 0.0e+00
print_info: n_ff             = 12288
print_info: n_expert         = 128
print_info: n_expert_used    = 8
print_info: n_expert_groups  = 0
print_info: n_group_used     = 0
print_info: causal attn      = 1
print_info: pooling type     = 0
print_info: rope type        = 40
print_info: rope scaling     = linear
print_info: freq_base_train  = 5000000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn  = 262144
print_info: rope_yarn_log_mul= 0.0000
print_info: rope_finetuned   = unknown
print_info: mrope sections   = [24, 20, 20, 0]
print_info: model type       = 235B.A22B
print_info: model params     = 235.09 B
print_info: general.name     = Qwen3-Vl-235B-A22B-Instruct
print_info: n_ff_exp         = 1536
print_info: vocab type       = BPE
print_info: n_vocab          = 151936
print_info: n_merges         = 151387
print_info: BOS token        = 151643 '<|endoftext|>'
print_info: EOS token        = 151645 '<|im_end|>'
print_info: EOT token        = 151645 '<|im_end|>'
print_info: PAD token        = 151654 '<|vision_pad|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 151659 '<|fim_prefix|>'
print_info: FIM SUF token    = 151661 '<|fim_suffix|>'
print_info: FIM MID token    = 151660 '<|fim_middle|>'
print_info: FIM PAD token    = 151662 '<|fim_pad|>'
print_info: FIM REP token    = 151663 '<|repo_name|>'
print_info: FIM SEP token    = 151664 '<|file_sep|>'
print_info: EOG token        = 151643 '<|endoftext|>'
print_info: EOG token        = 151645 '<|im_end|>'
print_info: EOG token        = 151662 '<|fim_pad|>'
print_info: EOG token        = 151663 '<|repo_name|>'
print_info: EOG token        = 151664 '<|file_sep|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = false)
load_tensors: offloading output layer to GPU
load_tensors: offloading 93 repeating layers to GPU
load_tensors: offloaded 95/95 layers to GPU
load_tensors:        CUDA0 model buffer size = 19362.26 MiB
load_tensors:        CUDA1 model buffer size = 20994.26 MiB
load_tensors:        CUDA2 model buffer size = 20250.54 MiB
load_tensors:        CUDA3 model buffer size = 89095.88 MiB
load_tensors:        CUDA4 model buffer size = 88022.21 MiB
load_tensors:    CUDA_Host model buffer size =   630.59 MiB
....................................................................................................
common_init_result: added <|endoftext|> logit bias = -inf
common_init_result: added <|im_end|> logit bias = -inf
common_init_result: added <|fim_pad|> logit bias = -inf
common_init_result: added <|repo_name|> logit bias = -inf
common_init_result: added <|file_sep|> logit bias = -inf
llama_context: constructing llama_context
llama_context: n_seq_max     = 4
llama_context: n_ctx         = 90368
llama_context: n_ctx_seq     = 90368
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = auto
llama_context: kv_unified    = true
llama_context: freq_base     = 5000000.0
llama_context: freq_scale    = 1
llama_context: n_ctx_seq (90368) < n_ctx_train (262144) -- the full capacity of the model will not be utilized
llama_context:  CUDA_Host  output buffer size =     2.32 MiB
llama_kv_cache:      CUDA0 KV buffer size =  1412.00 MiB
llama_kv_cache:      CUDA1 KV buffer size =  1412.00 MiB
llama_kv_cache:      CUDA2 KV buffer size =  1588.50 MiB
llama_kv_cache:      CUDA3 KV buffer size =  6177.50 MiB
llama_kv_cache:      CUDA4 KV buffer size =  6001.00 MiB
llama_kv_cache: size = 16591.00 MiB ( 90368 cells,  94 layers,  4/1 seqs), K (f16): 8295.50 MiB, V (f16): 8295.50 MiB
llama_context: Flash Attention was auto, set to enabled
llama_context:      CUDA0 compute buffer size =   312.77 MiB
llama_context:      CUDA1 compute buffer size =   256.53 MiB
llama_context:      CUDA2 compute buffer size =   256.27 MiB
llama_context:      CUDA3 compute buffer size =   248.27 MiB
llama_context:      CUDA4 compute buffer size =   304.75 MiB
llama_context:  CUDA_Host compute buffer size =   184.52 MiB
llama_context: graph nodes  = 5929
llama_context: graph splits = 8
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
clip_model_loader: model name:   Qwen3-Vl-235B-A22B-Instruct
clip_model_loader: description:  
clip_model_loader: GGUF version: 3
clip_model_loader: alignment:    32
clip_model_loader: n_tensors:    352
clip_model_loader: n_kv:         31

clip_model_loader: has vision encoder
clip_ctx: CLIP using CUDA0 backend
load_hparams: Qwen-VL models require at minimum 1024 image tokens to function correctly on grounding tasks
load_hparams: if you encounter problems with accuracy, try adding --image-min-tokens 1024
load_hparams: more info: https://github.com/ggml-org/llama.cpp/issues/16842

load_hparams: projector:          qwen3vl_merger
load_hparams: n_embd:             1152
load_hparams: n_head:             16
load_hparams: n_ff:               4304
load_hparams: n_layer:            27
load_hparams: ffn_op:             gelu
load_hparams: projection_dim:     4096

--- vision hparams ---
load_hparams: image_size:         768
load_hparams: patch_size:         16
load_hparams: has_llava_proj:     0
load_hparams: minicpmv_version:   0
load_hparams: n_merge:            2
load_hparams: n_wa_pattern:       0
load_hparams: image_min_pixels:   8192
load_hparams: image_max_pixels:   4194304

load_hparams: model size:         2198.75 MiB
load_hparams: metadata size:      0.12 MiB
warmup: warmup with image size = 1472 x 1472
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 372.08 MiB on device 0: cudaMalloc failed: out of memory
ggml_gallocr_reserve_n_impl: failed to allocate CUDA0 buffer of size 390156544
alloc_compute_meta: graph splits = 1, nodes = 853
warmup: flash attention is enabled
srv    load_model: loaded multimodal model, '/usr/local/ai/models/qwen3-vl-235B-A22B-Instruct/mmproj-F32.gguf'
srv          init: initializing slots, n_slots = 4
slot         init: id  0 | task -1 | new slot, n_ctx = 90368
slot         init: id  1 | task -1 | new slot, n_ctx = 90368
slot         init: id  2 | task -1 | new slot, n_ctx = 90368
slot         init: id  3 | task -1 | new slot, n_ctx = 90368
srv          init: prompt cache is enabled, size limit: 8192 MiB
srv          init: use `--cache-ram 0` to disable the prompt cache
srv          init: for more info see https://github.com/ggml-org/llama.cpp/pull/16391
srv          init: thinking = 0
init: chat template, chat_template: {%- if tools %}
    {{- '<|im_start|>system\n' }}
    {%- if messages[0].role == 'system' %}
        {%- if messages[0].content is string %}
            {{- messages[0].content }}
        {%- else %}
            {%- for content in messages[0].content %}
                {%- if 'text' in content %}
                    {{- content.text }}
                {%- endif %}
            {%- endfor %}
        {%- endif %}
        {{- '\n\n' }}
    {%- endif %}
    {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
    {%- for tool in tools %}
        {{- "\n" }}
        {{- tool | tojson }}
    {%- endfor %}
    {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
{%- else %}
    {%- if messages[0].role == 'system' %}
        {{- '<|im_start|>system\n' }}
        {%- if messages[0].content is string %}
            {{- messages[0].content }}
        {%- else %}
            {%- for content in messages[0].content %}
                {%- if 'text' in content %}
                    {{- content.text }}
                {%- endif %}
            {%- endfor %}
        {%- endif %}
        {{- '<|im_end|>\n' }}
    {%- endif %}
{%- endif %}
{%- set image_count = namespace(value=0) %}
{%- set video_count = namespace(value=0) %}
{%- for message in messages %}
    {%- if message.role == "user" %}
        {{- '<|im_start|>' + message.role + '\n' }}
        {%- if message.content is string %}
            {{- message.content }}
        {%- else %}
            {%- for content in message.content %}
                {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
                    {%- set image_count.value = image_count.value + 1 %}
                    {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
                    <|vision_start|><|image_pad|><|vision_end|>
                {%- elif content.type == 'video' or 'video' in content %}
                    {%- set video_count.value = video_count.value + 1 %}
                    {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
                    <|vision_start|><|video_pad|><|vision_end|>
                {%- elif 'text' in content %}
                    {{- content.text }}
                {%- endif %}
            {%- endfor %}
        {%- endif %}
        {{- '<|im_end|>\n' }}
    {%- elif message.role == "assistant" %}
        {{- '<|im_start|>' + message.role + '\n' }}
        {%- if message.content is string %}
            {{- message.content }}
        {%- else %}
            {%- for content_item in message.content %}
                {%- if 'text' in content_item %}
                    {{- content_item.text }}
                {%- endif %}
            {%- endfor %}
        {%- endif %}
        {%- if message.tool_calls %}
            {%- for tool_call in message.tool_calls %}
                {%- if (loop.first and message.content) or (not loop.first) %}
                    {{- '\n' }}
                {%- endif %}
                {%- if tool_call.function %}
                    {%- set tool_call = tool_call.function %}
                {%- endif %}
                {{- '<tool_call>\n{"name": "' }}
                {{- tool_call.name }}
                {{- '", "arguments": ' }}
                {%- if tool_call.arguments is string %}
                    {{- tool_call.arguments }}
                {%- else %}
                    {{- tool_call.arguments | tojson }}
                {%- endif %}
                {{- '}\n</tool_call>' }}
            {%- endfor %}
        {%- endif %}
        {{- '<|im_end|>\n' }}
    {%- elif message.role == "tool" %}
        {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
            {{- '<|im_start|>user' }}
        {%- endif %}
        {{- '\n<tool_response>\n' }}
        {%- if message.content is string %}
            {{- message.content }}
        {%- else %}
            {%- for content in message.content %}
                {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
                    {%- set image_count.value = image_count.value + 1 %}
                    {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
                    <|vision_start|><|image_pad|><|vision_end|>
                {%- elif content.type == 'video' or 'video' in content %}
                    {%- set video_count.value = video_count.value + 1 %}
                    {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
                    <|vision_start|><|video_pad|><|vision_end|>
                {%- elif 'text' in content %}
                    {{- content.text }}
                {%- endif %}
            {%- endfor %}
        {%- endif %}
        {{- '\n</tool_response>' }}
        {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
            {{- '<|im_end|>\n' }}
        {%- endif %}
    {%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
    {{- '<|im_start|>assistant\n' }}
{%- endif %}
, example_format: '<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Hello<|im_end|>
<|im_start|>assistant
Hi there<|im_end|>
<|im_start|>user
How are you?<|im_end|>
<|im_start|>assistant
'
main: model loaded
main: server is listening on http://0.0.0.0:8081
main: starting the main loop...
srv  update_slots: all slots are idle
srv  params_from_: Chat format: Hermes 2 Pro
slot get_availabl: id  3 | task -1 | selected slot by LRU, t_last = -1
slot launch_slot_: id  3 | task -1 | sampler chain: logits -> penalties -> dry -> top-n-sigma -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist 
slot launch_slot_: id  3 | task 0 | processing task
slot update_slots: id  3 | task 0 | new prompt, n_ctx_slot = 90368, n_keep = 0, task.n_tokens = 8137
slot update_slots: id  3 | task 0 | n_tokens = 0, memory_seq_rm [0, end)
slot update_slots: id  3 | task 0 | prompt processing progress, n_tokens = 8, batch.n_tokens = 8, progress = 0.000983
slot update_slots: id  3 | task 0 | n_tokens = 8, memory_seq_rm [8, end)
srv  process_chun: processing image...
encoding image slice...
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 713.22 MiB on device 0: cudaMalloc failed: out of memory
ggml_gallocr_reserve_n_impl: failed to allocate CUDA0 buffer of size 747861504
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions