fix: cap KNNVectorDistanceExec and FTS search parallelism to target_partitions#7194
Draft
wjones127 wants to merge 1 commit into
Draft
fix: cap KNNVectorDistanceExec and FTS search parallelism to target_partitions#7194wjones127 wants to merge 1 commit into
wjones127 wants to merge 1 commit into
Conversation
…artitions Follow-up to lance-format#7087. Two CPU-bound execution nodes were using `get_num_compute_intensive_cpus()` directly without respecting DataFusion's `target_partitions` session config: - `KNNVectorDistanceExec`: caps `buffer_unordered` for the distance-compute stream with `target_partitions`. - `MatchQueryExec` / `PhraseQueryExec`: pass a capped `parallelism` value into `search_segments()`, which controls concurrent BM25 scoring across FTS index segments. IO-bound parallelism paths (`TakeExec`, `LancePushdownScanExec.batch_readahead`) are intentionally left uncapped, consistent with the approach in lance-format#7087. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Follow-up to #7087. Two more CPU-bound execution nodes were using
get_num_compute_intensive_cpus()directly without respecting DataFusion'starget_partitionssession config:KNNVectorDistanceExec: capsbuffer_unorderedfor the distance-compute stream withtarget_partitions. Each concurrent task callsspawn_cputo run vector distance calculation on the CPU pool.MatchQueryExec/PhraseQueryExec: pass a cappedparallelismvalue intosearch_segments(), which controls concurrent BM25 scoring across FTS index segments.IO-bound parallelism paths (
TakeExec.map_batch,LancePushdownScanExec.batch_readahead) are intentionally left uncapped, consistent with the approach in #7087.Does this change default parallelism?
No. The cap only takes effect when a caller explicitly lowers
target_partitionsbelow the default (which equals the logical CPU count), matching the behavior established in #7087.Test plan
test_knn_vector_distance_respects_target_partitions: executesKNNVectorDistanceExecwithtarget_partitions=1and verifies all rows are returned correctly.🤖 Generated with Claude Code