Skip to content

[Data] Enable memory-safety best practices in video object detection benchmark - #64125

Merged
bveeramani merged 1 commit into
masterfrom
data-video-benchmark-best-practices
Jun 16, 2026
Merged

bveeramani merged 1 commit into
masterfrom
data-video-benchmark-best-practices

Conversation

@bveeramani

Copy link
Copy Markdown
Member

Description

The video object detection benchmark previously ran with the default Ray Data settings, which don't guard against the OOMs we want this benchmark to be resilient to. This enables the memory-safety best practices we recommend to users so the benchmark exercises (and validates) them.

Specifically, it:

  • Sets isolate_read_workers = True so other operators' tasks don't get co-scheduled with read workers.
  • Sets default_map_logical_memory_enabled = True so the system reserves logical memory for map UDFs by default.
  • Sets memory=3_529_273_344 (~3.5 GB) on the high-memory ExtractImageFeatures UDF. Ray Data can't prevent OOMs unless memory is specified for high-memory UDFs; this value is the max USS observed in previous nightly runs.

These are opt-in settings (not enabled by default), so they only affect this benchmark.

Related issues

Additional information

@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 configures Ray Data context settings and specifies a memory limit on map_batches to prevent out-of-memory (OOM) errors in the nightly test pipeline. The reviewer correctly pointed out that modifying ray.data.DataContext class attributes directly is error-prone and may not take effect if the context singleton is already initialized, suggesting using DataContext.get_current() instead.

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.

@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 using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c71185b. Configure here.

# These are best practices we recommend to avoid OOMs, though they're opt-in and
# not enabled by default.
ray.data.DataContext.isolate_read_workers = True
ray.data.DataContext.default_map_logical_memory_enabled = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

DataContext settings on wrong object

Medium Severity

isolate_read_workers and default_map_logical_memory_enabled are assigned on the DataContext class, but Ray Data uses the instance from DataContext.get_current() when planning reads and map operators. Those assignments do not update that instance, so the benchmark likely still runs with the default OOM-related settings.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c71185b. Configure here.

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

LGTM

@ray-gardener ray-gardener Bot added data Ray Data-related issues release-test release test labels Jun 16, 2026
@bveeramani
bveeramani enabled auto-merge (squash) June 16, 2026 07:24
@github-actions github-actions Bot added the go add ONLY when ready to merge, run all tests label Jun 16, 2026
@bveeramani
bveeramani merged commit 85c8125 into master Jun 16, 2026
5 checks passed
@bveeramani
bveeramani deleted the data-video-benchmark-best-practices branch June 16, 2026 07:57
limarkdcunha pushed a commit to limarkdcunha/ray that referenced this pull request Jun 30, 2026
…benchmark (ray-project#64125)

## Description

The video object detection benchmark previously ran with the default Ray
Data settings, which don't guard against the OOMs we want this benchmark
to be resilient to. This enables the memory-safety best practices we
recommend to users so the benchmark exercises (and validates) them.

Specifically, it:

- Sets `isolate_read_workers = True` so other operators' tasks don't get
co-scheduled with read workers.
- Sets `default_map_logical_memory_enabled = True` so the system
reserves logical memory for map UDFs by default.
- Sets `memory=3_529_273_344` (~3.5 GB) on the high-memory
`ExtractImageFeatures` UDF. Ray Data can't prevent OOMs unless `memory`
is specified for high-memory UDFs; this value is the max USS observed in
previous nightly runs.

These are opt-in settings (not enabled by default), so they only affect
this benchmark.

## Related issues

## Additional information

Signed-off-by: Balaji Veeramani <[email protected]>
sai-miduthuri pushed a commit that referenced this pull request Jul 17, 2026
…benchmark (#64125) (cherry-pick 2.56.1)

Cherry-pick of #64125 onto `releases/2.56.1`.

Original PR: #64125

## Summary
Enables the opt-in memory-safety best practices for the video object
detection multimodal benchmark so it exercises (and validates) the OOM
guardrails we recommend to users. Specifically, it sets `memory=3_529_273_344`
(~3.5 GB) on the high-memory `ExtractImageFeatures` UDF (the max USS observed
in previous nightly runs), since Ray Data can't prevent OOMs unless `memory`
is set for high-memory UDFs.

## Cherry-pick notes
One conflict resolved in
`release/nightly_tests/multimodal_inference_benchmarks/video_object_detection/ray_data_main.py`:
the `isolate_read_workers` / `default_map_logical_memory_enabled`
`DataContext` settings that #64125 adds are already present on the branch
(introduced by the earlier cherry-pick of #64298, using the
`DataContext.get_current()` accessor). Kept the branch's `get_current()`
form; the net change from this cherry-pick is the `memory=3_529_273_344`
argument on the `ExtractImageFeatures` `map_batches` call.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: sai-miduthuri <[email protected]>
elliot-barn pushed a commit that referenced this pull request Jul 17, 2026
…benchmark (#64125) (cherry-pick 2.56.1) (#64827)

Cherry-pick of #64125 onto `releases/2.56.1`.

Original PR: #64125

## Summary
Enables the opt-in memory-safety best practices for the video object
detection multimodal benchmark so it exercises (and validates) the OOM
guardrails we recommend to users. Specifically, it sets
`memory=3_529_273_344` (~3.5 GB) on the high-memory
`ExtractImageFeatures` UDF (the max USS observed in previous nightly
runs), since Ray Data can't prevent OOMs unless `memory` is set for
high-memory UDFs.

## Cherry-pick notes
One conflict resolved in
`release/nightly_tests/multimodal_inference_benchmarks/video_object_detection/ray_data_main.py`:
the `isolate_read_workers` / `default_map_logical_memory_enabled`
`DataContext` settings that #64125 adds are already present on the
branch (introduced by the earlier cherry-pick of #64298, using the
`DataContext.get_current()` accessor). Kept the branch's `get_current()`
form; the net change from this cherry-pick is the `memory=3_529_273_344`
argument on the `ExtractImageFeatures` `map_batches` call.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: sai-miduthuri <[email protected]>
Co-authored-by: Balaji Veeramani <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…benchmark (ray-project#64125)

## Description

The video object detection benchmark previously ran with the default Ray
Data settings, which don't guard against the OOMs we want this benchmark
to be resilient to. This enables the memory-safety best practices we
recommend to users so the benchmark exercises (and validates) them.

Specifically, it:

- Sets `isolate_read_workers = True` so other operators' tasks don't get
co-scheduled with read workers.
- Sets `default_map_logical_memory_enabled = True` so the system
reserves logical memory for map UDFs by default.
- Sets `memory=3_529_273_344` (~3.5 GB) on the high-memory
`ExtractImageFeatures` UDF. Ray Data can't prevent OOMs unless `memory`
is specified for high-memory UDFs; this value is the max USS observed in
previous nightly runs.

These are opt-in settings (not enabled by default), so they only affect
this benchmark.

## Related issues

## Additional information

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: 400Ping <[email protected]>
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 release-test release test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants