]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : fix SpaceMit IME array out-of-bounds in task assignment (#16629)
authormuggle-stack <redacted>
Fri, 17 Oct 2025 10:01:23 +0000 (18:01 +0800)
committerGitHub <redacted>
Fri, 17 Oct 2025 10:01:23 +0000 (13:01 +0300)
commit342c728d031d50673feded797520a44127d73379
tree902f8d6afead0c545e97345deee2b3c85df75a7b
parentababae7e1ec3e9cfdab0322ee55ea3389e82a4d5
ggml : fix SpaceMit IME array out-of-bounds in task assignment (#16629)

Fix incorrect task-to-batch index calculation in the quantization phase.

The bug caused out-of-bounds access to qnbitgemm_args array when
compute_idx exceeded per_gemm_block_count_m, leading to invalid
pointer dereferences and SIGBUS errors.

Correctly map tasks to batches by dividing compute_idx by
per_gemm_block_count_m instead of block_size_m.

Example:
  batch_feature=1, gemm_m=30, block_size_m=4
  per_gemm_block_count_m = 8, task_count = 8

  Old: gemm_idx = 4/4 = 1 (out of bounds  New: gemm_idx = 4/8 = 0 (correct)

Tested on SpaceMit K1 RISC-V64 with qwen2.5:0.5b model.

Co-authored-by: muggle <redacted>
ggml/src/ggml-cpu/spacemit/ime.cpp