Skip to content

Add EvictableFn Evolution for Gang-aware Eviction design - #5170

Merged
volcano-sh-bot merged 2 commits into
volcano-sh:masterfrom
vzhou-p:evictablefn-evolution
Apr 10, 2026
Merged

Add EvictableFn Evolution for Gang-aware Eviction design#5170
volcano-sh-bot merged 2 commits into
volcano-sh:masterfrom
vzhou-p:evictablefn-evolution

Conversation

@vzhou-p

@vzhou-p vzhou-p commented Apr 8, 2026

Copy link
Copy Markdown

What type of PR is this?

Add EvictableFn Evolution for Gang-aware Eviction design

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Signed-off-by: Victor Zhou <vzhou@pinterest.com>
Copilot AI review requested due to automatic review settings April 8, 2026 21:24
@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new design document that proposes an evolution of the EvictableFn plugin callback to support gang-aware eviction. The document is a follow-up to the existing gang-aware-eviction-design.md and addresses two key problems: the "representative task" problem (where a single task is used as proxy for an entire job) and the "implicit mode" problem (where the same callback signature is used for both legacy and gang-aware eviction without distinguishing between them).

Changes:

  • New design document that proposes UnifiedEvictableFn with EvictionContext as the solution, providing an opt-in mechanism for plugins to support gang-aware eviction
  • Includes detailed pros/cons analysis and consideration of two alternative approaches
  • Maintains backward compatibility while introducing a clear upgrade path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a design for UnifiedEvictableFn and EvictionContext to support gang-aware eviction. The review feedback suggests adding an Unknown value to the EvictionKind enum for safer initialization, defining the Task field's behavior in gang contexts to resolve the representative task issue, and clarifying the scope of PendingTasks to ensure consistency across plugin implementations.

type EvictionKind int

const (
GangEvictPreempt EvictionKind = iota

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to define an Unknown or Unspecified value as the first element of the EvictionKind enum. Since Go initializes integers to 0 by default, having a specific Unknown value helps detect uninitialized EvictionContext structs, which is a concern explicitly mentioned in the "Cons" section (line 75).

Suggested change
GangEvictPreempt EvictionKind = iota
EvictUnknown EvictionKind = iota
GangEvictPreempt

type EvictionContext struct {
Kind EvictionKind
Job *JobInfo
Task *TaskInfo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To effectively resolve the "representative task" problem mentioned in the motivation, the design should explicitly define the contract for the Task field during gang-aware operations. Specifying that Task should be nil for GangEvictPreempt and GangEvictReclaim would ensure that plugins are forced to rely on the Job and PendingTasks fields for their logic, rather than falling back to a single representative task.

Job *JobInfo
Task *TaskInfo

PendingTasks []*TaskInfo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It would be beneficial to clarify the expected content of PendingTasks. For gang-aware eviction, does this include all pending tasks of the job, or only the subset currently being considered for placement? Providing a clear definition will help maintain consistency across different plugin implementations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can also give migration plan section, this section explains which plugins currently need to implement these new extension points, and if new plugins need to implement them in the future, what best practices guide their implementation. It also covers when existing evictableFn plugins should be deprecated, and the version plan for migrating to the new extension points.

@JesseStutler JesseStutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the new extension points since EvictionContext looks like more extensible :)

Signed-off-by: Victor Zhou <vzhou@pinterest.com>
@JesseStutler

Copy link
Copy Markdown
Member

/approve
/lgtm
Thanks, look forward to the actual gang preempt implementation codes :D

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JesseStutler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2026
@volcano-sh-bot
volcano-sh-bot merged commit 35606ad into volcano-sh:master Apr 10, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants