Skip to content

[Data] Extract yield_block_with_stats#64267

Merged
goutamvenkat-anyscale merged 4 commits into
ray-project:masterfrom
owenowenisme:data/shuffle-followups/extract-yield-block-with-stats
Jun 25, 2026
Merged

[Data] Extract yield_block_with_stats#64267
goutamvenkat-anyscale merged 4 commits into
ray-project:masterfrom
owenowenisme:data/shuffle-followups/extract-yield-block-with-stats

Conversation

@owenowenisme

@owenowenisme owenowenisme commented Jun 23, 2026

Copy link
Copy Markdown
Member

Description

Address #63598 (comment)
Extract the shared logic of yield block + pickled metadata

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
@owenowenisme owenowenisme requested a review from a team as a code owner June 23, 2026 01:30
@owenowenisme owenowenisme added data Ray Data-related issues go add ONLY when ready to merge, run all tests labels Jun 23, 2026

@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 refactors the streaming generator protocol implementation across map and shuffle operators by introducing a common helper function yield_block_with_stats in python/ray/data/_internal/execution/util.py. This helper centralizes the logic of yielding a block, retrieving its serialization timing from the generator stats, and yielding the pickled metadata. Both map_operator.py and shuffle_tasks.py have been updated to use this new helper, reducing code duplication. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@goutamvenkat-anyscale goutamvenkat-anyscale merged commit 92679d1 into ray-project:master Jun 25, 2026
6 checks passed
limarkdcunha pushed a commit to limarkdcunha/ray that referenced this pull request Jun 30, 2026
## Description
Address
ray-project#63598 (comment)
Extract the shared logic of yield block + pickled metadata

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
Signed-off-by: You-Cheng Lin <106612301+owenowenisme@users.noreply.github.com>
ShockYoungCHN added a commit to ShockYoungCHN/ray that referenced this pull request Jul 3, 2026
…cutor.py, context.py

Second batch of upstream/master alignment for the V2 shuffle path.
These 4 files are conflict-free with our V3 additions and unblock a
latent import failure from round 1.

Files:

- python/ray/data/_internal/execution/util.py
  Adds ``yield_block_with_stats`` (extracted per PR ray-project#64267). Round 1
  synced shuffle_tasks.py, which now imports this helper at module
  load; without this sync, ``from ray.data._internal.execution.util
  import yield_block_with_stats`` at shuffle_tasks.py:15 raises
  ImportError, breaking every V2 shuffle path. This is the
  round-1-follow-up fix.

- python/ray/data/_internal/execution/resource_manager.py
  Pure perf: rolls per-op ExecutionResources into globals via
  ``ExecutionResources.combine_sum(...)`` in one pass instead of an
  n-way for-loop of ``add``. No behavioral change; V3 ops
  (ShuffleReduceOpV3 etc.) go through the same code path.

- python/ray/data/_internal/execution/streaming_executor.py
  Adds proper ``_issue_detector_manager`` attribute declaration in
  __init__ and an ``issue_detector_manager`` property. Fixes a
  latent bug where callbacks/insert_issue_detectors.py:19 dynamically
  sets this attribute on the executor without the class declaring
  it; harmless at runtime but invisible to typecheckers and fragile.

- python/ray/data/context.py (surgical add, not full overwrite)
  Adds ``hash_shuffle_reduce_get_timeout_s: float`` field and its
  ``DEFAULT_HASH_SHUFFLE_REDUCE_GET_TIMEOUT_S`` env-parsed default
  (1800s), consumed by shuffle_tasks._get_shard_batch. NOT
  overwriting the whole file preserves our local
  ``use_hash_shuffle_v3`` flag, which upstream doesn't have.

Deliberately deferred (all have V3 conflicts):
- operator_fusion.py: upstream drops the generic emitter/absorber
  passes V3's fusion depends on.
- plan_all_to_all_op.py: upstream removes _plan_hash_shuffle_repartition_v3.
- physical_operator.py / base_physical_operator.py: upstream drops
  the absorbs_*_map_transformer base methods V3 overrides.
- all_to_all_operator.py: upstream drops AbstractAllToAll.num_outputs.

Bytecode compiles clean across all 4 files.

Signed-off-by: Yuanzhuo Yang <yuanzhuoyang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

2 participants