feat(native): expose context batch sizing controls#71
Merged
Conversation
Add ModelParams batchSize/microBatchSize with legacy defaults and wire them into context creation and prompt decode chunking so users can tune memory/performance without changing existing behavior.
Document that batchSize maps to n_batch and microBatchSize maps to n_ubatch so users can tune these fields with the same mental model as upstream llama.cpp CLI options.
Owner
Author
|
@maiguangyang Let me know if this fulfills your request. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
+ Coverage 76.51% 76.54% +0.03%
==========================================
Files 66 66
Lines 8196 8216 +20
==========================================
+ Hits 6271 6289 +18
- Misses 1925 1927 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
ModelParams.batchSize/ModelParams.microBatchSizeso nativen_batchandn_ubatchcan be tuned independently ofcontextSizewhile preserving legacy defaults.n_batchandn_ubatch.Validation
dart analyzedart test test/unit/core/models/inference/model_params_test.dartdart test test/unit/backends/llama_cpp/llama_cpp_service_test.dart