TL;DR
RayOrch is a novel programming model and distributed execution engine designed to accelerate data preparation for foundation models. By explicitly tracking parent-child data relationships (structural lineage) at runtime, RayOrch enables efficient cross-parent GPU batching while completely avoiding the expensive global regrouping bottlenecks and messy failure propagation typical of existing frameworks.
What Problem Does This Paper Address?
Preparing high-quality training data for large language and vision-language models is a massive engineering challenge. Pipelines for processing layout-rich documents or long videos must repeatedly change their "unit of processing"—a single video fans out into multiple clips, frames, and audio segments, while a PDF document splits into highly variable numbers of pages, regions, and tables.
This creates a fundamental tension in distributed execution:
- Logical Structure: To maintain correctness, the system must eventually reconstruct the data in its original order and track when all parts of a parent item (like a specific video or document) are complete.
- Physical Execution: To maximize GPU utilization, the system needs to pack fine-grained items from different parents into dense execution batches.
Existing data-pipeline frameworks (like Ray Data or Daft) typically flatten the data into a single stream to achieve parallel batching. However, this forces the application to manually track parent IDs, manage ordering, and perform expensive global GROUPBY and SORT operations to rebuild the original structure. If one parent item has a massive number of children (a long-tailed distribution), it creates a bottleneck where downstream actors sit idle waiting for a global barrier.
Methods
RayOrch solves this by separating the logical data structure from physical execution.
- Declarative Primitives: Developers write pipelines using explicit structural operators like
F.expand(to declare a parent-to-child split) andF.reduce(to declare the matching child-to-parent gather). - Runtime Lineage Tracking: Instead of forcing the application to remember metadata, the RayOrch runtime automatically records each child's immediate parent, its immutable position (ordinal), and its terminal state.
- Per-Call FIFO Ready Queues: Grains (the unit of scheduling) enter a first-in, first-out queue as soon as their inputs are ready. Physical batches are formed elastically across different parents, allowing completed parents to immediately advance to the next stage without waiting for slower, unrelated data units.
- Lineage-Scoped Failure Containment: If a specific parent encounters a failure (e.g., a corrupted page in a PDF), RayOrch immediately suppresses all undispatched sibling items for that parent, preventing wasted GPU/CPU cycles while letting unrelated parents continue uninterrupted.
Datasets
The authors evaluated RayOrch across three real-world multimodal data preparation workloads:
- MinerU Workload: 3,689 PDFs totaling 174,744 valid pages, processed via a pipeline of rendering, vision-language model (VLM) OCR, and markdown assembly.
- Docling Workload: 2,000 PDFs undergoing layout analysis, OCR, and table parsing.
- Video Workload: 27,091 videos breaking down into 104,952 clips, processed using the Qwen2.5-VL-7B model.
Key Insights and Ideas
- Transient Batches, Persistent Lineage: The core "aha" moment is that physical batches should be transient, but logical structure must be persistent. By keeping lineage state in the runtime control plane, physical batch boundaries no longer dictate completion or reconstruction boundaries.
- Eliminating the Post-Stage Shuffle Tail: Traditional flat-record architectures suffer from a long tail where data must be globally shuffled and re-sorted before final assembly. RayOrch completely eliminates this barrier; because it tracks immutable ordinals natively, parent items can be reconstructed locally and incrementally.
Key Results
RayOrch demonstrates exceptional performance and near-linear strong scaling on NVIDIA H20 GPUs:
- Scalability: On the MinerU pipeline, scaling from 4 to 64 GPUs yielded a 15.14× speedup (94.6% of ideal linear scaling). The video pipeline achieved a 7.82× speedup when scaling from 8 to 64 GPUs.
- End-to-End Speedups: RayOrch reduced end-to-end processing time on MinerU by 13.1% versus Ray Data and 29.0% versus Daft. On the Docling workload, it outperformed Ray Data by 16.0%.
- Failure Containment Efficiency: In controlled failure-injection experiments, RayOrch successfully blocked 6,241 doomed sibling computations from executing, reducing overall wall time by 14.93% compared to systems without sibling suppression.
Limitations and Future Work
While highly optimized for hierarchical data preparation, RayOrch has specific structural boundaries:
- It does not support general relational joins or windowing operations that span across different source microbatches.
- It does not support feedback loops (cycles) within the dataflow graph.
- The current implementation is tailored to finite, acyclic domain trees, meaning it is optimized for batch data preparation rather than unbounded, continuous streaming applications.
Summary updated