Commit 71a1bf2
[Data] Parallelize ListFiles for the footer indexer; per-test bin budgets
## 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) <noreply@anthropic.com>
Signed-off-by: Goutam <goutam@anyscale.com>1 parent 26cdef2 commit 71a1bf2
4 files changed
Lines changed: 93 additions & 15 deletions
File tree
- python/ray/data/_internal
- datasource_v2/listing
- planner
- release
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | | - | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| |||
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
204 | 224 | | |
205 | 225 | | |
206 | 226 | | |
| |||
228 | 248 | | |
229 | 249 | | |
230 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
231 | 254 | | |
232 | 255 | | |
233 | 256 | | |
| |||
269 | 292 | | |
270 | 293 | | |
271 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
272 | 299 | | |
273 | 300 | | |
274 | 301 | | |
| |||
304 | 331 | | |
305 | 332 | | |
306 | 333 | | |
307 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
308 | 344 | | |
309 | 345 | | |
310 | 346 | | |
| |||
328 | 364 | | |
329 | 365 | | |
330 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
331 | 378 | | |
332 | 379 | | |
333 | 380 | | |
| |||
359 | 406 | | |
360 | 407 | | |
361 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
362 | 420 | | |
363 | 421 | | |
364 | 422 | | |
| |||
404 | 462 | | |
405 | 463 | | |
406 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
407 | 471 | | |
408 | 472 | | |
409 | 473 | | |
| |||
1443 | 1507 | | |
1444 | 1508 | | |
1445 | 1509 | | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1446 | 1519 | | |
1447 | 1520 | | |
1448 | 1521 | | |
| |||
0 commit comments