Skip to content

[Data] Refactor DataContext to hold execution callback classes instead of instances - #61293

Merged
bveeramani merged 14 commits into
ray-project:masterfrom
limarkdcunha:task/execution-callback-simplify-diff-2
Feb 25, 2026
Merged

bveeramani merged 14 commits into
ray-project:masterfrom
limarkdcunha:task/execution-callback-simplify-diff-2

Conversation

@limarkdcunha

Copy link
Copy Markdown
Contributor

Larger Issue
Refactored the execution callback system from dynamic, per-job injection to static, eager initialization. DataContext now serves as a stateless registry of callback factories, enabling the StreamingExecutor to load all callbacks at startup. Each callback then self-configures or no-ops based on the runtime environment.

Context

This is Part 2 of a four-part change set intended to resolve the issue described above.

Part 1 diff: #60480

Closes #60279.

@limarkdcunha
limarkdcunha requested review from a team as code owners February 24, 2026 23:00

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request continues the refactoring of the execution callback system by moving to a static, class-based registration in DataContext. The changes in ray.data.context are clear and introduce a factory for collecting callback classes. Additionally, the SGLang example is significantly improved to properly support multi-GPU configurations (TP/PP), with corresponding documentation and test updates. My review includes a suggestion to simplify and improve the correctness of resource bundle creation in the SGLang engine, aligning it with patterns used elsewhere in the codebase.

Signed-off-by: Limark Dcunha <[email protected]>
@limarkdcunha
limarkdcunha force-pushed the task/execution-callback-simplify-diff-2 branch from e51e942 to 1633933 Compare February 24, 2026 23:04
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Signed-off-by: Limark Dcunha <[email protected]>
Signed-off-by: Limark Dcunha <[email protected]>
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
@ray-gardener ray-gardener Bot added the community-contribution Contributed by the community label Feb 25, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread python/ray/data/context.py Resolved
Signed-off-by: Limark Dcunha <[email protected]>
Comment thread python/ray/data/context.py Resolved
Comment thread python/ray/data/context.py Resolved
@bveeramani
bveeramani enabled auto-merge (squash) February 25, 2026 18:35
@bveeramani
bveeramani disabled auto-merge February 25, 2026 18:35
@github-actions github-actions Bot added the go add ONLY when ready to merge, run all tests label Feb 25, 2026
@bveeramani
bveeramani enabled auto-merge (squash) February 25, 2026 18:36
@bveeramani bveeramani changed the title Task/execution callback simplify diff 2 [Data] Task/execution callback simplify diff 2 Feb 25, 2026
@limarkdcunha limarkdcunha changed the title [Data] Task/execution callback simplify diff 2 [Data] Refactor DataContext to hold execution callback classes instead of instances Feb 25, 2026
@github-actions
github-actions Bot disabled auto-merge February 25, 2026 21:13
@limarkdcunha limarkdcunha self-assigned this Feb 25, 2026
@bveeramani
bveeramani merged commit 5ac4604 into ray-project:master Feb 25, 2026
3 checks passed
@limarkdcunha
limarkdcunha deleted the task/execution-callback-simplify-diff-2 branch February 25, 2026 22:40
bveeramani pushed a commit that referenced this pull request Mar 25, 2026
…kage (#61405)

Larger Issue
Refactored the execution callback system from dynamic, per-job injection
to static, eager initialization. DataContext now serves as a stateless
registry of callback factories, enabling the StreamingExecutor to load
all callbacks at startup. Each callback then self-configures or no-ops
based on the runtime environment.

Context
This is Part 3 of a four-part change set intended to resolve the issue
described above.

Part 1 diff: #60480
Part 2 diff: #61293

Closes #60279.

---------

Signed-off-by: Limark Dcunha <[email protected]>
Signed-off-by: Limark Dcunha <[email protected]>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
…kage (ray-project#61405)

Larger Issue
Refactored the execution callback system from dynamic, per-job injection
to static, eager initialization. DataContext now serves as a stateless
registry of callback factories, enabling the StreamingExecutor to load
all callbacks at startup. Each callback then self-configures or no-ops
based on the runtime environment.

Context
This is Part 3 of a four-part change set intended to resolve the issue
described above.

Part 1 diff: ray-project#60480
Part 2 diff: ray-project#61293

Closes ray-project#60279.

---------

Signed-off-by: Limark Dcunha <[email protected]>
Signed-off-by: Limark Dcunha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data] Simplify execution callback lifecycle

2 participants