]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CUDA : Fix CUB's argsort when nrows % block_size == 0 CCCL < 3.1 (#21181)
authorOliver Simons <redacted>
Mon, 30 Mar 2026 14:20:00 +0000 (16:20 +0200)
committerGitHub <redacted>
Mon, 30 Mar 2026 14:20:00 +0000 (16:20 +0200)
commit64ac9ab66afa57f7012c83841022827dafb4aebe
tree1afc746c5b153c9646139d48ab35ec4323f0eb3e
parentcad2d3884c75e3b2e4736654295d1f1a5c29aa48
CUDA : Fix CUB's argsort when nrows % block_size == 0 CCCL < 3.1 (#21181)

* CUDA: Fix CUB's argsort when nrows % block_size == 0 CCCL < 3.1

We wrongly calculated offset_grid as `ceildiv(nrows, block_size)`,
while it must be `ceildiv(nrows + 1, block_size)`. As a consequence, we
had uninitialized values in `offset_iterator[nrows]` for the case when
`nrows % block_size == 0`.

Fixes #21162

* Reduce nrows in test case to 256, don't need 768
ggml/src/ggml-cuda/argsort.cu
tests/test-backend-ops.cpp