Repository navigation
[Data] Enable memory-safety best practices in video object detection benchmark - #64125
Conversation
…benchmark Signed-off-by: Balaji Veeramani <[email protected]>
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit c71185b. Configure here.
…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]>
…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]>
…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]>
…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]>


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:
isolate_read_workers = Trueso other operators' tasks don't get co-scheduled with read workers.default_map_logical_memory_enabled = Trueso the system reserves logical memory for map UDFs by default.memory=3_529_273_344(~3.5 GB) on the high-memoryExtractImageFeaturesUDF. Ray Data can't prevent OOMs unlessmemoryis 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