Skip to content

Bug: Command-A Spits incoherence when using -sm row #633

@Ph0rk0z

Description

@Ph0rk0z

What happened?

Command-A speeds for IK are higher than mainline, especially since they broke something recently to knock it back from 15t/s to 12t/s. I still see 15s in YALS which uses an older commit. Prompt processing drops from 350 to 140, but I assume that's a facet of using SM row and can't be fixed. Mainline does it too.

Here, I get 17, almost 18t/s, unfortunately the result is as follows:

Image

Is it KVcache related? SM row puts the cache all on GPU0.

SM layer works correctly but T/G speeds suffer.

Name and Version

Git latest.

What operating system are you seeing the problem on?

Linux

Relevant log output

CUDA_VISIBLE_DEVICES=0,1,2,3 ./bin/llama-server \
    -c 32768 \
    --host 192.168.1.211 \
    -ngl 99 \
    -ctk q8_0 \
    -ctv q8_0 \
    -fa \
    -sm row \
    -b 2048 \
    -ub 2048 
INFO [                    main] build info | tid="139717304852480" timestamp=1753018161 build=3829 commit="f1323339"
INFO [                    main] system info | tid="139717304852480" timestamp=1753018161 n_threads=48 n_threads_batch=-1 total_threads=96 system_info="AVX = 1 | AVX_VNNI = 0 | AVX2 = 1 | AVX512 = 1 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | FMA = 1 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 1 | "
llama_model_loader: additional 1 GGUFs metadata loaded.
llama_model_loader: loaded meta data with 47 key-value pairs and 514 tensors from Agatha-111B-v1-Q4_K_L/Agatha-111B-v1-Q4_K_L-00001-of-00002.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              = cohere2
llama_model_loader: - kv   1:                               general.type str              = model
llama_model_loader: - kv   2:                               general.name str              = Agatha 111B v1
llama_model_loader: - kv   3:                            general.version str              = v1
llama_model_loader: - kv   4:                           general.basename str              = Agatha
llama_model_loader: - kv   5:                         general.size_label str              = 111B
llama_model_loader: - kv   6:                   general.base_model.count u32              = 1
llama_model_loader: - kv   7:                  general.base_model.0.name str              = C4Ai Command A 03 2025
llama_model_loader: - kv   8:               general.base_model.0.version str              = 03-2025
llama_model_loader: - kv   9:          general.base_model.0.organization str              = CohereLabs
llama_model_loader: - kv  10:              general.base_model.0.repo_url str              = https://huggingface.co/CohereLabs/c4a...
llama_model_loader: - kv  11:                        cohere2.block_count u32              = 64
llama_model_loader: - kv  12:                     cohere2.context_length u32              = 262144
llama_model_loader: - kv  13:                   cohere2.embedding_length u32              = 12288
llama_model_loader: - kv  14:                cohere2.feed_forward_length u32              = 36864
llama_model_loader: - kv  15:               cohere2.attention.head_count u32              = 96
llama_model_loader: - kv  16:            cohere2.attention.head_count_kv u32              = 8
llama_model_loader: - kv  17:                     cohere2.rope.freq_base f32              = 50000.000000
llama_model_loader: - kv  18:       cohere2.attention.layer_norm_epsilon f32              = 0.000010
llama_model_loader: - kv  19:               cohere2.attention.key_length u32              = 128
llama_model_loader: - kv  20:             cohere2.attention.value_length u32              = 128
llama_model_loader: - kv  21:                        cohere2.logit_scale f32              = 0.250000
llama_model_loader: - kv  22:           cohere2.attention.sliding_window u32              = 4096
llama_model_loader: - kv  23:                         cohere2.vocab_size u32              = 256000
llama_model_loader: - kv  24:               cohere2.rope.dimension_count u32              = 128
llama_model_loader: - kv  25:                  cohere2.rope.scaling.type str              = none
llama_model_loader: - kv  26:                       tokenizer.ggml.model str              = gpt2
llama_model_loader: - kv  27:                         tokenizer.ggml.pre str              = command-r
llama_model_loader: - kv  28:                      tokenizer.ggml.tokens arr[str,256000]  = ["<PAD>", "<UNK>", "<CLS>", "<SEP>", ...
llama_model_loader: - kv  29:                  tokenizer.ggml.token_type arr[i32,256000]  = [3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, ...
llama_model_loader: - kv  30:                      tokenizer.ggml.merges arr[str,253333]  = ["Ġ Ġ", "Ġ t", "e r", "i n", "Ġ a...
llama_model_loader: - kv  31:                tokenizer.ggml.bos_token_id u32              = 5
llama_model_loader: - kv  32:                tokenizer.ggml.eos_token_id u32              = 255001
llama_model_loader: - kv  33:            tokenizer.ggml.unknown_token_id u32              = 1
llama_model_loader: - kv  34:            tokenizer.ggml.padding_token_id u32              = 0
llama_model_loader: - kv  35:               tokenizer.ggml.add_bos_token bool             = true
llama_model_loader: - kv  36:               tokenizer.ggml.add_eos_token bool             = false
llama_model_loader: - kv  37:                    tokenizer.chat_template str              = {{ bos_token }}{% if documents %}\n{% ...
llama_model_loader: - kv  38:               general.quantization_version u32              = 2
llama_model_loader: - kv  39:                          general.file_type u32              = 15
llama_model_loader: - kv  40:                      quantize.imatrix.file str              = /models_out/Agatha-111B-v1-GGUF/TheDr...
llama_model_loader: - kv  41:                   quantize.imatrix.dataset str              = /training_dir/calibration_datav3.txt
llama_model_loader: - kv  42:             quantize.imatrix.entries_count i32              = 448
llama_model_loader: - kv  43:              quantize.imatrix.chunks_count i32              = 509
llama_model_loader: - kv  44:                                   split.no u16              = 0
llama_model_loader: - kv  45:                        split.tensors.count i32              = 514
llama_model_loader: - kv  46:                                split.count u16              = 2
llama_model_loader: - type  f32:   65 tensors
llama_model_loader: - type q8_0:    1 tensors
llama_model_loader: - type q4_K:  384 tensors
llama_model_loader: - type q6_K:   64 tensors
llm_load_vocab: special tokens cache size = 41
llm_load_vocab: token to piece cache size = 1.8428 MB
llm_load_print_meta: format           = GGUF V3 (latest)
llm_load_print_meta: arch             = cohere2
llm_load_print_meta: vocab type       = BPE
llm_load_print_meta: n_vocab          = 256000
llm_load_print_meta: n_merges         = 253333
llm_load_print_meta: vocab_only       = 0
llm_load_print_meta: n_ctx_train      = 262144
llm_load_print_meta: n_embd           = 12288
llm_load_print_meta: n_layer          = 64
llm_load_print_meta: n_head           = 96
llm_load_print_meta: n_head_kv        = 8
llm_load_print_meta: n_rot            = 128
llm_load_print_meta: n_swa            = 4096
llm_load_print_meta: n_swa_pattern    = 4
llm_load_print_meta: n_embd_head_k    = 128
llm_load_print_meta: n_embd_head_v    = 128
llm_load_print_meta: n_gqa            = 12
llm_load_print_meta: n_embd_k_gqa     = 1024
llm_load_print_meta: n_embd_v_gqa     = 1024
llm_load_print_meta: f_norm_eps       = 1.0e-05
llm_load_print_meta: f_norm_rms_eps   = 0.0e+00
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    = 2.5e-01
llm_load_print_meta: n_ff             = 36864
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     = none
llm_load_print_meta: freq_base_train  = 50000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn  = 262144
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       = ?B
llm_load_print_meta: model ftype      = Q4_K - Medium
llm_load_print_meta: model params     = 111.058 B
llm_load_print_meta: model size       = 63.224 GiB (4.890 BPW) 
llm_load_print_meta: general.name     = Agatha 111B v1
llm_load_print_meta: BOS token        = 5 '<BOS_TOKEN>'
llm_load_print_meta: EOS token        = 255001 '<|END_OF_TURN_TOKEN|>'
llm_load_print_meta: UNK token        = 1 '<UNK>'
llm_load_print_meta: PAD token        = 0 '<PAD>'
llm_load_print_meta: LF token         = 136 'Ä'
llm_load_print_meta: max token length = 1024
ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 4 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
  Device 2: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
  Device 3: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes
llm_load_tensors: ggml ctx size =    0.74 MiB
llm_load_tensors: offloading 64 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 65/65 layers to GPU
llm_load_tensors: CUDA_Split buffer size = 64738.50 MiB
llm_load_tensors:        CPU buffer size =  3187.50 MiB
llm_load_tensors:      CUDA0 buffer size =     3.05 MiB
..............................................................................................
llama_new_context_with_model: n_ctx      = 32768
llama_new_context_with_model: n_batch    = 2048
llama_new_context_with_model: n_ubatch   = 2048
llama_new_context_with_model: flash_attn = 1
llama_new_context_with_model: mla_attn   = 0
llama_new_context_with_model: attn_max_b = 0
llama_new_context_with_model: fused_moe  = 0
llama_new_context_with_model: ser        = -1, 0
llama_new_context_with_model: freq_base  = 50000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init:      CUDA0 KV buffer size =  4352.03 MiB
llama_new_context_with_model: KV self size  = 4352.00 MiB, K (q8_0): 2176.00 MiB, V (q8_0): 2176.00 MiB
llama_new_context_with_model:  CUDA_Host  output buffer size =     1.95 MiB
llama_new_context_with_model:      CUDA0 compute buffer size =  2096.00 MiB
llama_new_context_with_model:  CUDA_Host compute buffer size =   608.02 MiB
llama_new_context_with_model: graph nodes  = 1578
llama_new_context_with_model: graph splits = 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions