Repository navigation
Sequence invocation ceiling - #6939
Draft
nat-openai wants to merge 7 commits into
Draft
nat-openai wants to merge 7 commits into
nat-openai wants to merge 7 commits into
Conversation
nat-openai
marked this pull request as draft
October 13, 2026 18:47
12 tasks
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.
Which issue does this PR close?
Addresses the native allocation-ceiling portion of #5712, following the per-invocation proposal in #6819.
Rationale for this change
A native integral
sequenceinvocation can allocate a large output outside Comet's memory pool. Spark's per-row collection limit and Arrow's batch element limit allow allocations large enough to exhaust an executor before either limit is reached.This change checks the logical output size before allocating the child values and list offsets. The default comes from the task's configured share of Comet's pool. The decision depends on the invocation's output and its fixed ceiling, so retaining earlier results or changing the downstream plan does not consume its allowance.
A per-invocation ceiling bounds one logical output without tracking shared reservation lifetimes across arrays, slices or the JVM boundary. It makes no pool reservation; downstream operators retain their existing responsibility to reserve for buffered data. It is not an executor-wide or RSS bound.
What changes are included in this PR?
spark.comet.exec.sequence.maxBytesPerInvocation, accepting byte units. When unset in off-heap mode,getMemoryConfigdivides the configured pool limit bymax(1, floor(executor cores / task CPUs)). Local mode uses its thread count; resource-profile allocations are respected. Local-cluster uses its worker cores when executor cores are unset. If standalone executor cores are unknown, the documented fallback is the whole configured pool limit; users can set executor cores or an explicit ceiling.-1disables the ceiling and0permits no output bytes.How are these changes tested?
CometConfSuitepass with the Spark 4.1 profile. The configuration tests cover byte units, validation, task shares, resource-profile task CPUs, pool fractions, local and cluster modes, standalone fallback, on-heap defaults, explicit overrides and legacy-switch precedence.