koboldcpp/ggml/src
Oliver Simons 6ed481eea4
CUDA: Check PTX version on host side to guard PDL dispatch (#23530)
* CUDA: Check PTX version on host side to guard PDL dispatch

Checking on `__CUDA_ARCH_LIST__` alone is insufficient for JIT, as this
variable doesn't differentiate between compiling for say sm_90, sm_90a
or sm_90f (so forward-jittable PTX vs. arch/family-specific PTX).

Thus, one can have a bug when compiling with
`DCMAKE_CUDA_ARCHITECTURES="89;90a"`, where current code would wrongly
dispatch to PDL on sm_90/sm_120 in forward-JIT mode.

This PR fixes this issue by checking `cudaFuncAttributes::ptxVersion` of
the incoming kernel at runtime. A check on ptxVersion alone is
sufficient, as device-codes will always be >= ptxVersion (and any
violation of this would be a severe bug in CUDA/nvcc), see:
 https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#gpu-code-code-code

* Implement MurmurHash3 mixer for better hash distribution

Magic constants were taken from boost:
2698b43803/include/boost/container_hash/detail/hash_mix.hpp (L19-L65)

* Update ggml/src/ggml-cuda/common.cuh

Co-authored-by: Johannes Gäßler <johannesg@5d6.de>

* Address review comments, make seed non-zero

* Apply code-formatting

* Replace std::size_t -> size_t for consistency

---------

Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
2026-05-29 12:28:18 +02:00
..
ggml-blas vulkan: add get/set tensor 2d functions (#22514) 2026-04-30 17:37:13 +02:00
ggml-cann vulkan: add get/set tensor 2d functions (#22514) 2026-04-30 17:37:13 +02:00
ggml-cpu model : support for DeepseekV32ForCausalLM with generic DeepSeek Sparse Attention (DSA) implementation (#23346) 2026-05-29 10:15:17 +02:00
ggml-cuda CUDA: Check PTX version on host side to guard PDL dispatch (#23530) 2026-05-29 12:28:18 +02:00
ggml-hexagon hexagon: basic/generic op fusion support and RMS_NORM+MUL fusion (#23835) 2026-05-28 14:05:54 -07:00
ggml-hip ggml: backend-agnostic tensor parallelism (experimental) (#19378) 2026-04-09 16:42:19 +02:00
ggml-metal metal : add apple device id (#23566) 2026-05-25 21:05:16 +03:00
ggml-musa ggml-cuda: native bf16 flash attention for vec kernel (#20525) 2026-03-22 11:05:51 +01:00
ggml-opencl opencl: move backend info printing into its own function (#23702) 2026-05-28 11:05:42 -07:00
ggml-openvino openvino: driver setup, CI split, thread safety, and NPU optimizations (#21944) 2026-04-21 18:58:34 +03:00
ggml-rpc rpc : keep last_graph_uid in the device context (#23273) 2026-05-19 09:42:36 +03:00
ggml-sycl SYCL: implement ggml_sycl_pool_vmm (#22862) 2026-05-26 07:59:00 +03:00
ggml-virtgpu ggml-virtgpu : include missing mutex header (#22810) 2026-05-10 17:32:41 +02:00
ggml-vulkan vulkan: fast path for walsh-hadamard transform (#23687) 2026-05-28 13:18:43 +02:00
ggml-webgpu ggml-webgpu: remove legacy constants (#23672) 2026-05-27 14:22:33 -07:00
ggml-zdnn vulkan: add get/set tensor 2d functions (#22514) 2026-04-30 17:37:13 +02:00
ggml-zendnn ggml-zendnn : fixed naming of matmul function (#20964) 2026-05-27 00:59:35 +02:00
CMakeLists.txt ggml : Parallelize quant LUT init (#23595) 2026-05-25 10:15:46 +03:00
ggml-alloc.c ggml-alloc: fix out-of-bounds read in ggml_dyn_tallocr_remove_block (ggml/1492) 2026-05-25 12:38:01 +03:00
ggml-backend-dl.cpp hexagon: enable offloading to Hexagon on Windows on Snapdragon (#19150) 2026-01-29 12:33:21 -08:00
ggml-backend-dl.h hexagon: enable offloading to Hexagon on Windows on Snapdragon (#19150) 2026-01-29 12:33:21 -08:00
ggml-backend-impl.h ggml: backend-agnostic tensor parallelism (experimental) (#19378) 2026-04-09 16:42:19 +02:00
ggml-backend-meta.cpp meta : Add missing buffer set in allreduce fallback !COMPUTE clear (#23480) 2026-05-29 06:30:24 +03:00
ggml-backend-reg.cpp ggml : skip already registered backends and devices (#22296) 2026-04-28 10:02:32 +03:00
ggml-backend.cpp ggml : Check the right iface method before using the fallback 2d get (#23514) 2026-05-23 12:49:24 +02:00
ggml-common.h ggml: add Q1_0 1-bit quantization support (CPU) (#21273) 2026-04-06 20:55:21 +02:00
ggml-impl.h ggml: add graph_reused (#21764) 2026-04-16 17:21:28 +08:00
ggml-opt.cpp fix: free ctx_copy in ggml_opt_free to plug per-training-session leak (#21592) 2026-04-08 17:40:15 +02:00
ggml-quants.c ggml : Parallelize quant LUT init (#23595) 2026-05-25 10:15:46 +03:00
ggml-quants.h ggml: add Q1_0 1-bit quantization support (CPU) (#21273) 2026-04-06 20:55:21 +02:00
ggml-threading.cpp
ggml-threading.h
ggml.c model : support for DeepseekV32ForCausalLM with generic DeepSeek Sparse Attention (DSA) implementation (#23346) 2026-05-29 10:15:17 +02:00
ggml.cpp
gguf.cpp ggml: gguf_init_from_callback and gguf_init_from_buffer (#22341) 2026-05-25 11:33:29 +02:00