CompressedGemma commited on
Commit
1b15c64
·
verified ·
1 Parent(s): 43faf5d

Upload patch_llamacpp_hpcq_seg.py

Browse files
Files changed (1) hide show
  1. patch_llamacpp_hpcq_seg.py +1 -2
patch_llamacpp_hpcq_seg.py CHANGED
@@ -180,8 +180,7 @@ void ggml_hpcq_seg_bind_raw(
180
  if (n_labels == 0 || (n_labels % 256) != 0) return;
181
  const int64_t n_blocks = (int64_t) (n_labels / 256);
182
  if (n_blocks * block_bytes != n_bytes) return;
183
- const size_t stride = (enc == 0) ? 128u : 256u;
184
- const size_t need = (size_t) n_blocks * stride;
185
  if (hqs1_len < 10u + need) return;
186
 
187
  const uintptr_t base = (uintptr_t) payload;
 
180
  if (n_labels == 0 || (n_labels % 256) != 0) return;
181
  const int64_t n_blocks = (int64_t) (n_labels / 256);
182
  if (n_blocks * block_bytes != n_bytes) return;
183
+ const size_t need = hpcq_seg_packed_bytes(n_blocks, enc);
 
184
  if (hqs1_len < 10u + need) return;
185
 
186
  const uintptr_t base = (uintptr_t) payload;