llama.cpp b12257:CUDA 图与流状态移出 common.cuh
原标题:b12257
AI 摘要
llama.cpp 发布 b12257 版本,主要改动是将 CUDA 后端中的 ggml_cuda_graph、ggml_cuda_concurrent_event 和 ggml_cuda_stream_context 从 common.cuh 移至 graph.cuh,并在 common.cuh 中仅保留前向声明,从而避免这些结构变更触发所有 CUDA 编译单元重建。同时将 ggml_cuda_kernel_can_use_pdl 统一定义在 ggml-cuda.cu 中,使 PDL 缓存从每个编译单元一份变为全局一份,并合并了 GGML_CUDA_PDL 环境变量检查。该版本同步提供 macOS、Linux、Windows、Android 等多平台预编译包。
正文节选
<details open> CUDA: move graph and concurrent stream state out of common.cuh (#32001) ggml_cuda_graph, ggml_cuda_concurrent_event and ggml_cuda_stream_context are only used by ggml-cuda.cu, but keeping them in common.cuh meant any change to them rebuilt every CUDA translation unit. Move them to graph.cuh and leave forward declarations in common.cuh. The context constructor, cuda_graph() and any_cuda_graph_*() are now defined in ggml-cuda.cu, and the stream context is held through a unique_ptr