Files
llama.cpp/ggml/src/ggml-cuda
hey-gmandOliver Simons 1167d3f42c CUDA: fix CCCL version guard breaking on major version rollover (#29453)
* CUDA: fix CCCL version guard breaking on major version rollover

The guard compared the major and minor components independently:

    CCCL_MAJOR_VERSION >= 3 && CCCL_MINOR_VERSION >= 1

Minor resets to 0 whenever a new major series is cut, so on CCCL 4.x
this evaluates as 4 >= 3 && 0 >= 1, i.e. false. STRIDED_ITERATOR_AVAILABLE
stops being defined and argsort silently falls back to the
init_offsets path. Nothing warns and the build still succeeds, so the
regression is a quiet performance loss rather than a compile error.

CCCL already exposes the version as a single packed integer in
MMMmmmpp form, which is what its own version header uses:

    CCCL_VERSION = MAJOR * 1000000 + MINOR * 1000 + PATCH

so 3.4.3 is 3004003 and ">= 3.1" is a plain ">= 3001000". One
comparison, with no component arithmetic left to get wrong.

Checked against a hand-written "version >= 3.1" reference over 2.9.9,
3.0.0, 3.1.0, 3.1.99, 3.2.0, 3.4.3, 3.9.9, 3.99.99, 4.0.0, 4.2.7 and
5.0.0: no divergences. The old guard disagreed at 4.0.0 and 5.0.0.

Verified on RTX 4070 (sm_89), CUDA 13.4, CCCL 3.4.3:

  - cmake --build build --config Release: exit 0
  - test-backend-ops test -o ARGSORT -b CUDA0: 98/98 passed, CUDA0 OK

Note that a passing regression test does not on its own prove the guard
is still taken, since the fallback path passes too. Preprocessing the
real translation unit confirms the strided-iterator branch is the one
compiled in: counting_iterator is present, init_offsets is not.

Signed-off-by: Heitor <heitorgm@outlook.com>

* Update ggml/src/ggml-cuda/argsort.cu

* Apply suggestion from @ORippler

---------

Signed-off-by: Heitor <heitorgm@outlook.com>
Co-authored-by: Oliver Simons <osimons@nvidia.com>
2026-10-08 15:29:34 +02:00
..
2025-08-20 10:17:37 +08:00
2025-08-05 22:10:36 +03:00
2026-04-10 10:24:09 +08:00
2026-06-18 22:23:01 +02:00
2026-06-18 22:23:01 +02:00
2025-06-20 09:50:24 +08:00
2025-08-28 20:33:03 +02:00
2026-07-30 12:33:25 +03:00
2025-12-09 20:28:57 +01:00
2025-12-09 20:28:57 +01:00
2026-09-16 16:00:01 +08:00
2025-12-08 21:10:12 +08:00
2026-07-30 12:33:25 +03:00
2025-06-22 12:39:54 +08:00
2026-10-04 22:48:30 +02:00
2026-08-23 10:37:32 +03:00
2026-08-23 10:37:32 +03:00
2025-07-29 14:45:18 +08:00
2025-07-29 14:22:03 +02:00
2025-03-31 18:05:13 +02:00
2025-06-22 12:39:54 +08:00
2026-08-30 23:00:02 +08:00
2025-11-30 21:57:31 +01:00