Repository navigation
Honor per-model external prefill chunking capability - #1320
Open
Sayan Shaw (sayanshaw24) wants to merge 2 commits into
Open
Sayan Shaw (sayanshaw24) wants to merge 2 commits into
Sayan Shaw (sayanshaw24) wants to merge 2 commits into
Conversation
Extract optional runtime capability detection and automatic Generator chunk-size policy from the native tool-calling PR. Preserve older runtime compatibility and explicitly configured positive chunk sizes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the model-aware prefill chunking update.
No open issues 🎉
What changed in this PR
Updates the C++ SDK’s Generator prefill policy to honor per-model support for host-driven chunking, independently of tool calling.
Changes:
- Detects the optional GenAI capability API with a compile-and-link probe and queries supported runtimes before applying automatic chunk sizes.
- Preserves explicit positive chunk sizes and legacy defaults on older runtimes, including pinned GenAI 0.19.0.
- Adds an unsupported-chunking regression test and documents compatibility behavior.
| File | Description |
|---|---|
sdk_v2/cpp/test/internal_api/chat/search_options_test.cc |
Tests that unsupported models receive no automatic chunk size. |
sdk_v2/cpp/src/inferencing/generative/chat/search_options.h |
Adds the capability parameter to search-option application. |
sdk_v2/cpp/src/inferencing/generative/chat/search_options.cc |
Gates automatic chunk sizing on model support. |
sdk_v2/cpp/src/inferencing/generative/chat/onnx_chat_generator.cc |
Queries model support, with a legacy-runtime fallback. |
sdk_v2/cpp/README.md |
Documents capability detection and compatibility behavior. |
sdk_v2/cpp/CMakeLists.txt |
Probes API availability and exposes the result to compilation. |
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch was successfully deployed
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.
Summary
Honor the loaded Generator implementation's support for host-driven prefill chunking, independently of tool calling.
Extracted from #1296 into a separate PR targeting
main:This changes Generator prefill policy, not tool schemas, parsing, continuation history, sampling defaults, or CUDA graph capture.
Runtime requirement
The generic per-model query requires microsoft/onnxruntime-genai#2934 and a package containing that API. On an older runtime this PR deliberately preserves existing defaults; it does not claim to fix Bolt on the older runtime.
Related work
#1312 is the existing Bolt-specific alternative to suppressing the automatic chunk size without adding a capability API. Coordinate the choice rather than treating both approaches as mandatory dependencies. #1315 separately preserves Bolt's configured greedy default.
Neither this PR nor those model-runtime policy fixes belong in the native tool-calling diff.
Validation