<details open> spec + model: refactor DFlash based speculative decoding methods (#32016) * dflash : move the DSpark markov head and backbone graphs to dspark.cpp Move-only: build_dspark_markov_head, graph_dsv4, graph_dsv41 and graph_mistral_large4 move verbatim. build_inp_target_features and build_dspark_markov_head become static members of llama_model_dflash so both files can use them. * dflash : detect the head and the backbone once, split the loaders per file load_arch_hparams sets llama_model_dflash::variant (DFlash, DFlash2, DSpark, LiliCorr) and ::backbone (base, DSV4, DSV4.1, Mistral Large 4). The head, backbone and base layer loaders become member helpers in dflash.cpp, dflash2.cpp, lilicorr.cpp and dspark.cpp. build_arch_graph dispatches on the backbone. The DFlash2 and LiliCorr loaders create the DFlash2 conv tensors through a helper in dflash2.cpp, right after their head tensors instead of in the base layer loop; the other tensors keep their creation order. The DFlash2 loader drops its copy of the conv group size check, which master never reached. * dflash : share the injection input, token embeddings and lm head lookups build_inject_inp (target features + fc + encoder norm), get_tok_embd and get_lm_head replace the copies in the base, DSV4, DSV4.1 and Mistral Large 4 graphs. build_inp_target_features is file-static again. * dflash : split the DFlash decoder into a graph per head graph_base creates the shared inputs and provides build_inject, build_inp_tokens, build_layers and build_logits. graph_dflash (dflash.cpp), graph_dflash2 (dflash2.cpp), graph_dspark (dspark.cpp) and graph_lilicorr (lilicorr.cpp) assemble them and add their head; the selector, scorer and markov head builders move to the file of their graph, and the DFlash2 local conv run by build_layers to dflash2.cpp. build_arch_graph dispatches on the backbone, then on the head. The op order and the tensor names are unchanged. * speculative : split the DFlash driver into a class per head common_speculative_impl_draft_dflash stays the DFlash implementation and becomes the base of draft_dspark, draft_dflash2 and draft_lilicorr. Its protected constructor only reads the draft metadata; init() then sets up the contexts with the options of the draft (draft length, backend sampling, device features, masked h_nextn). Each derived class overrides draft() with the path of its head from the former draft(). DFlash2 also overrides begin() to reseed its generator per request, and LiliCorr overrides process() to store the context features of each injected chunk, which its noise block carries as its state. The factory keeps the current routing: draft-dspark picks DSpark, draft-dflash picks DFlash2 or LiliCorr from the draft metadata and DFlash otherwise. draft-dspark with a DFlash2 or LiliCorr draft now runs the DSpark reader instead of a mix of both. sample_from_anchor is logged by DSpark only. * speculative : add the draft-dflash2 and draft-lilicorr types draft-dflash2 and draft-lilicorr name the DFlash2 and LiliCorr drafts, which draft-dflash keeps running too: it picks them from the draft metadata. draft-dflash2 and draft-lilicorr must match the draft model, draft-dspark rejects a DFlash2 or LiliCorr draft, a model that is not a DFlash draft is rejected, and a run uses at most one DFlash family type; these errors leave speculative decoding uninitialized. The type detected from the draft GGUF is now the concrete one, and draft-dflash2 and draft-lilicorr download the dflash sidecar. * docs : describe the DFlash2 and LiliCorr drafts Add the DFlash2 and LiliCorr sections and the new types, and explain that draft-dflash also runs DFlash2 and LiliCorr drafts. * speculative : drop the unused DFlash is_mrope Nothing reads it since the migration to common_batch (#29385), which picks the number of M-RoPE position rows from the rope type of the draft. * doc: update spec dec * address review comments </details> **Website:** - <https://llama.app> **Attestations:** - <https://github.com/ggml-org/llama.cpp/attestations/67506529> **macOS/iOS:** - [macOS Apple Silicon (arm64)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-macos-arm64.tar.gz) - macOS Apple Silicon (arm64, KleidiAI enabled) [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23780) - [macOS Intel (x64)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-macos-x64.tar.gz) - [iOS XCFramework](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-xcframework.zip) **Linux:** - [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-x64.tar.gz) - [Ubuntu arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-arm64.tar.gz) - [Ubuntu 24.04 s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-s390x.tar.gz) - [Ubuntu 26.04 s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-26.04-s390x.tar.gz) - [Ubuntu 26.04 s390x (zDNN)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-zdnn-s390x.tar.gz) - [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-vulkan-x64.tar.gz) - [Ubuntu arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-vulkan-arm64.tar.gz) - [Ubuntu x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-cuda-12.8-x64.tar.gz) - [CUDA 12.8 libraries](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-b12377-bin-ubuntu-cuda-12.8-x64.tar.gz) - [Ubuntu x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-cuda-13.5-x64.tar.gz) - [CUDA 13.5 libraries](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-b12377-bin-ubuntu-cuda-13.5-x64.tar.gz) - [Ubuntu arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-cuda-13.5-arm64.tar.gz) - [CUDA 13.5 libraries](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-b12377-bin-ubuntu-cuda-13.5-arm64.tar.gz) - [Ubuntu x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-rocm-10.0-x64.tar.gz) - [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-openvino-2026.4.1-x64.tar.gz) - [Ubuntu x64 (SYCL FP32)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-sycl-fp32-x64.tar.gz) - [Ubuntu x64 (SYCL FP16)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-ubuntu-sycl-fp16-x64.tar.gz) - [Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-linux-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/linux.md) **Android:** - [Android arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-android-arm64.tar.gz) - [Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-android-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/README.md) **Windows:** - [Windows x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-cpu-x64.zip) - [Windows arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-cpu-arm64.zip) - [Windows arm64 (OpenCL Adreno)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-opencl-adreno-arm64.zip) - [Windows x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-cuda-12.4-x64.zip) - [CUDA 12.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-bin-win-cuda-12.4-x64.zip) - [Windows x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-cuda-13.5-x64.zip) - [CUDA 13.5 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-bin-win-cuda-13.5-x64.zip) - [Windows arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-cuda-13.5-arm64.zip) - [CUDA 13.5 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/b12377/cudart-llama-bin-win-cuda-13.5-arm64.zip) - [Windows x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-vulkan-x64.zip) - [Windows arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-vulkan-arm64.zip) - [Windows x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-openvino-2026.4.1-x64.zip) - [Windows x64 (SYCL)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-sycl-x64.zip) - [Windows x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-bin-win-rocm-10.0-x64.zip) **openEuler:** - [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23705) - openEuler x86 (310p) - openEuler x86 (910b, ACL Graph) - openEuler aarch64 (310p) - openEuler aarch64 (910b, ACL Graph) **UI:** - [UI](https://github.com/ggml-org/llama.cpp/releases/download/b12377/llama-b12377-ui.tar.gz)
AI NEWS JOURNAL
llama.cpp releasesAI NEWS / JOURNAL
b12377
The update refactors DFlash-based speculative decoding methods in llama.cpp by restructuring code organization, sharing components across models, splitting decoder graphs per head, and introducing dedicated classes for DFlash2 and LiliCorr drafts. It also adds support for new draft types, improves documentation, and removes unused code.
翻译服务暂未运行,当前显示原文。