Repository navigation
[Data]Draft nstrumented PyArrow baseline for arrow-rs A/B release run - #65217
AarryaSaraf wants to merge 2 commits into
Conversation
…de USS The release log's only memory metric is object-store peak, which can't see the decode-side working set the arrow-rs migration is about. Add `collect_operator_metrics(ds)` to benchmark.py: it walks the dataset stats and emits, per operator, wall/cpu/udf time, output rows/bytes, and `avg_max_uss_per_task_bytes` (per-task decode USS from `extra_metrics["average_max_uss_per_task"]`, Linux-only), plus top-level `read_*` convenience fields for the first Read operator. Wire it into read_and_consume_benchmark's `benchmark_fn` so every read/count/iter/write run carries the read operator's decode USS into the log — the metric that actually answers the arrow-rs-vs-PyArrow memory question. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Aarrya <[email protected]>
Release tests currently report only total wall time and aggregate object-store peak, which cannot attribute a memory change to the read operator or see per-worker decode memory. This adds: - MemoryProfiler: track max RSS alongside the existing max-USS estimate (same poll; memory_info() returns both). RSS counts shared pages (e.g. mapped object-store blocks) that USS excludes, so the pair separates a task's private working set from its OS-visible footprint. - TaskExecWorkerStats.max_rss_bytes, populated by MapOperator next to max_uss_bytes. - OpRuntimeMetrics: max_rss_bytes DistributionTracker plus max_uss_per_task / average_max_rss_per_task / max_rss_per_task metric properties (worst-task values, since the average can hide one task decoding an outlier file). - benchmark.py collect_operator_metrics(): per-operator wall time, output bytes/rows, and avg/max USS/RSS per task merged into the release result JSON, with read_* top-level conveniences; wired into the wide_schema and read_from_uris benchmarks. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Aarrya <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces tracking and reporting of peak Resident Set Size (RSS) memory metrics alongside Unique Set Size (USS) memory across Ray Data tasks. This includes updating the memory profiler to sample RSS, exposing RSS metrics in operator runtime metrics and task execution statistics, and integrating these metrics into benchmarks and tests. The review feedback suggests a performance optimization in the memory profiler to avoid redundant system calls when querying USS and RSS metrics back-to-back.
| with self._max_uss_lock: | ||
| self._sample() |
There was a problem hiding this comment.
In map_operator.py, estimate_max_uss() and max_rss() are called back-to-back at the end of each task. Since estimate_max_uss() already forces a synchronous _sample() call (which queries psutil.Process().memory_info(), a relatively expensive system call), calling _sample() again in max_rss() results in a redundant system call.
By only calling _sample() if self._max_rss is None, we avoid this duplicate system call while still ensuring at least one final sample is taken.
| with self._max_uss_lock: | |
| self._sample() | |
| with self._max_uss_lock: | |
| if self._max_rss is None: | |
| self._sample() |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 0aa5c69. Configure here.
|
|
||
| out: Dict[str, Any] = {"operators_detail": []} | ||
| try: | ||
| summary = ds.get_stats_summary(detail=True) |
There was a problem hiding this comment.
Timed benchmarks include metrics collection
Medium Severity
collect_operator_metrics calls get_stats_summary(detail=True), which triggers a Ray State API list_tasks scan, even though scheduling overhead is never used. Call sites invoke this inside Benchmark.run_fn, so that overhead is folded into reported runtime and can skew the PyArrow vs arrow-rs A/B comparison.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 0aa5c69. Configure here.
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
Two findings from surveying the sibling arrow-rs PRs (#65217, #65406, #65407), which the first pass missed: * #65406 patches the third-party parquet crate (patches/parquet-59.1.0-dict-reserve.diff, applied by vendoring the registry source and pointing [patch.crates-io] at it from a build-local .cargo/config.toml). Fine for an experiment, but if the patch is load-bearing for the numbers it becomes a standing fork requirement -- which a dedicated repo can carry properly and the Ray tree cannot, particularly on top of an uncovered crates.io fetch. It also costs Cargo.lock its parquet checksum line, weakening the reproducibility the committed lock is there to provide. * The missing py_test target is not a one-draft oversight: #65406's BUILD.bazel patch contains zero arrow_rs mentions either. Across the whole effort the 2,643-line test file has never been registered with Bazel. Signed-off-by: Elliot Barnwell <[email protected]> Signed-off-by: elliot-barn <[email protected]>
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |


Why are these changes needed?
Draft PR to run release tests