Skip to content

examples : port speculative-prefill to common_batch - #182

Merged
dzannotti merged 1 commit into
halo-box:masterfrom
Nathanw1014:fix/speculative-prefill-common-batch
Oct 16, 2026
Merged

dzannotti merged 1 commit into
halo-box:masterfrom
Nathanw1014:fix/speculative-prefill-common-batch

Conversation

@Nathanw1014

Copy link
Copy Markdown

llama-speculative-prefill stopped compiling on master after the upstream sync (93e6d02), and with it the default build target. The example still called common_batch_clear / common_batch_add, which upstream removed in ggml-org#29601 when examples moved to llama_batch_ext.

This ports the two batches in the example to common_batch and llama_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 to min(n_kept, n_batch); common_batch grows as entries are added, and each submit still carries at most n_batch tokens.

Verified on Strix Halo (Ubuntu, gcc), CPU build of the target:

  • master 93e6d02, unchanged: speculative-prefill.cpp fails with common_batch_clear / common_batch_add not declared (4 errors).
  • this PR: the target builds with no errors or warnings.

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.cpp is still in the tree although upstream removed it in ggml-org#30023 (its tests moved to test-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.

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
dzannotti merged commit b703f52 into halo-box:master Oct 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants