Skip to content

Eval bug: CUDA "GGML_ASSERT(stride_row % 2 == 0) failed" when FA off for certain ctx lengths #16976

@mattjcly

Description

@mattjcly

Name and Version

C:\Users\windo\Downloads\llama-b6937-bin-win-cuda-12.4-x64\llama-cli.exe --version
version: 6937 (48bd265)
built with clang version 19.1.5 for x86_64-pc-windows-msvc

Operating systems

Windows

GGML backends

CUDA

Hardware

CPU: 13th Gen Intel(R) Core(TM) i7-13620H
GPU: NVIDIA GeForce RTX 4060 Laptop GPU, 8GB VRAM

Models

Problem description & steps to reproduce

If I run llama-b6868-bin-win-cuda-12.4-x64\llama-cli.exe with -fa 'off' and specific context lengths like -c 2050, -c 1058, -c 1591, I get load crash: mmf.cuh:540: GGML_ASSERT(stride_row % 2 == 0) failed

Can download CUDA release from https://github.com/ggml-org/llama.cpp/releases/tag/b6868 onwards, and run the following to observe:

llama-cli.exe -m C:/Users/windo/.lmstudio/models/lmstudio-community/Qwen2.5-Coder-0.5B-Instruct-GGUF/Qwen2.5-Coder-0.5B-Instruct-Q4_K_M.gguf -c 2050 -fa 'off'

First Bad Commit

85a7d86

Same command works fine from https://github.com/ggml-org/llama.cpp/releases/tag/b6866

Relevant log output

### Broken (b6868, FA OFF)
C:\Users\windo\projects\llama.cpp (HEAD)> C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\llama-cli.exe -m C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.gguf -c 2050 -fa 'off'
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
  Device 0: NVIDIA GeForce RTX 4060 Laptop GPU, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-cuda.dll
load_backend: loaded RPC backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-rpc.dll
load_backend: loaded CPU backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-cpu-alderlake.dll
build: 6868 (85a7d8677) with clang version 19.1.5 for x86_64-pc-windows-msvc
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4060 Laptop GPU) (0000:01:00.0) - 7099 MiB free
llama_model_loader: loaded meta data with 40 key-value pairs and 362 tensors from C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.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              = granite
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Ibm Granite_Granite 4.0 Micro
llama_model_loader: - kv   3:                         general.size_label str              = 3B
llama_model_loader: - kv   4:                        granite.block_count u32              = 40
llama_model_loader: - kv   5:                     granite.context_length u32              = 131072
llama_model_loader: - kv   6:                   granite.embedding_length u32              = 2560
llama_model_loader: - kv   7:                granite.feed_forward_length u32              = 8192
llama_model_loader: - kv   8:               granite.attention.head_count u32              = 40
llama_model_loader: - kv   9:            granite.attention.head_count_kv arr[i32,40]      = [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ...
llama_model_loader: - kv  10:                     granite.rope.freq_base f32              = 10000000.000000
llama_model_loader: - kv  11:   granite.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  12:                       granite.expert_count u32              = 0
llama_model_loader: - kv  13:                  granite.expert_used_count u32              = 0
llama_model_loader: - kv  14:                         granite.vocab_size u32              = 100352
llama_model_loader: - kv  15:               granite.rope.dimension_count u32              = 64
llama_model_loader: - kv  16:                    granite.attention.scale f32              = 0.015625
llama_model_loader: - kv  17:                    granite.embedding_scale f32              = 12.000000
llama_model_loader: - kv  18:                     granite.residual_scale f32              = 0.220000
llama_model_loader: - kv  19:                        granite.logit_scale f32              = 10.000000
llama_model_loader: - kv  20:  granite.expert_shared_feed_forward_length u32              = 8192
llama_model_loader: - kv  21:                    granite.ssm.conv_kernel u32              = 4
llama_model_loader: - kv  22:                     granite.ssm.state_size u32              = 256
llama_model_loader: - kv  23:                    granite.ssm.group_count u32              = 1
llama_model_loader: - kv  24:                     granite.ssm.inner_size u32              = 5120
llama_model_loader: - kv  25:                 granite.ssm.time_step_rank u32              = 128
llama_model_loader: - kv  26:             granite.rope.scaling.finetuned bool             = true
llama_model_loader: - kv  27:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  28:                         tokenizer.ggml.pre str              = dbrx
llama_model_loader: - kv  29:                      tokenizer.ggml.tokens arr[str,100352]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  30:                  tokenizer.ggml.token_type arr[i32,100352]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  31:                      tokenizer.ggml.merges arr[str,100000]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  32:                tokenizer.ggml.bos_token_id u32              = 100257
llama_model_loader: - kv  33:                tokenizer.ggml.eos_token_id u32              = 100257
llama_model_loader: - kv  34:            tokenizer.ggml.unknown_token_id u32              = 100269
llama_model_loader: - kv  35:            tokenizer.ggml.padding_token_id u32              = 100256
llama_model_loader: - kv  36:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  37:                    tokenizer.chat_template str              = {%- set tools_system_message_prefix =...
llama_model_loader: - kv  38:               general.quantization_version u32              = 2
llama_model_loader: - kv  39:                          general.file_type u32              = 15
llama_model_loader: - type  f32:   81 tensors
llama_model_loader: - type q4_K:  240 tensors
llama_model_loader: - type q6_K:   41 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q4_K - Medium
print_info: file size   = 1.95 GiB (4.93 BPW)
load: printing all EOG tokens:
load:   - 100257 ('<|end_of_text|>')
load:   - 100261 ('<|fim_pad|>')
load: special tokens cache size = 96
load: token to piece cache size = 0.6152 MB
print_info: arch             = granite
print_info: vocab_only       = 0
print_info: n_ctx_train      = 131072
print_info: n_embd           = 2560
print_info: n_layer          = 40
print_info: n_head           = 40
print_info: n_head_kv        = 8
print_info: n_rot            = 64
print_info: n_swa            = 0
print_info: is_swa_any       = 0
print_info: n_embd_head_k    = 64
print_info: n_embd_head_v    = 64
print_info: n_gqa            = 5
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-05
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 1.0e+01
print_info: f_attn_scale     = 1.6e-02
print_info: n_ff             = 8192
print_info: n_expert         = 0
print_info: n_expert_used    = 0
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        = 0
print_info: rope scaling     = linear
print_info: freq_base_train  = 10000000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn  = 131072
print_info: rope_finetuned   = yes
print_info: model type       = 3B
print_info: model params     = 3.40 B
print_info: general.name     = Ibm Granite_Granite 4.0 Micro
print_info: f_embedding_scale = 12.000000
print_info: f_residual_scale  = 0.220000
print_info: f_attention_scale = 0.015625
print_info: n_ff_shexp        = 8192
print_info: vocab type       = BPE
print_info: n_vocab          = 100352
print_info: n_merges         = 100000
print_info: BOS token        = 100257 '<|end_of_text|>'
print_info: EOS token        = 100257 '<|end_of_text|>'
print_info: EOT token        = 100257 '<|end_of_text|>'
print_info: UNK token        = 100269 '<|unk|>'
print_info: PAD token        = 100256 '<|pad|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 100258 '<|fim_prefix|>'
print_info: FIM SUF token    = 100260 '<|fim_suffix|>'
print_info: FIM MID token    = 100259 '<|fim_middle|>'
print_info: FIM PAD token    = 100261 '<|fim_pad|>'
print_info: EOG token        = 100257 '<|end_of_text|>'
print_info: EOG token        = 100261 '<|fim_pad|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = true)
load_tensors: offloading 40 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 41/41 layers to GPU
load_tensors:   CPU_Mapped model buffer size =   200.98 MiB
load_tensors:        CUDA0 model buffer size =  1998.84 MiB
....................................................................................
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 2050
llama_context: n_ctx_per_seq = 2050
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = disabled
llama_context: kv_unified    = false
llama_context: freq_base     = 10000000.0
llama_context: freq_scale    = 1
llama_context: n_ctx_per_seq (2050) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
llama_context:  CUDA_Host  output buffer size =     0.38 MiB
llama_kv_cache:      CUDA0 KV buffer size =   160.16 MiB
llama_kv_cache: size =  160.16 MiB (  2050 cells,  40 layers,  1/1 seqs), K (f16):   80.08 MiB, V (f16):   80.08 MiB
llama_context:      CUDA0 compute buffer size =   201.00 MiB
llama_context:  CUDA_Host compute buffer size =    11.01 MiB
llama_context: graph nodes  = 1528
llama_context: graph splits = 2
common_init_from_params: added <|end_of_text|> logit bias = -inf
common_init_from_params: added <|fim_pad|> logit bias = -inf
common_init_from_params: setting dry_penalty_last_n to ctx_size = 2050
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
D:\a\llama.cpp\llama.cpp\ggml\src\ggml-cuda\template-instances\../mmf.cuh:540: GGML_ASSERT(stride_row % 2 == 0) failed

### Working (b6868, FA ON)
C:\Users\windo\projects\llama.cpp (HEAD)> C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\llama-cli.exe -m C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.gguf -c 2050 -fa 'on'
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
  Device 0: NVIDIA GeForce RTX 4060 Laptop GPU, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-cuda.dll
load_backend: loaded RPC backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-rpc.dll
load_backend: loaded CPU backend from C:\Users\windo\Downloads\llama-b6868-bin-win-cuda-12.4-x64\ggml-cpu-alderlake.dll
build: 6868 (85a7d8677) with clang version 19.1.5 for x86_64-pc-windows-msvc
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4060 Laptop GPU) (0000:01:00.0) - 7099 MiB free
llama_model_loader: loaded meta data with 40 key-value pairs and 362 tensors from C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.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              = granite
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Ibm Granite_Granite 4.0 Micro
llama_model_loader: - kv   3:                         general.size_label str              = 3B
llama_model_loader: - kv   4:                        granite.block_count u32              = 40
llama_model_loader: - kv   5:                     granite.context_length u32              = 131072
llama_model_loader: - kv   6:                   granite.embedding_length u32              = 2560
llama_model_loader: - kv   7:                granite.feed_forward_length u32              = 8192
llama_model_loader: - kv   8:               granite.attention.head_count u32              = 40
llama_model_loader: - kv   9:            granite.attention.head_count_kv arr[i32,40]      = [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ...
llama_model_loader: - kv  10:                     granite.rope.freq_base f32              = 10000000.000000
llama_model_loader: - kv  11:   granite.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  12:                       granite.expert_count u32              = 0
llama_model_loader: - kv  13:                  granite.expert_used_count u32              = 0
llama_model_loader: - kv  14:                         granite.vocab_size u32              = 100352
llama_model_loader: - kv  15:               granite.rope.dimension_count u32              = 64
llama_model_loader: - kv  16:                    granite.attention.scale f32              = 0.015625
llama_model_loader: - kv  17:                    granite.embedding_scale f32              = 12.000000
llama_model_loader: - kv  18:                     granite.residual_scale f32              = 0.220000
llama_model_loader: - kv  19:                        granite.logit_scale f32              = 10.000000
llama_model_loader: - kv  20:  granite.expert_shared_feed_forward_length u32              = 8192
llama_model_loader: - kv  21:                    granite.ssm.conv_kernel u32              = 4
llama_model_loader: - kv  22:                     granite.ssm.state_size u32              = 256
llama_model_loader: - kv  23:                    granite.ssm.group_count u32              = 1
llama_model_loader: - kv  24:                     granite.ssm.inner_size u32              = 5120
llama_model_loader: - kv  25:                 granite.ssm.time_step_rank u32              = 128
llama_model_loader: - kv  26:             granite.rope.scaling.finetuned bool             = true
llama_model_loader: - kv  27:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  28:                         tokenizer.ggml.pre str              = dbrx
llama_model_loader: - kv  29:                      tokenizer.ggml.tokens arr[str,100352]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  30:                  tokenizer.ggml.token_type arr[i32,100352]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  31:                      tokenizer.ggml.merges arr[str,100000]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  32:                tokenizer.ggml.bos_token_id u32              = 100257
llama_model_loader: - kv  33:                tokenizer.ggml.eos_token_id u32              = 100257
llama_model_loader: - kv  34:            tokenizer.ggml.unknown_token_id u32              = 100269
llama_model_loader: - kv  35:            tokenizer.ggml.padding_token_id u32              = 100256
llama_model_loader: - kv  36:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  37:                    tokenizer.chat_template str              = {%- set tools_system_message_prefix =...
llama_model_loader: - kv  38:               general.quantization_version u32              = 2
llama_model_loader: - kv  39:                          general.file_type u32              = 15
llama_model_loader: - type  f32:   81 tensors
llama_model_loader: - type q4_K:  240 tensors
llama_model_loader: - type q6_K:   41 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q4_K - Medium
print_info: file size   = 1.95 GiB (4.93 BPW)
load: printing all EOG tokens:
load:   - 100257 ('<|end_of_text|>')
load:   - 100261 ('<|fim_pad|>')
load: special tokens cache size = 96
load: token to piece cache size = 0.6152 MB
print_info: arch             = granite
print_info: vocab_only       = 0
print_info: n_ctx_train      = 131072
print_info: n_embd           = 2560
print_info: n_layer          = 40
print_info: n_head           = 40
print_info: n_head_kv        = 8
print_info: n_rot            = 64
print_info: n_swa            = 0
print_info: is_swa_any       = 0
print_info: n_embd_head_k    = 64
print_info: n_embd_head_v    = 64
print_info: n_gqa            = 5
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-05
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 1.0e+01
print_info: f_attn_scale     = 1.6e-02
print_info: n_ff             = 8192
print_info: n_expert         = 0
print_info: n_expert_used    = 0
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        = 0
print_info: rope scaling     = linear
print_info: freq_base_train  = 10000000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn  = 131072
print_info: rope_finetuned   = yes
print_info: model type       = 3B
print_info: model params     = 3.40 B
print_info: general.name     = Ibm Granite_Granite 4.0 Micro
print_info: f_embedding_scale = 12.000000
print_info: f_residual_scale  = 0.220000
print_info: f_attention_scale = 0.015625
print_info: n_ff_shexp        = 8192
print_info: vocab type       = BPE
print_info: n_vocab          = 100352
print_info: n_merges         = 100000
print_info: BOS token        = 100257 '<|end_of_text|>'
print_info: EOS token        = 100257 '<|end_of_text|>'
print_info: EOT token        = 100257 '<|end_of_text|>'
print_info: UNK token        = 100269 '<|unk|>'
print_info: PAD token        = 100256 '<|pad|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 100258 '<|fim_prefix|>'
print_info: FIM SUF token    = 100260 '<|fim_suffix|>'
print_info: FIM MID token    = 100259 '<|fim_middle|>'
print_info: FIM PAD token    = 100261 '<|fim_pad|>'
print_info: EOG token        = 100257 '<|end_of_text|>'
print_info: EOG token        = 100261 '<|fim_pad|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = true)
load_tensors: offloading 40 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 41/41 layers to GPU
load_tensors:   CPU_Mapped model buffer size =   200.98 MiB
load_tensors:        CUDA0 model buffer size =  1998.84 MiB
....................................................................................
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 2050
llama_context: n_ctx_per_seq = 2050
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = enabled
llama_context: kv_unified    = false
llama_context: freq_base     = 10000000.0
llama_context: freq_scale    = 1
llama_context: n_ctx_per_seq (2050) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
llama_context:  CUDA_Host  output buffer size =     0.38 MiB
llama_kv_cache:      CUDA0 KV buffer size =   160.16 MiB
llama_kv_cache: size =  160.16 MiB (  2050 cells,  40 layers,  1/1 seqs), K (f16):   80.08 MiB, V (f16):   80.08 MiB
llama_context:      CUDA0 compute buffer size =   222.02 MiB
llama_context:  CUDA_Host compute buffer size =     9.02 MiB
llama_context: graph nodes  = 1329
llama_context: graph splits = 2
common_init_from_params: added <|end_of_text|> logit bias = -inf
common_init_from_params: added <|fim_pad|> logit bias = -inf
common_init_from_params: setting dry_penalty_last_n to ctx_size = 2050
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
main: llama threadpool init, n_threads = 10
main: chat template is available, enabling conversation mode (disable it with -no-cnv)
main: chat template example:
<|start_of_role|>system<|end_of_role|>You are a helpful assistant<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Hello<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>Hi there<|end_of_text|>
<|start_of_role|>user<|end_of_role|>How are you?<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>

system_info: n_threads = 10 (n_threads_batch = 10) / 16 | CUDA : ARCHS = 500,610,700,750,800,860,890 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX_VNNI = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |

main: interactive mode on.
sampler seed: 3869448828
sampler params:
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 2050
        top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, top_n_sigma = -1.000, temp = 0.800
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000
sampler chain: logits -> logit-bias -> penalties -> dry -> top-n-sigma -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
generate: n_ctx = 2050, n_batch = 2048, n_predict = -1, n_keep = 0

== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Not using system message. To change it, set a different value via -sys PROMPT


>

#### Working (b6866, FA OFF)
C:\Users\windo\projects\llama.cpp (HEAD)> C:\Users\windo\Downloads\llama-b6866-bin-win-cuda-12.4-x64\llama-cli.exe -m C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.gguf -c 2050 -fa 'off'
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
  Device 0: NVIDIA GeForce RTX 4060 Laptop GPU, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from C:\Users\windo\Downloads\llama-b6866-bin-win-cuda-12.4-x64\ggml-cuda.dll
load_backend: loaded RPC backend from C:\Users\windo\Downloads\llama-b6866-bin-win-cuda-12.4-x64\ggml-rpc.dll
load_backend: loaded CPU backend from C:\Users\windo\Downloads\llama-b6866-bin-win-cuda-12.4-x64\ggml-cpu-alderlake.dll
build: 6866 (8284efc35) with clang version 19.1.5 for x86_64-pc-windows-msvc
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4060 Laptop GPU) (0000:01:00.0) - 7099 MiB free
llama_model_loader: loaded meta data with 40 key-value pairs and 362 tensors from C:/Users/windo/.lmstudio/models/lmstudio-community/granite-4.0-micro-GGUF/granite-4.0-micro-Q4_K_M.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              = granite
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Ibm Granite_Granite 4.0 Micro
llama_model_loader: - kv   3:                         general.size_label str              = 3B
llama_model_loader: - kv   4:                        granite.block_count u32              = 40
llama_model_loader: - kv   5:                     granite.context_length u32              = 131072
llama_model_loader: - kv   6:                   granite.embedding_length u32              = 2560
llama_model_loader: - kv   7:                granite.feed_forward_length u32              = 8192
llama_model_loader: - kv   8:               granite.attention.head_count u32              = 40
llama_model_loader: - kv   9:            granite.attention.head_count_kv arr[i32,40]      = [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ...
llama_model_loader: - kv  10:                     granite.rope.freq_base f32              = 10000000.000000
llama_model_loader: - kv  11:   granite.attention.layer_norm_rms_epsilon f32              = 0.000010
llama_model_loader: - kv  12:                       granite.expert_count u32              = 0
llama_model_loader: - kv  13:                  granite.expert_used_count u32              = 0
llama_model_loader: - kv  14:                         granite.vocab_size u32              = 100352
llama_model_loader: - kv  15:               granite.rope.dimension_count u32              = 64
llama_model_loader: - kv  16:                    granite.attention.scale f32              = 0.015625
llama_model_loader: - kv  17:                    granite.embedding_scale f32              = 12.000000
llama_model_loader: - kv  18:                     granite.residual_scale f32              = 0.220000
llama_model_loader: - kv  19:                        granite.logit_scale f32              = 10.000000
llama_model_loader: - kv  20:  granite.expert_shared_feed_forward_length u32              = 8192
llama_model_loader: - kv  21:                    granite.ssm.conv_kernel u32              = 4
llama_model_loader: - kv  22:                     granite.ssm.state_size u32              = 256
llama_model_loader: - kv  23:                    granite.ssm.group_count u32              = 1
llama_model_loader: - kv  24:                     granite.ssm.inner_size u32              = 5120
llama_model_loader: - kv  25:                 granite.ssm.time_step_rank u32              = 128
llama_model_loader: - kv  26:             granite.rope.scaling.finetuned bool             = true
llama_model_loader: - kv  27:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  28:                         tokenizer.ggml.pre str              = dbrx
llama_model_loader: - kv  29:                      tokenizer.ggml.tokens arr[str,100352]  = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv  30:                  tokenizer.ggml.token_type arr[i32,100352]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv  31:                      tokenizer.ggml.merges arr[str,100000]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv  32:                tokenizer.ggml.bos_token_id u32              = 100257
llama_model_loader: - kv  33:                tokenizer.ggml.eos_token_id u32              = 100257
llama_model_loader: - kv  34:            tokenizer.ggml.unknown_token_id u32              = 100269
llama_model_loader: - kv  35:            tokenizer.ggml.padding_token_id u32              = 100256
llama_model_loader: - kv  36:               tokenizer.ggml.add_bos_token bool             = false
llama_model_loader: - kv  37:                    tokenizer.chat_template str              = {%- set tools_system_message_prefix =...
llama_model_loader: - kv  38:               general.quantization_version u32              = 2
llama_model_loader: - kv  39:                          general.file_type u32              = 15
llama_model_loader: - type  f32:   81 tensors
llama_model_loader: - type q4_K:  240 tensors
llama_model_loader: - type q6_K:   41 tensors
print_info: file format = GGUF V3 (latest)
print_info: file type   = Q4_K - Medium
print_info: file size   = 1.95 GiB (4.93 BPW)
load: printing all EOG tokens:
load:   - 100257 ('<|end_of_text|>')
load:   - 100261 ('<|fim_pad|>')
load: special tokens cache size = 96
load: token to piece cache size = 0.6152 MB
print_info: arch             = granite
print_info: vocab_only       = 0
print_info: n_ctx_train      = 131072
print_info: n_embd           = 2560
print_info: n_layer          = 40
print_info: n_head           = 40
print_info: n_head_kv        = 8
print_info: n_rot            = 64
print_info: n_swa            = 0
print_info: is_swa_any       = 0
print_info: n_embd_head_k    = 64
print_info: n_embd_head_v    = 64
print_info: n_gqa            = 5
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-05
print_info: f_clamp_kqv      = 0.0e+00
print_info: f_max_alibi_bias = 0.0e+00
print_info: f_logit_scale    = 1.0e+01
print_info: f_attn_scale     = 1.6e-02
print_info: n_ff             = 8192
print_info: n_expert         = 0
print_info: n_expert_used    = 0
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        = 0
print_info: rope scaling     = linear
print_info: freq_base_train  = 10000000.0
print_info: freq_scale_train = 1
print_info: n_ctx_orig_yarn  = 131072
print_info: rope_finetuned   = yes
print_info: model type       = 3B
print_info: model params     = 3.40 B
print_info: general.name     = Ibm Granite_Granite 4.0 Micro
print_info: f_embedding_scale = 12.000000
print_info: f_residual_scale  = 0.220000
print_info: f_attention_scale = 0.015625
print_info: n_ff_shexp        = 8192
print_info: vocab type       = BPE
print_info: n_vocab          = 100352
print_info: n_merges         = 100000
print_info: BOS token        = 100257 '<|end_of_text|>'
print_info: EOS token        = 100257 '<|end_of_text|>'
print_info: EOT token        = 100257 '<|end_of_text|>'
print_info: UNK token        = 100269 '<|unk|>'
print_info: PAD token        = 100256 '<|pad|>'
print_info: LF token         = 198 'Ċ'
print_info: FIM PRE token    = 100258 '<|fim_prefix|>'
print_info: FIM SUF token    = 100260 '<|fim_suffix|>'
print_info: FIM MID token    = 100259 '<|fim_middle|>'
print_info: FIM PAD token    = 100261 '<|fim_pad|>'
print_info: EOG token        = 100257 '<|end_of_text|>'
print_info: EOG token        = 100261 '<|fim_pad|>'
print_info: max token length = 256
load_tensors: loading model tensors, this can take a while... (mmap = true)
load_tensors: offloading 40 repeating layers to GPU
load_tensors: offloading output layer to GPU
load_tensors: offloaded 41/41 layers to GPU
load_tensors:   CPU_Mapped model buffer size =   200.98 MiB
load_tensors:        CUDA0 model buffer size =  1998.84 MiB
....................................................................................
llama_context: constructing llama_context
llama_context: n_seq_max     = 1
llama_context: n_ctx         = 2050
llama_context: n_ctx_per_seq = 2050
llama_context: n_batch       = 2048
llama_context: n_ubatch      = 512
llama_context: causal_attn   = 1
llama_context: flash_attn    = disabled
llama_context: kv_unified    = false
llama_context: freq_base     = 10000000.0
llama_context: freq_scale    = 1
llama_context: n_ctx_per_seq (2050) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
llama_context:  CUDA_Host  output buffer size =     0.38 MiB
llama_kv_cache:      CUDA0 KV buffer size =   162.50 MiB
llama_kv_cache: size =  162.50 MiB (  2080 cells,  40 layers,  1/1 seqs), K (f16):   81.25 MiB, V (f16):   81.25 MiB
llama_context:      CUDA0 compute buffer size =   201.00 MiB
llama_context:  CUDA_Host compute buffer size =    11.07 MiB
llama_context: graph nodes  = 1528
llama_context: graph splits = 2
common_init_from_params: added <|end_of_text|> logit bias = -inf
common_init_from_params: added <|fim_pad|> logit bias = -inf
common_init_from_params: setting dry_penalty_last_n to ctx_size = 2080
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
main: llama threadpool init, n_threads = 10
main: chat template is available, enabling conversation mode (disable it with -no-cnv)
main: chat template example:
<|start_of_role|>system<|end_of_role|>You are a helpful assistant<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Hello<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>Hi there<|end_of_text|>
<|start_of_role|>user<|end_of_role|>How are you?<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>

system_info: n_threads = 10 (n_threads_batch = 10) / 16 | CUDA : ARCHS = 500,610,700,750,800,860,890 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX_VNNI = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |

main: interactive mode on.
sampler seed: 983769881
sampler params:
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 2080
        top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, top_n_sigma = -1.000, temp = 0.800
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000
sampler chain: logits -> logit-bias -> penalties -> dry -> top-n-sigma -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
generate: n_ctx = 2080, n_batch = 2048, n_predict = -1, n_keep = 0

== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Not using system message. To change it, set a different value via -sys PROMPT


>

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions