Skip to content

[Data] [DO NOT MERGE] arrow-rs Parquet reader A/B — PyArrow baseline arm (release-test trigger) - #65407

Closed
AarryaSaraf wants to merge 36 commits into
ray-project:masterfrom
AarryaSaraf:arrow-rs-ab-baseline-64985
Closed

AarryaSaraf wants to merge 36 commits into
ray-project:masterfrom
AarryaSaraf:arrow-rs-ab-baseline-64985

Conversation

@AarryaSaraf

Copy link
Copy Markdown
Contributor

Draft PR whose only purpose is to trigger the release pipeline for the multi-node
arrow-rs vs PyArrow A/B. Instrumentation-only PyArrow baseline on the same base as the
treatment arm (#64985 at 717c457) — the arms differ only by the reader. Stacked on
unmerged #64985, so the diff includes its commits — do not review or merge.

🤖 Generated with Claude Code

goutamvenkat-anyscale and others added 28 commits July 23, 2026 22:58
…et V2

Replace the blind, size-based ParquetFileChunker + RoundRobinPartitioner path
for Parquet V2 reads with a FooterFileIndexer that reads each file's Parquet
footer on a pool of FooterReader actors (SPREAD across the cluster) and packs
row groups into read units with an online, locality-preserving bin packer.

This makes read units row-group-accurate instead of size-estimated, and adds
predicate pushdown + row-group skipping and limit pushdown into listing: the
optimizer rules mirror the pushed predicate/projection/limit from the ReadFiles
scanner onto the upstream ListFiles (sync_list_files_pushdown), so the footer
actors prune row groups by statistics, size only projected columns, and stop
listing early under a limit. Optional row-group coalescing + split-packing are
supported and gated (no-op by default).

The footer indexer reuses the generic FileIndexer abstraction (ListFiles drives
it via the ordinary list_files transform, yields_read_units=True so it lists in
a single task and skips the partitioner). The blind ParquetFileChunker /
ParquetFileChunkMetadata and their size-based row-group range helpers are
removed; the reader now reads exactly the row groups a bin names.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Goutam <[email protected]>
LimitPushdownRule._push_limit_down returned early ("no row-preserving ops")
when a Limit was directly above ReadFiles, so it never applied the per-block
limit -> the scanner limit and (footer path) ListFiles.limit were left unset.
The footer indexer then read every file's footer regardless of the limit.

Push the per-block limit into a directly-attached ReadFiles (keeping the Limit
on top for exact enforcement), which also mirrors the limit onto ListFiles via
sync_list_files_pushdown so the footer indexer stops listing early. Scoped to
ReadFiles to keep other sources unchanged.

read_parquet(s3://...).limit(10_000) on a 260-file dataset: ~9.8s -> ~3.1s.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Goutam <[email protected]>
Follow-up refinements on the footer-based row-group chunking path:

- Carry projection-scoped uncompressed_size on ParquetRowGroupChunkMetadata
  so the reader sizes batches from footer stats ListFiles already read,
  instead of re-reading the footer in the read task.
- Read the exact physical row groups a bin assigned via explicit
  row_group_ids fragments (_fragments_from_row_group_ids), scanning a
  file's groups together unless row hashing needs per-group offsets.
- Size Arrow's process-wide IO/CPU thread pools per read task so a scan
  can issue many concurrent column/range fetches against S3
  (RAY_DATA_PARQUET_READER_IO_THREAD_COUNT / _CPU_COUNT).
- Add RAY_DATA_PARQUET_FOOTER_MAX_INFLIGHT_BATCHES to bound the in-flight
  footer-batch window independently of actor count.
- Use a fixed fallback bin budget (RAY_DATA_PARQUET_FOOTER_BIN_BYTES,
  default 1 GiB) for read-task packing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
A shared bin at or over cap can never accept another positive-size item,
so leaving it in the pool just burns one of the max_shared_open_bins
slots and delays draining. Seal and evict it immediately from both the
whole-item fast path and the best-fit split loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
`PushdownCountFiles` rebuilt `ListFiles` by deep-copying the existing
indexer and overwriting its `_file_chunker`. `FooterFileIndexer`
subclasses `NonSamplingFileIndexer`, so the `isinstance` assert passed --
but it overrides `list_files` outright and never reads the chunker, so the
swap was a silent no-op.

The result on `count_parquet_fixed_size` (10k files): listing still
footer-swept every file, and because `count()` projects to zero columns
every row group measured 0 bytes, so the bin cap was never reached and the
whole dataset collapsed into one bin -- one manifest block, one count task
that then re-read all 10k footers serially. 30.5s -> 219.8s.

Build the plain indexer explicitly via a new
`NonSamplingFileIndexer.as_whole_file_indexer()`, and bail out rather than
assert when the indexer isn't one (the assert was stripped under -O, which
is the same failure mode as this bug). This restores one manifest row per
file and parallel count tasks, and removes a latent over-count: the bin
packer emits one row per path per bin, so a file spanning bins would have
been counted more than once.

Adds the first test coverage for the rule, including an exact-type
assertion on the rebuilt indexer -- an isinstance check is what let the
footer indexer through.

Also in this commit:
- lower the bin-packing default from 1 GiB to 64 MiB
- expose `max_shared_open_bins` via
  `RAY_DATA_PARQUET_BIN_PACKING_MAX_SHARED_OPEN_BINS`
- experiment env vars on the `wide_schema_pipeline` release test
- `map_benchmark` reads via V2 instead of pinning V1

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…gets

## Listing parallelism

`ListFiles` forced single-task listing whenever the indexer sets
`yields_read_units` -- i.e. always, for Parquet V2 -- on the grounds that
the bin packer "must see the whole file stream to pack globally". But the
V1 partitioner it replaced also runs inside each listing task, so global
packing was never the status quo, and the cost is real: a read that hands
in explicit paths loses listing parallelism entirely.

`distributed_training` passes 200 explicit parquet paths. Master sharded
them across 200 listing tasks (3.00s); the footer path did all 200 footer
reads in one (5.81s), ~65% of that test's +15% regression, with block
count and block size otherwise identical to master.

Drop `yields_read_units` from the `should_parallelize` condition. Only the
shuffle-RNG case still needs a single task. Reads that pass one directory
-- the common case -- shard to one task either way and are unaffected.

The footer reader pool is provisioned per `list_files` call, so it is now
per listing task rather than cluster-wide. Documented as such on
`RAY_DATA_PARQUET_FOOTER_NUM_ACTORS`, and `distributed_training` sets it
to 1 since each of its tasks reads a single footer.

## Per-test bin budgets

The 64 MiB default is right for some datasets and badly wrong for others,
because the useful budget tracks per-file projected bytes -- which ranges
from 0.45 MiB to 3.87 GiB across the suite, and varies with the query's
projection on the same table. Measured from parquet footers and verified
against the V1 partitioner's block counts:

- read_large_parquet         4 GiB    (3.87 GiB/file; 64 MiB -> 5768 tasks)
- write_parquet, joins,      1.25 GiB (~1.17 GiB/file, full schema)
  aggregate_groups, map_groups
- tpch_q20                   192 MiB  (160 MiB/file, 4-column projection)
- streaming_split            36 MiB   (V1 landed on ~31 MB blocks here)

The map_groups value also fixes four outright failures, not just a
slowdown: `map_groups_*_sort_shuffle_pull_based` OOM'd the driver at
64 MiB. Pull-based shuffle holds `input_blocks * output_blocks` object
refs on the driver, so at 2500 blocks that is 17.5 GiB (observed 21.6 GiB
RSS, cgroup kill). At 1.25 GiB it is ~95 blocks and 0.03 GiB.

`wide_schema` gets no budget: those datasets are 10-40 MB total across
9-27 single-row-group files, so every budget from 64 MiB up packs them
into one bin. They need a minimum-block-count floor instead. `mix` gets
no budget either -- it already matches V1 granularity -- only a narrower
reader pool, since it opens 8 datasets over the same 513-file path.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…tunable

## Revert: parallel listing for the footer indexer

71a1bf2 dropped `yields_read_units` from `should_parallelize` so a read
handing in explicit paths would shard listing across tasks. Release build
102070 shows that was wrong.

`FooterFileIndexer.list_files` pays a fixed cost *per call* -- provisioning
a reader-actor pool, building a packer, serializing manifests -- so N tasks
pay it N times instead of splitting it. On `distributed_training` (200
explicit paths) each of 200 listing tasks took 55.9s, 50.7s of it in block
generation, against 5.35s for one task doing all 200. Aggregate listing
work went 5.35 -> 11,180 task-seconds. `distributed_training.chaos` went
+21% -> +463% vs master; `.regular` +15% -> +28%.

Restore the original condition. Parallel listing here needs a pool shared
across tasks, not one per task, which is a larger change.

## RAY_DATA_PARQUET_FOOTER_RESULT_BATCH_SIZE

`read_footers` has always taken `result_batch_size` to amortize driver-side
object-store fetches, but the indexer never passed it, so it defaulted to
1: a directory of N files costs N fetches on the single listing task
(7.4k for the imagenet dataset). Plumb it through as an env-backed setting,
default 1 so behavior is unchanged.

Note it batches *within* one `read_footers` call, so it saturates at
`RAY_DATA_PARQUET_FOOTER_BATCH_SIZE`; both have to move together.

## Release test config

- `streaming_split`: batch sizes 50/50, cutting driver fetches ~7.4k -> ~149.
  ListFiles dominates this test (15.5s of a 26.6s run) and its cost tracks
  results pulled back, not footer IO -- raising the actor pool 32 -> 128
  left block generation flat at ~7 ms/block.
  Bin budget reverted to the default: 36 MiB was matching V1's block size,
  but V1 only lands on ~31 MB blocks because its 5x encoding estimate
  over-counts by 5x on image data that does not compress. Matching it
  doubles the block count and makes the dominant cost worse.
- `distributed_training`: footer actors 1 -> 20. 200 paths at a batch size
  of 10 is 20 batches, so actors past the 20th are never dispatched to.

Also carried: `@ray.method(num_returns="streaming")` on `read_footers`,
re-reading the actor count at construction so env overrides apply after
import, a `None`-size guard in `sample_files`, and `None`-safety in the
bin packer's heavy path.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
Release-test tuning for the Parquet V2 footer read path, plus one real
regression the benchmark itself introduced.

map_batches: 26cdef2 added ``num_cpus=0.99`` to ``read_parquet`` in
map_benchmark.py. The fusion rule canonicalizes an unspecified ``num_cpus``
to 1, so 0.99 makes the read incompatible with the downstream map_batches
ops and they stop fusing. Unfused, every read output crosses the object
store: 1.13 TiB on sf1000 lineitem and 484.5s of block serialization
against 0.6s fused, taking the test from 141s to 335s vs master. Drop the
arg and pin a 1 GiB bin budget -- the 64 MiB default is worst-case on this
table (three 24.36 MiB row groups exceed it, so bins take two and sit 24%
empty, giving 24,432 read tasks against master's 1,000).

aggregate_groups: 32 MiB on both shuffle strategies. First setting to move
fixed_size/84-groups/sort_shuffle, stuck at 220-259s across four builds
under every other budget; 32 MiB brings it to 192s. This is the opposite
direction from map_groups, which wants 1.25 GiB on the same dataset.

tpch_q1: 192 MiB, matching q20 on the same table.

Also corrects comments that described master's read path as V1. Master is
DSv2 with the round-robin partitioner for every suite except map_batches,
which is V1 there because DEFAULT_USE_DATASOURCE_V2 is False on master and
ray-project#64821 (branch-only) flips it.

Tests: pytest python/ray/data/tests/datasource/test_parquet.py::test_parquet_read_spread
python/ray/data/tests/test_predicate_pushdown.py -- 51 passed.

AI assistance was used for this change.

Signed-off-by: Goutam <[email protected]>
aggregate_groups: move the bin budget from the block to a per-variant
setting via matrix.adjustments, with bin_packing_bytes as a fourth matrix
variable. Only fixed_size/sort_shuffle/84-groups needed retuning -- it ran 211s
at 32 MiB in release build #102329 against master's ~145s, and 137s at 256 MiB.
The other seven variants keep 32 MiB, where they were measured healthy in that
same build (+10.2% to -30.7%), rather than move onto an unmeasured value.

The cost being tuned is per-block sort-shuffle overhead, not bytes: at 32 MiB
the scan emitted 4x the ListFiles outputs and ~1.5x the blocks into the shuffle
(Sort Sample 3050 vs master's 2000) for an identical 20.8GB object-store peak
and identical row count.

cross_az_map_batches_autoscaling_iptable_failure_injection: pin 1 GiB. These
tests moved from the V1 to the V2 read path when the use_datasource_v2=False
pin came out of map_benchmark.py; on V2 at the 64 MiB default the object-store
peak doubled (310GB -> 616GB) and runtime went 304s -> 725s. The larger budget
is a mitigation and is not yet measured.

Also request num_cpus=0 for FooterReaderActor.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
Conflict in release/release_data_tests.yaml: master added a third
shuffle_strategy (hash_shuffle_v2) to the aggregate_groups matrix, while this
branch had converted that block from matrix.setup to matrix.adjustments so each
variant can carry its own bin budget. Kept both -- the four new hash_shuffle_v2
variants are enumerated as adjustments alongside the existing eight.

The new variants get the 64 MiB branch default rather than the 32 MiB the other
variants carry: 32 MiB is a deliberate pin for variants that were measured at
it in release build #102329, and hash_shuffle_v2 has never run on this branch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…get to 128MiB

The Parquet footer indexer's default 32-actor pool times out (and trips Ray's
"too many worker processes" warning, polluting doctest output) when many test
targets run in parallel under CI. Rather than sprinkling per-module env writes,
set the pool size to 1 in one place per test surface:

- New python/ray/data/test.bzl wraps py_test/py_test_module_list/doctest to
  inject RAY_DATA_PARQUET_FOOTER_NUM_ACTORS=1 into every Data test target's env
  (caller-supplied env still wins).
- python/ray/data/tests/conftest.py and doctest_pytest_plugin.py setdefault the
  same var so non-bazel pytest runs match.
- python/ray/train/v2 gets shared _TRAIN_V2_TEST_ENV dicts plus a conftest
  setdefault, replacing the repeated per-target env literals.
- Drops the now-redundant os.environ write from test_predicate_pushdown.py.

Also raises the fallback bin-packing budget from 64MiB to 128MiB when
target_max_block_size is unset, and fixes the write_lance docstring example to
pass SaveMode.OVERWRITE so repeated doctest runs don't fail on an existing
dataset.

AI assistance was used for this change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…ault

Release build #102597 raised the footer indexer's fallback bin budget from
64 to 128 MiB. Comparing each test's delta-vs-its-own-master between #102329
and #102597, 24 of the 38 tests running on the fallback default got worse and
14 improved. This pins the 24 back to 64 MiB explicitly; the 14 keep following
the raised default.

The split is directional rather than arbitrary: among Parquet tests the
regressions are read-dominated (read_parquet_autoscaling -20.9% -> +3.1%,
read_large_parquet_autoscaling -8.1% -> +32.9%, count_parquet_autoscaling
-15.4% -> -1.7%) while the improvements are shuffle/sort-heavy
(random_shuffle_chaos +67.8% -> +14.9%, sort_fixed_size +22.2% -> +2.1%). Same
tension the aggregate_groups and map_groups comments already describe.

read_from_uris, iceberg_benchmark and iter_batches are split out of their
matrices so only the affected variant is pinned and the others keep following
the default. training_ingest_benchmark is pinned at block level with
s3_read_images_gpu exempted.

Caveats recorded in the per-test comments:

- Eight of the 24 pins are inert. read_images_*, read_tfrecords and the
  s3_url_image_* / s3_read_images_cpu ingest variants do not read Parquet. mix
  reads 513 single-row-group files of ~88 MB, which pack one file per bin at
  both 64 and 128 MiB. These tests did move, but not because of this knob.
- mix and distributed_training.chaos define their own runtime_env, which
  replaces the DEFAULTS list, so they already ran without the RAYTEST_* guards
  (and chaos without FOOTER_NUM_ACTORS=20). Left as-is rather than changed
  under cover of this commit.
- The two builds differ by 46 merged master commits, so these deltas are not a
  controlled A/B of the budget alone.

Verified by expanding the yaml through the same DEFAULTS/variations/matrix
logic ray_release.config uses, before and after: test name set identical at
199, all 24 targets at 64 MiB, no non-target budget changed, no test lost or
had an env var altered.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…moke test

Extends the pattern from 74e599b to two more test surfaces. The Parquet
footer indexer's production default of 32 actors times out and trips Ray's
"too many worker processes" warning when many test targets run in parallel
under CI.

- python/ray/air/BUILD.bazel gets three shared env dicts (_AIR_TEST_ENV,
  _AIR_TEST_ENV_TRAIN_V1, _AIR_TEST_ENV_TF) replacing the repeated per-target
  literals, so all 20 py_test targets under python/ray/air/tests get
  RAY_DATA_PARQUET_FOOTER_NUM_ACTORS=1. The three dicts preserve the existing
  RAY_TRAIN_V2_ENABLED 1-vs-0 split, which six of those targets depend on.
- python/ray/air/tests/conftest.py setdefaults the same var so non-bazel pytest
  runs match. This also covers tests/execution, which has no conftest of its
  own.
- //release:xgboost_train_batch_inference_benchmark_smoke_test gets the var
  inline; a shared dict would be indirection for a single target.

Verified by resolving each air target's env before and after: 20/20 now set the
var and no target had any other env value change.

Not included: the py_doctest[air] target, whose glob excludes tests/**, and the
four sibling smoke tests in release/BUILD.bazel that carry the same
RAY_TRAIN_V2_ENABLED=1 env (air_benchmark_gpu_batch_inference_parquet in
particular reads Parquet and will likely want the same treatment).

AI assistance was used for this change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…ld for map_batches release test

Signed-off-by: Goutam <[email protected]>
ListFiles.predicate / projected_columns / limit were mirrored onto the op by
hand from three separate rules (predicate, projection and limit pushdown).
Nothing enforced the invariant those copies rest on -- that ListFiles never
prunes by more than the downstream ReadFiles actually applies -- so a future
rule that rewrote or dropped the scanner's predicate without re-syncing would
leave ListFiles pruning row groups the reader would have kept, dropping rows
with no error.

Replace the mirroring with DeriveListFilesPushdown, which recomputes every
ListFiles' state from its consuming ReadFiles scanner. It runs in
LogicalOptimizer._post_optimize, after the rule loop reaches a fixed point, and
derives unconditionally in both directions: a ListFiles whose consumer is not a
ReadFiles is reset to no constraints. The worst a future rule can now cause is
listing more than it needs to.

Also replace the getattr(scanner, "predicate", None) access with abstract
pushed_predicate() / pushed_limit() accessors on the scanner mixins, mirroring
the existing pruned_column_names(), so a field rename is a type error rather
than a silent no-op.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…e_env

deep_update merges dicts but overwrites lists, so a test that declares its own
cluster.byod.runtime_env replaces the DEFAULTS list rather than extending it.
Pinning a bin budget therefore silently dropped RAY_DATA_DEBUG_RESOURCE_MANAGER
and all three RAYTEST_FAIL_ON_* flags: 27 tests had stopped failing on worker
OOM, dead nodes and spilling. It also split failure semantics across halves of
the same test -- read_large_parquet_autoscaling kept the flags while its
fixed_size twin lost them.

Re-list the four inherited entries in every affected block, leaving the two
that override them deliberately (heterogeneous_memory_batch_inference_
multitenancy and cross_az_...) alone. Verified by expanding both configs: the
resolved failure flags and cluster_compute of all 199 tests now match master
exactly.

Also drop the redundant cluster_compute on iter_batches_pyarrow. It pinned the
same value DEFAULTS supplies, so the baseline was never broken, but keeping it
would stop the variant tracking its former matrix siblings if DEFAULTS moves.
Document the list-replacement trap at the DEFAULTS block.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
Nothing exercised the two push-downs together, and nothing used nulls. The
combination is where the fully_matched classification matters: listing stops
early once the num_rows of fully-matched row groups reaches the pushed limit,
so counting a non-surviving row would make Limit return fewer rows than asked
for, with no error. Parquet min/max statistics are computed over non-null
values only, which makes a group whose non-null values all satisfy the filter
look fully matched by bounds alone.

Arrow's row-group pruning turns out to be null-aware -- it declines to prune
such a group by ~filter, so the classification is already correct -- but that
was untested. Add one parameterized end-to-end test. The fixture is
deliberately lopsided at 10 survivors per 100 rows: the early stop is evaluated
per file, so a fixture with a small shortfall passes even when the
classification is wrong, the last file's overshoot covering the deficit. With
the misclassification injected, the 100- and 200-row limits fail.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…ion test

pyrefly resolved `replace(read_files.input_dependencies[0], predicate=...)`
against `LogicalOperator` and `read_files.scanner.push_filters(...)` against the
base `Scanner`, neither of which carries those fields or methods. Route both
through narrowing helpers, and take `Plan` in `_list_files_of` since that is
what `Optimizer.optimize` returns.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
…ests

A matrix cannot vary ``byod.runtime_env`` per setup value, so the variants that
need their own tuning are spelled out. Rendered test names are unchanged.

- q1 autoscaling: keep the 192 MiB bin budget of the fixed_size variants and
  scale up at 60% utilization instead of the 0.75 default. Both autoscaling
  variants land at 364-385s regardless of shuffle strategy while master runs
  hash_shuffle in 249s, which points at scale-up latency, not shuffle cost.
- q17 autoscaling: 64 MiB. Smaller bins mean more read tasks, which give the
  autoscaler demand to act on earlier; the fixed_size variant is ~5x faster on
  the same query at the default budget.
- q22 fixed_size/hash_shuffle: 16 MiB. At the 128 MiB default this sf100 scan
  collapses into a handful of bins and starves a 23-second query of read
  parallelism (+76.7% vs master in #102732, +72.0% in #102650).

Each spelled-out entry re-lists the four inherited RAYTEST_FAIL_ON_* /
RAY_DATA_DEBUG_RESOURCE_MANAGER vars, since a test-level runtime_env replaces
the DEFAULTS list rather than extending it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
The target ran two full ``TorchTrainer.fit()`` runs (2 workers, 3 epochs) plus
a ``ray.init`` per parameterization inside small's 60s budget, and timed out at
60.3s on both attempts in CI.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
``ParquetFileFragment.subset`` and ``.metadata`` open the file to read its
footer, so on remote storage they fail with the same transient errors the rest
of the read path already retries -- an sf1000 lineitem read died on "AWS Error
NETWORK_CONNECTION ... curlCode: 28" inside ``subset``. Route both through
``call_with_retry`` with the context's ``retried_io_errors``.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
tpch_q18_autoscaling_hash_shuffle_v2 has failed two builds running: in #102732
the workload completed in 2075.9s and was then failed by
RAYTEST_FAIL_ON_SPILLING on 4.62 GiB spilled against a 17.75 GiB object-store
peak (61.6% utilization) -- spill under moderate pressure rather than a cluster
out of memory, which is the shape a smaller bin budget is most likely to help.
Smaller bins also give the autoscaler demand to act on earlier, as for q17.

tpch_q21_autoscaling_hash_shuffle_v2 fails the same way and is left at the
default as a control. The matrix cannot vary ``byod.runtime_env`` per setup
value, so the two scaling variants are spelled out; rendered test names are
unchanged, and the autoscaling entry re-lists the four inherited
RAYTEST_FAIL_ON_* / RAY_DATA_DEBUG_RESOURCE_MANAGER vars.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Goutam <[email protected]>
Signed-off-by: Goutam <[email protected]>
…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]>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@AarryaSaraf
AarryaSaraf marked this pull request as ready for review August 12, 2026 00:48
@AarryaSaraf
AarryaSaraf requested review from a team as code owners August 12, 2026 00:48
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

# A single task is required when shuffle needs one global RNG over
# the full listing, or when the indexer bin-packs read units itself
# (it must see the whole file stream to pack globally).
should_parallelize=shuffle_config is None and not yields_read_units,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shuffle collapses footer bins

High Severity

With the footer indexer, ListFiles already emits bin-packed read units and skips the partitioner (yields_read_units). When shuffle="files" is set, shuffle_files still concatenates every sealed bin into one manifest and shuffles rows, with no re-bucketing afterward. That turns the whole dataset into a single read task and drops the intended file-level shuffle grouping.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 663b469. Configure here.

return

num_workers = min(_DEFAULT_NUM_THREADS, len(fragments_with_offsets))
num_workers = len(fragments_with_offsets)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Uncapped fragment read threads

Medium Severity

num_workers is now len(fragments_with_offsets) with no upper bound, replacing the previous capped RAY_DATA_READ_FILES_NUM_THREADS default of 4. Large bins, or include_row_hash fan-out to one fragment per row group, can spawn hundreds of reader threads on top of the new process-wide Arrow IO pool of 128.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 663b469. Configure here.

@ray-gardener ray-gardener Bot added do-not-merge Do not merge this PR! data Ray Data-related issues release-test release test labels Aug 12, 2026
…attribution, and a consume path that keeps stats

Three observability gaps made the multi-node read A/Bs hard to read. All
three are harness-side; no reader or executor behavior changes.

1. Consumption dropped the executor's final stats. Every driver consumed
   via ``ds.iter_internal_ref_bundles()``, which passes
   ``capture_executor=False``, so a later ``get_stats_summary()`` stayed
   pinned to the snapshot ``_execute_to_iterator`` caches right after the
   FIRST bundle. ``extra_metrics`` -- where every per-task USS/RSS field
   lives -- therefore reported one task's numbers, deterministically, not
   the job's. New ``benchmark.consume_ref_bundles(ds, per_bundle=None)``
   iterates the same zero-copy bundles with ``capture_executor=True`` and
   replaces the call at all seven sites. It deliberately skips
   ``_synchronize_progress_bar()``, which force-shuts a captured executor
   and would truncate consumption to a single bundle.

   Also fixed while converting: ``join_benchmark`` counted rows with
   ``ds.count()``, executing a second copy of the plan and leaving the
   reported handle without stats, and ``gpu_batch_inference`` assigned
   ``collect_dataset_stats(ds)`` and overwrote it on the next line.

2. Per-operator metrics ran in 3 of 10 drivers. ``collect_operator_metrics``
   now also runs in map, groupby, join, sort, backpressure and
   gpu_batch_inference, and emits the full per-task distributions
   (``max_uss_per_task_dist``, ``max_rss_per_task_dist``,
   ``task_duration_dist``: num_samples/mean/variance/min/max/p25-p99 from
   the operator's DistributionTracker) alongside the existing avg/max
   scalars. groupby's ``consume_fn`` had to start returning the consumed
   handle -- stats attach to the handle that was consumed, not the one
   that was built.

3. Nothing attributed node memory to a stage. New ``node_memory_monitor.py``
   runs one ``num_cpus=0`` actor per node (node-affinity, soft=False),
   sampling every ``ray::*`` process bucketed by proctitle -- i.e. by
   stage -- plus the node's own used bytes from cgroup v2 -> cgroup v1 ->
   /proc/meminfo -> psutil, reporting which source it used rather than
   guessing. Peaks fold into each case's result dict and a full JSONL
   trace lands next to the result JSON. Off by default; enabled per test
   with RAY_DATA_BENCH_NODE_MEM_MONITOR=1, which is now set in the
   DEFAULTS block and in every test that declares its own runtime_env
   (a test's own list replaces the DEFAULTS one rather than extending it).
   Costs ~0.1 GB per node.

USS is Linux-only (MemoryProfiler); the fields are None elsewhere.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Aarrya <[email protected]>
(cherry picked from commit d92432e)
AarryaSaraf and others added 4 commits August 14, 2026 15:29
…t its parent

``_outdir`` fell back to ``dirname(abspath("."))`` when TEST_OUTPUT_JSON was
unset, which is the *parent* of the working directory, not the working
directory. ``Benchmark.write_result`` defaults to ``./result.json``, so the
trace landed one directory above the result JSON it is supposed to sit
beside -- contradicting the module docstring's "else CWD".

Release runs were unaffected (the release environment always sets
TEST_OUTPUT_JSON); this only misplaced traces on local runs. The fallback
now mirrors write_result's default verbatim.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Aarrya <[email protected]>
(cherry picked from commit beacf74)
ReadFiles tasks now report ReadFilesTaskStats (decode wall seconds, decoded
bytes/batches/rows, largest single yielded table, manifests) through the
upstream CustomOpStats slot on TaskExecWorkerStats. OpRuntimeMetrics folds
them into per-task DistributionTrackers (read_task_decoded_bytes /
read_task_decode_wall_s / read_task_peak_batch_bytes) and benchmark.py
exports the distributions into result.json, so release A/B runs record what
the DECODER did per task, independent of the memory profiler. The stats
object is reported up front and updated in place: whether any output block
is emitted after the read generator's last resume depends on buffer/batch
alignment (reader-dependent), so a single end-of-task report is silently
dropped on some shapes — verified live on the PyArrow arm.

Reader-implementation agnostic: identical instrumentation for the PyArrow
and arrow-rs Parquet readers (do_read wraps both).

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>
…z default

At 1 Hz, any map task shorter than ~3 s gets its max-USS from the single
synchronous end-of-task sample — end-of-task resident memory, not peak
working set. That made 16 of 37 per-task-instrumented tests unmeasurable
in the 2026-08-14 A/B and produced one artifact regression outright. A
sample is one /proc/self/statm read, so 20 Hz is ~0.01% CPU per worker.
Harness-level override only (RAY_DATA_BENCH_MEMORY_POLL_S to change);
the conservative upstream DataContext default is untouched.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>
… peak node)

Mirror of e64e712's node_memory_monitor.py change on the baseline arm so
both A/B arms report node_mem_p50/p90_worker_uss_gb identically.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>
elliot-barn added a commit that referenced this pull request Aug 21, 2026
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]>
AarryaSaraf and others added 2 commits August 24, 2026 14:07
…ck granularity

Two halves of one observability gap (tpch rows had no operator breakdown
at all, so the q20 hash_shuffle_v2 wall loss could not be attributed):

- benchmark.py collect_operator_metrics now emits output_num_blocks and
  block_size_bytes_{min,mean,max} per operator (StatsSummary is per-block,
  so its count/min/mean/max ARE the block-size distribution), plus
  read_output_num_blocks / read_block_size_bytes_mean conveniences --
  the reader-output-granularity signal feeding shuffle stages.
- tpch/common.py grows record_dataset(): queries wrap their final
  .materialize() so the Dataset handle (previously dropped inside
  benchmark_fn) reaches collect_operator_metrics; run_tpch_benchmark
  merges the per-operator metrics into the result row. 18 queries
  converted; q6/q14 end in scalar aggregate() and keep no handle
  (q17 records its intermediate materialize).

Smoke-tested: read + HashAggregate _shuffle/_finalize sub-operators all
report block counts/sizes; result dict JSON-serializable.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>
New collect_task_distribution() in run_fn: tasks-per-worker /
workers-per-node distributions, task durations, worker lifespan (first
task start to last task end) and worker busy fraction, from the state
API's task list filtered to tasks started after the case began.

Motivation: the two open retention regressions (autoscaling read,
fused read->write) show diverging task-USS at identical per-task
decoder behavior, and never reproduce single-node. A placement
asymmetry would explain both: the faster arm satisfies autoscaling
demand with fewer workers, so each worker runs more tasks and
accumulates a higher between-tasks floor. These aggregates make
tasks-per-worker directly comparable across arms; identical placement
plus diverging USS would leave allocator retention as the only
remaining suspect.

Fail-soft like the other collectors (empty dict on state-API failure);
task_dist_truncated flags the 10k state-API cap instead of erroring.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>

@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 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 456d877. Configure here.

4,
),
**node_mem.summary(),
**collect_task_distribution(case_start_unix_ms),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unconditional expensive task listing

Medium Severity

collect_task_distribution always runs inside shared Benchmark.run_fn, calling list_tasks(detail=True, limit=10_000) after every case with no env gate. Unlike the node memory monitor, this hits every dataset nightly that uses Benchmark, not only the Parquet A/B, and detailed state-API fetches at that scale can add large post-case latency and load on multi-node jobs.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 456d877. Configure here.

# This avoids a double S3 read of lineitem and reduces the groupby
# from the full lineitem table to only matching rows.
joined = (
joined = record_dataset(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Q17 records intermediate dataset

Low Severity

record_dataset wraps the early joined materialize, while record_dataset's contract is the query's final dataset. Later groupby, join, filter, and aggregate still run and count toward timed runtime, but their operator stats never reach collect_operator_metrics, so Q17's operators_detail omits a large post-read slice of the plan.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 456d877. Configure here.

## What

`docker/base-extra/Dockerfile` installs the apt package
`google-cloud-sdk`, which no longer exists. Renames it to
`google-cloud-cli`. One word, one line.

## Why

Any `base-extra` build that misses the layer cache fails outright:

```
Package google-cloud-sdk is not available, but is referred to by another package.
However the following packages replace it:
  google-cloud-cli
E: Package 'google-cloud-sdk' has no installation candidate
=> ERROR: process "/bin/bash -c /dev/pipes/EOF" ... exit code: 100
```

The package name is simply gone from Google's repo — confirmed against
the live index, in every suite it serves:

```
$ curl -s https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-amd64/Packages \
    | awk '/^Package: /{print $2}' | sort -u
google-cloud-cli
google-cloud-cli-anthos-auth
... (28 more google-cloud-cli-* components)
kubectl

# google-cloud-sdk stanzas per suite (amd64 / arm64):
cloud-sdk           0    cloud-sdk-jammy  0    cloud-sdk-bullseye  0
# google-cloud-cli stanzas: 49 in each
```

The rename happened at 467.0.0 — `google-cloud-cli` still carries
`Replaces: google-cloud-sdk (<< 467.0.0-0)`, which is the metadata apt
is reading when it suggests the replacement. A `Replaces` relationship
is not an installation candidate, so the install fails anyway. The old
name kept resolving only while some version providing it remained in the
repo's retention window; the oldest version now retained is `536.0.1-0`,
so that window has rolled past.

## Why this surfaced now, not at the rename

The layer is normally an ECR cache hit, so the apt step never executes.
It only runs on a cache miss:

```
cache image miss: GET .../rayproject/citemp/manifests/z-ac0c9dae...: MANIFEST_UNKNOWN: Requested image not found
```

The same commit and the same Dockerfile therefore built green on
2026-08-24 (`cache hit: sha256:09ec1be3...`) and failed on 2026-08-27. A
green older build is not evidence the Dockerfile still builds — every
image layering on `base-extra` (ray, ray-ml, ray-torch, all Python
versions) hits this once its cache entry is gone.

## Precedent

`ci/docker/forge.Dockerfile:64` already installs `google-cloud-cli` from
the same repo, same key, same apt source line. This only brings
`base-extra` in line with it; the source list and key handling are
unchanged.

## Testing

Reproduced the CI failure and verified the fix in `ubuntu:22.04` (the
image's base), using the same apt source and key as the Dockerfile:

```
--- OLD NAME (expected to fail) ---
However the following packages replace it:
  google-cloud-cli
E: Package 'google-cloud-sdk' has no installation candidate

--- NEW NAME (expected to resolve) ---
Inst google-cloud-cli (582.0.0-0 cloud-sdk:cloud-sdk [amd64])
Conf google-cloud-cli (582.0.0-0 cloud-sdk:cloud-sdk [amd64])
Google Cloud SDK 582.0.0
```

No loss of tooling — the CLI entry points are all still provided:

```
gcloud   -> /usr/bin/gcloud
gsutil   -> /usr/bin/gsutil      (gsutil version: 5.37)
bq       -> /usr/bin/bq
```

Both architectures the image builds are covered: `google-cloud-cli` has
49 versions in the `binary-amd64` index and 49 in `binary-arm64`.

Real verification is CI building `base-extra` on this PR.

## Not a duplicate

`gh pr list --state open --search "google-cloud-cli"` returns nothing,
and no open PR touches `docker/base-extra/Dockerfile`. Its last three
commits (ray-project#61497, ray-project#60878, ray-project#60687) are unrelated.

## AI assistance

AI assistance was used: diagnosing the failing Buildkite job, confirming
the package's absence against the live apt index, and running the
container reproduction above. Every changed line was reviewed and every
command shown was run and its output confirmed before requesting review.

Signed-off-by: elliot-barn <[email protected]>
Signed-off-by: Aarrya <[email protected]>
goutamvenkat-anyscale added a commit that referenced this pull request Sep 2, 2026
## Why

The last step of the split of #64985: flip Parquet V2 to the footer read
path, delete the blind one, and tune the release tests so this can be
validated by a real release run.

Everything it depends on has landed — footer types and the bin packer
(#65210), the `FooterReader` actor pool (#65273), the indexer plus
`count()` fix and packer-as-partitioner (#65596), reader IO tuning
(#65806), and test env pinning (#65169). The path has been reachable
behind `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` since #65596; this makes
it the only path.

## Flow

```mermaid
flowchart LR
  RP[read_parquet] --> FF["FooterFileIndexer<br/>+ OnlineBinPacker"]
  RP -.->|deleted| PC["ParquetFileChunker<br/>size-estimated chunks<br/>+ parquet_chunker_target_chunk_size"]
  style PC stroke-dasharray: 4 4
```

## What changed

**The flip** — `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` is gone from
both call sites. `_get_file_indexer()` always returns
`FooterFileIndexer`; `get_file_partitioner()` always returns
`OnlineBinPacker`.

**The deletions** — `ParquetFileChunker`, `ParquetFileChunkMetadata`,
`_calculate_row_group_range`, `_fragments_from_chunk_metadata`, and the
tests covering only that path.

**The config it left behind** —
`DataContext.parquet_chunker_target_chunk_size` and
`DEFAULT_PARQUET_CHUNKER_TARGET_CHUNK_SIZE` were read *only* by
`ParquetFileChunker.__init__`, so they would otherwise stay declared and
documented while doing nothing. Verified dead by grep across `.py` /
`.yaml` / `.rst` / `.md`.

**Reader pool defaults** — `RAY_DATA_PARQUET_READER_IO_THREAD_COUNT`
128, `RAY_DATA_PARQUET_READER_CPU_COUNT` 32.

## Release tests tuned

Budgets are per-test overrides of `RAY_DATA_PARQUET_BIN_PACKING_BYTES`
(uncompressed bytes of row-group data per read task; default 128 MiB).
The shape of the tuning: reads over few large groups want **large**
bins, because small bins shatter the read into short tasks the executor
cannot dispatch fast enough and the cluster idles; shuffle-bound reads
over many groups want **small** bins.

Rows whose variants all share the same tuning are collapsed and marked.

| release test | bin budget | other tuning |
| --- | --- | --- |
| `aggregate_groups_fixed_size_hash_shuffle_column02 column14` | 32 MiB
| — |
| `aggregate_groups_fixed_size_hash_shuffle_column08 column13 column14`
| 128 MiB | — |
| `aggregate_groups_fixed_size_shuffle_v2_column02 column14` | 64 MiB |
— |
| `aggregate_groups_fixed_size_shuffle_v2_column08 column13 column14` |
512 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column02
column14` | 32 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column08 column13
column14` | 256 MiB | — |
| `count_parquet_fixed_size` | 64 MiB | — |
| `cross_az_map_batches_autoscaling_iptable_failure_injection` | 1 GiB |
— |
| `distributed_training` | — | footer actors `20` |
| `flat_map` | 64 MiB | — |
| `iceberg_benchmark_overwrite` | 64 MiB | — |
| `iter_batches_pyarrow` | 64 MiB | — |
| `iter_torch_batches` | 64 MiB | — |
| `joins_{{dataset}}_{{join_type}} *(all 4 variants)*` | 1.25 GiB | — |
| `map` | 64 MiB | — |
| `map_batches_fixed_size_{{compute}}_{{format}}_{{repeat_map_batches}}
*(all 7 variants)*` | 1 GiB | scale-up threshold `0.6` |
| `map_groups_fixed_size_{{shuffle_strategy}}_{{columns}} *(all 6
variants)*` | 1.25 GiB | — |
| `mix` | — | footer actors `4` |
| `random_shuffle_fixed_size` | 64 MiB | — |
| `read_large_parquet_fixed_size` | 1 GiB | — |
| `read_parquet_fixed_size` | 64 MiB | — |
| `read_tfrecords` | 64 MiB | — |
| `streaming_split` | 64 MiB | footer batch `50`, result batch `50` |
| `to_tf` | 64 MiB | — |
| `tpch_q1_fixed_size_{{shuffle_strategy}} *(all 2 variants)*` | 192 MiB
| — |
| `training_ingest_benchmark` | 64 MiB | — |
| `wide_schema_pipeline_nested_structs` | 2 MiB | footer batch `1`,
footer actors `21`, io threads `5000` |
| `wide_schema_pipeline_objects` | 4.2 MiB | footer batch `1`, footer
actors `9`, io threads `5000` |
| `wide_schema_pipeline_primitives` | 256 KiB | footer batch `1`, footer
actors `27`, io threads `5000` |
| `wide_schema_pipeline_tensors` | 39 MiB | footer batch `1`, footer
actors `22`, io threads `5000` |
| `write_parquet` | 1.25 GiB | — |

**Three matrices are split**, because a matrix cannot vary
`byod.runtime_env` per value and their variants want different budgets:
`wide_schema_pipeline_{{data_type}}` into four entries, and one variant
each out of `iceberg_benchmark_{{mode}}` and `iter_batches_{{format}}`.
`aggregate_groups` keeps its matrix and carries the budget as a matrix
dimension with explicit adjustments. **Rendered test names are unchanged
— 121 before and after** — so release baselines still line up.

**Not carried over** from the original branch: 7 previously-pinned
entries no longer exist — the autoscaling variants removed in #65506,
plus `tpch_q20` and `tpch_q22`.

Any entry gaining its own `runtime_env` re-lists the four `DEFAULTS`
guards verbatim: `deep_update` overwrites lists rather than merging
them, so declaring one silently drops the OOM / dead-node / object-store
checks. (17 entries on master are already missing guards for this
reason; pre-existing, not touched here.)

`map_benchmark.py` also drops its `use_datasource_v2 = False` pin, which
existed because V2 was spilling.

> Budgets originally measured against the pre-decoupling design and
refined since. Packing moved between stages in #65596 but the packer and
its inputs did not, so bins should be unchanged — a release run against
this PR is what confirms that. The wide-schema tests are the first place
to look.

## Behavior change worth reviewing

**Read-task sizing no longer comes from `override_num_blocks` /
`read_op_min_num_blocks` for Parquet.** Bins are sized by
`RAY_DATA_PARQUET_BIN_PACKING_BYTES`, which is *also* not derived from
`DataContext.target_max_block_size`. That decoupling is deliberate —
read units are row-group-accurate rather than size-estimated — but it
means the two knobs users reach for first no longer affect Parquet read
parallelism. Deriving the budget from `target_max_block_size` is worth
considering as a follow-up; the per-test overrides above are the
evidence that a single global default does not fit every workload.

## Testing

```
$ python -m pytest -q python/ray/data/tests/datasource/test_parquet.py
286 passed, 6 skipped in 521.25s

$ python -m pytest -q python/ray/data/tests/datasource/test_read_parquet_v2.py
32 passed

$ python -m pytest -q python/ray/data/tests/unit/datasource_v2/ python/ray/data/_internal/datasource_v2/tests/
181 passed

$ python -m pytest -q python/ray/data/tests/test_predicate_pushdown.py \
                     python/ray/data/tests/test_execution_optimizer_limit_pushdown.py
78 passed
```

The 286-test parquet suite is the one that matters — it runs the full
read surface with the footer path as the default rather than behind a
flag. The release YAML is additionally checked for parse validity,
unresolved `{{...}}` in any pin, duplicate `byod:` keys, and
rendered-name stability.

## Stack

Final step of an 11-step split of #64985 (43 files / +3234 −719, not
reviewable as one unit).

- #65167 `[1]` · #65168 `[2]` · #65214 `[3]` · #65210 `[4]` · #65273
`[5]` · #65596 `[6]` · #65806 `[8]` · #65169 `[9]` — all merged
- `[7]` (count push-down fix) was absorbed into #65596
- `[10]` (release tuning) is folded into this PR, so a release run
exercises the flip and its tuning together
- **this PR** `[11/11]`

---
Not a duplicate. File-level overlap check: #63158 none; #65142 overlaps
`file_indexer.py` / `context.py`; #65406 / #65407 (arrow-rs reader A/B)
overlap broadly but are explicitly `[DO NOT MERGE]` benchmark branches
carrying the footer work out-of-tree.
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[email protected]>
@AarryaSaraf AarryaSaraf closed this Sep 8, 2026
@AarryaSaraf
AarryaSaraf deleted the arrow-rs-ab-baseline-64985 branch September 8, 2026 21:52
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ect#65821)

## Why

The last step of the split of ray-project#64985: flip Parquet V2 to the footer read
path, delete the blind one, and tune the release tests so this can be
validated by a real release run.

Everything it depends on has landed — footer types and the bin packer
(ray-project#65210), the `FooterReader` actor pool (ray-project#65273), the indexer plus
`count()` fix and packer-as-partitioner (ray-project#65596), reader IO tuning
(ray-project#65806), and test env pinning (ray-project#65169). The path has been reachable
behind `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` since ray-project#65596; this makes
it the only path.

## Flow

```mermaid
flowchart LR
  RP[read_parquet] --> FF["FooterFileIndexer<br/>+ OnlineBinPacker"]
  RP -.->|deleted| PC["ParquetFileChunker<br/>size-estimated chunks<br/>+ parquet_chunker_target_chunk_size"]
  style PC stroke-dasharray: 4 4
```

## What changed

**The flip** — `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` is gone from
both call sites. `_get_file_indexer()` always returns
`FooterFileIndexer`; `get_file_partitioner()` always returns
`OnlineBinPacker`.

**The deletions** — `ParquetFileChunker`, `ParquetFileChunkMetadata`,
`_calculate_row_group_range`, `_fragments_from_chunk_metadata`, and the
tests covering only that path.

**The config it left behind** —
`DataContext.parquet_chunker_target_chunk_size` and
`DEFAULT_PARQUET_CHUNKER_TARGET_CHUNK_SIZE` were read *only* by
`ParquetFileChunker.__init__`, so they would otherwise stay declared and
documented while doing nothing. Verified dead by grep across `.py` /
`.yaml` / `.rst` / `.md`.

**Reader pool defaults** — `RAY_DATA_PARQUET_READER_IO_THREAD_COUNT`
128, `RAY_DATA_PARQUET_READER_CPU_COUNT` 32.

## Release tests tuned

Budgets are per-test overrides of `RAY_DATA_PARQUET_BIN_PACKING_BYTES`
(uncompressed bytes of row-group data per read task; default 128 MiB).
The shape of the tuning: reads over few large groups want **large**
bins, because small bins shatter the read into short tasks the executor
cannot dispatch fast enough and the cluster idles; shuffle-bound reads
over many groups want **small** bins.

Rows whose variants all share the same tuning are collapsed and marked.

| release test | bin budget | other tuning |
| --- | --- | --- |
| `aggregate_groups_fixed_size_hash_shuffle_column02 column14` | 32 MiB
| — |
| `aggregate_groups_fixed_size_hash_shuffle_column08 column13 column14`
| 128 MiB | — |
| `aggregate_groups_fixed_size_shuffle_v2_column02 column14` | 64 MiB |
— |
| `aggregate_groups_fixed_size_shuffle_v2_column08 column13 column14` |
512 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column02
column14` | 32 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column08 column13
column14` | 256 MiB | — |
| `count_parquet_fixed_size` | 64 MiB | — |
| `cross_az_map_batches_autoscaling_iptable_failure_injection` | 1 GiB |
— |
| `distributed_training` | — | footer actors `20` |
| `flat_map` | 64 MiB | — |
| `iceberg_benchmark_overwrite` | 64 MiB | — |
| `iter_batches_pyarrow` | 64 MiB | — |
| `iter_torch_batches` | 64 MiB | — |
| `joins_{{dataset}}_{{join_type}} *(all 4 variants)*` | 1.25 GiB | — |
| `map` | 64 MiB | — |
| `map_batches_fixed_size_{{compute}}_{{format}}_{{repeat_map_batches}}
*(all 7 variants)*` | 1 GiB | scale-up threshold `0.6` |
| `map_groups_fixed_size_{{shuffle_strategy}}_{{columns}} *(all 6
variants)*` | 1.25 GiB | — |
| `mix` | — | footer actors `4` |
| `random_shuffle_fixed_size` | 64 MiB | — |
| `read_large_parquet_fixed_size` | 1 GiB | — |
| `read_parquet_fixed_size` | 64 MiB | — |
| `read_tfrecords` | 64 MiB | — |
| `streaming_split` | 64 MiB | footer batch `50`, result batch `50` |
| `to_tf` | 64 MiB | — |
| `tpch_q1_fixed_size_{{shuffle_strategy}} *(all 2 variants)*` | 192 MiB
| — |
| `training_ingest_benchmark` | 64 MiB | — |
| `wide_schema_pipeline_nested_structs` | 2 MiB | footer batch `1`,
footer actors `21`, io threads `5000` |
| `wide_schema_pipeline_objects` | 4.2 MiB | footer batch `1`, footer
actors `9`, io threads `5000` |
| `wide_schema_pipeline_primitives` | 256 KiB | footer batch `1`, footer
actors `27`, io threads `5000` |
| `wide_schema_pipeline_tensors` | 39 MiB | footer batch `1`, footer
actors `22`, io threads `5000` |
| `write_parquet` | 1.25 GiB | — |

**Three matrices are split**, because a matrix cannot vary
`byod.runtime_env` per value and their variants want different budgets:
`wide_schema_pipeline_{{data_type}}` into four entries, and one variant
each out of `iceberg_benchmark_{{mode}}` and `iter_batches_{{format}}`.
`aggregate_groups` keeps its matrix and carries the budget as a matrix
dimension with explicit adjustments. **Rendered test names are unchanged
— 121 before and after** — so release baselines still line up.

**Not carried over** from the original branch: 7 previously-pinned
entries no longer exist — the autoscaling variants removed in ray-project#65506,
plus `tpch_q20` and `tpch_q22`.

Any entry gaining its own `runtime_env` re-lists the four `DEFAULTS`
guards verbatim: `deep_update` overwrites lists rather than merging
them, so declaring one silently drops the OOM / dead-node / object-store
checks. (17 entries on master are already missing guards for this
reason; pre-existing, not touched here.)

`map_benchmark.py` also drops its `use_datasource_v2 = False` pin, which
existed because V2 was spilling.

> Budgets originally measured against the pre-decoupling design and
refined since. Packing moved between stages in ray-project#65596 but the packer and
its inputs did not, so bins should be unchanged — a release run against
this PR is what confirms that. The wide-schema tests are the first place
to look.

## Behavior change worth reviewing

**Read-task sizing no longer comes from `override_num_blocks` /
`read_op_min_num_blocks` for Parquet.** Bins are sized by
`RAY_DATA_PARQUET_BIN_PACKING_BYTES`, which is *also* not derived from
`DataContext.target_max_block_size`. That decoupling is deliberate —
read units are row-group-accurate rather than size-estimated — but it
means the two knobs users reach for first no longer affect Parquet read
parallelism. Deriving the budget from `target_max_block_size` is worth
considering as a follow-up; the per-test overrides above are the
evidence that a single global default does not fit every workload.

## Testing

```
$ python -m pytest -q python/ray/data/tests/datasource/test_parquet.py
286 passed, 6 skipped in 521.25s

$ python -m pytest -q python/ray/data/tests/datasource/test_read_parquet_v2.py
32 passed

$ python -m pytest -q python/ray/data/tests/unit/datasource_v2/ python/ray/data/_internal/datasource_v2/tests/
181 passed

$ python -m pytest -q python/ray/data/tests/test_predicate_pushdown.py \
                     python/ray/data/tests/test_execution_optimizer_limit_pushdown.py
78 passed
```

The 286-test parquet suite is the one that matters — it runs the full
read surface with the footer path as the default rather than behind a
flag. The release YAML is additionally checked for parse validity,
unresolved `{{...}}` in any pin, duplicate `byod:` keys, and
rendered-name stability.

## Stack

Final step of an 11-step split of ray-project#64985 (43 files / +3234 −719, not
reviewable as one unit).

- ray-project#65167 `[1]` · ray-project#65168 `[2]` · ray-project#65214 `[3]` · ray-project#65210 `[4]` · ray-project#65273
`[5]` · ray-project#65596 `[6]` · ray-project#65806 `[8]` · ray-project#65169 `[9]` — all merged
- `[7]` (count push-down fix) was absorbed into ray-project#65596
- `[10]` (release tuning) is folded into this PR, so a release run
exercises the flip and its tuning together
- **this PR** `[11/11]`

---
Not a duplicate. File-level overlap check: ray-project#63158 none; ray-project#65142 overlaps
`file_indexer.py` / `context.py`; ray-project#65406 / ray-project#65407 (arrow-rs reader A/B)
overlap broadly but are explicitly `[DO NOT MERGE]` benchmark branches
carrying the footer work out-of-tree.
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[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 do-not-merge Do not merge this PR! release-test release test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants