]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
CUDA : Fix CUB's argsort when nrows % block_size == 0 CCCL < 3.1 (llama/21181)
authorOliver Simons <redacted>
Mon, 30 Mar 2026 14:20:00 +0000 (16:20 +0200)
committerGeorgi Gerganov <redacted>
Wed, 1 Apr 2026 13:00:26 +0000 (16:00 +0300)
commit9e9adf696bd0e7da80d5166a8a4c214b5f2027cb
tree7f0a527ec075f22111ec186e750e437e4c625cc7
parentc08c9f4eb53048e9d5381379bb674d9160bdc42f
CUDA : Fix CUB's argsort when nrows % block_size == 0 CCCL < 3.1 (llama/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
src/ggml-cuda/argsort.cu
tests/test-backend-ops.cpp