Repository navigation
examples : port speculative-prefill to common_batch - #182
Merged
dzannotti merged 1 commit intoOct 16, 2026
Merged
Conversation
The upstream sync removed common_batch_add / common_batch_clear (ggml-org#29601), so llama-speculative-prefill no longer compiled and the default target failed to build. Use common_batch and llama_process, as the other examples now do. Assisted-by: Claude Opus 5.5
dzannotti
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
llama-speculative-prefillstopped compiling on master after the upstream sync (93e6d02), and with it the default build target. The example still calledcommon_batch_clear/common_batch_add, which upstream removed in ggml-org#29601 when examples moved tollama_batch_ext.This ports the two batches in the example to
common_batchandllama_process, the same pattern upstream used for the other examples. No other file changes.The file is byte-identical to the version in #169 (the re-opened sync,
reapply/upstream-sync-2026-10-08), where this resolution already exists; it was lost when master was rewritten from #181. Landing it on master now unblocks the build, and #169 will merge over it without a conflict on this file. The batch for the sparse target prefill is no longer pre-sized tomin(n_kept, n_batch);common_batchgrows as entries are added, and each submit still carries at mostn_batchtokens.Verified on Strix Halo (Ubuntu, gcc), CPU build of the target:
speculative-prefill.cppfails withcommon_batch_clear/common_batch_addnot declared (4 errors).Not verified: I did not run the example itself (it needs a target and a draft model), and I did not build the full default target with the Vulkan or HIP backends in this change.
Also noticed, not touched here:
tests/test-save-load-state.cppis still in the tree although upstream removed it in ggml-org#30023 (its tests moved totest-llama-context.cpp). No CMakeLists references it, so it does not break the build; removing it is a separate cleanup.Written with Claude, tested by me.