|
| 1 | +# RayOrch v0.1.1 Release Note |
| 2 | + |
| 3 | +## 🇨🇳 中文 |
| 4 | + |
| 5 | +### 🚀 RayOrch v0.1.1:跨 DAG Stage 复用同一个 Actor Pool |
| 6 | + |
| 7 | +RayOrch v0.1.1 是一个保持 0.1 编程接口兼容的小版本更新,新增了**跨 DAG Stage 共享 Actor Pool**的能力。对于需要连续调用同一套常驻模型的流水线,用户可以继续把不同阶段表达为独立的逻辑 Call,同时避免重复创建 Actor 和重复加载模型。 |
| 8 | + |
| 9 | +📄 **论文:** [RayOrch: Programming and Executing Lineage-Controlled Multi-Grain Dataflows for Foundation-Model Data Preparation](https://arxiv.org/abs/2609.18703) |
| 10 | + |
| 11 | +### ✨ 主要更新 |
| 12 | + |
| 13 | +#### 1. 同一个 `RayModule` 可以服务多个逻辑 Call |
| 14 | + |
| 15 | +在 `Pipeline.forward()` 中重复调用同一个 `RayModule` 对象时,这些调用会保留各自独立的 DAG 依赖、batching 和恢复状态,但共享同一个物理 Actor Pool: |
| 16 | + |
| 17 | +```python |
| 18 | +import rayorch as ro |
| 19 | + |
| 20 | + |
| 21 | +class ModelStack: |
| 22 | + def run(self, items, *, stage): |
| 23 | + if stage == "infer": |
| 24 | + return infer(items) |
| 25 | + return finish(items) |
| 26 | + |
| 27 | + |
| 28 | +class SharedModelPipeline(ro.Pipeline): |
| 29 | + def __init__(self): |
| 30 | + self.model = ro.RayModule(ModelStack).ray_options( |
| 31 | + replicas=4, |
| 32 | + batch_size=16, |
| 33 | + num_gpus=1, |
| 34 | + ) |
| 35 | + |
| 36 | + def forward(self, inputs): |
| 37 | + inferred = self.model(inputs, stage="infer") |
| 38 | + return self.model(inferred, stage="finish") |
| 39 | +``` |
| 40 | + |
| 41 | +这里的 `Infer` 与 `Finish` 是两个独立的逻辑 Call,但四个 Actor 只初始化四套模型,而不是八套。请求状态仍通过 Port 显式传递,不依赖任务再次调度到同一个副本。 |
| 42 | + |
| 43 | +#### 2. 支持静态关键字参数 |
| 44 | + |
| 45 | +`RayModule` 调用现在可以同时接收动态 Port 和普通静态关键字参数,例如 `stage="infer"`。静态参数会进入编译后的 Call contract,并在每次执行时传给 UDF,不需要把控制信息包装进业务数据。 |
| 46 | + |
| 47 | +#### 3. 调度与指标按逻辑 Call、物理 Pool 分层 |
| 48 | + |
| 49 | +每个逻辑 Call 保留独立的 batch、恢复策略和调用指标;副本数、Ray 资源和 UDF 实例归属于共享 Pool。调度器会在共享同一 Pool 的 Call 之间轮转选择就绪工作,同时继续遵守输入 batch 隔离、失败恢复与血缘顺序语义。 |
| 50 | + |
| 51 | +### ⚡ Flash-MinerU 验证 |
| 52 | + |
| 53 | +Flash-MinerU 的 `v4-advanced-shared` 管线使用该能力,将 MinerU 4 Advanced 的 `Infer` 与 `Finish` 拆成两个可独立 rebatch 的阶段,同时复用每张 GPU 上常驻的 Layout、Two-Step VLM、MFR 和 OCR 模型栈。 |
| 54 | + |
| 55 | +在同一组 **368 个 PDF、7,072 页、4× NVIDIA H20** 上: |
| 56 | + |
| 57 | +- Native MinerU:1,942.44 秒; |
| 58 | +- Flash-MinerU `v4-advanced-local`:1,350.25 秒; |
| 59 | +- Flash-MinerU `v4-advanced-shared`:1,234.60 秒; |
| 60 | +- 相对 Native 执行阶段加速:**1.57×**; |
| 61 | +- 相对未拆分的 local pipeline 进一步提升:**9.4%**; |
| 62 | +- 368/368 个文档和 7,072/7,072 页完成,无页数或血缘错位; |
| 63 | +- 平均 token Jaccard:**0.9945**,平均 token multiset F1:**0.9906**。 |
| 64 | + |
| 65 | +这些结果来自指定负载和硬件,不代表所有流水线都能获得相同收益。共享 Actor Pool 主要适合多个 DAG Stage 需要复用同一套昂贵常驻状态、且阶段之间仍存在独立 rebatching 机会的场景。 |
| 66 | + |
| 67 | +### ✅ 兼容性与验证 |
| 68 | + |
| 69 | +- `Pipeline`、`RayModule`、`F.expand`、`F.reduce`、`Executor` 和 `pipeline.run()` 的公开使用方式保持不变。 |
| 70 | +- 原有“一条逻辑 Call 对应一个 `RayModule`”的 Pipeline 无需修改。 |
| 71 | +- 同一个 `RayModule` 只调用一次时,执行行为与 v0.1.0 一致。 |
| 72 | +- `RunResult.actor_count` 继续提供物理 Actor 总数;共享 Pool 不会被多个逻辑 Call 重复计数。 |
| 73 | +- 完整测试集:**267 passed, 2 skipped**。 |
| 74 | +- shared actor 核心单元与 Executor 集成测试:**212 passed**。 |
| 75 | +- Flash-MinerU 完整 368 PDF 实验及端到端质量校验通过。 |
| 76 | + |
| 77 | +### 📦 安装 |
| 78 | + |
| 79 | +```bash |
| 80 | +pip install rayorch==0.1.1 |
| 81 | +``` |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## 🇬🇧 English |
| 86 | + |
| 87 | +### 🚀 RayOrch v0.1.1: reuse one Actor Pool across DAG stages |
| 88 | + |
| 89 | +RayOrch v0.1.1 is a backward-compatible update to the 0.1 programming model that adds **shared actor pools across DAG stages**. Pipelines that invoke the same resident model stack in consecutive stages can keep those stages as separate logical Calls while avoiding duplicate actors and duplicate model initialization. |
| 90 | + |
| 91 | +📄 **Paper:** [RayOrch: Programming and Executing Lineage-Controlled Multi-Grain Dataflows for Foundation-Model Data Preparation](https://arxiv.org/abs/2609.18703) |
| 92 | + |
| 93 | +### ✨ Highlights |
| 94 | + |
| 95 | +#### 1. One `RayModule` can serve multiple logical Calls |
| 96 | + |
| 97 | +Calling the same `RayModule` object more than once in `Pipeline.forward()` creates independent logical Calls with their own DAG dependencies, batching, and recovery state, backed by one physical Actor Pool: |
| 98 | + |
| 99 | +```python |
| 100 | +import rayorch as ro |
| 101 | + |
| 102 | + |
| 103 | +class ModelStack: |
| 104 | + def run(self, items, *, stage): |
| 105 | + if stage == "infer": |
| 106 | + return infer(items) |
| 107 | + return finish(items) |
| 108 | + |
| 109 | + |
| 110 | +class SharedModelPipeline(ro.Pipeline): |
| 111 | + def __init__(self): |
| 112 | + self.model = ro.RayModule(ModelStack).ray_options( |
| 113 | + replicas=4, |
| 114 | + batch_size=16, |
| 115 | + num_gpus=1, |
| 116 | + ) |
| 117 | + |
| 118 | + def forward(self, inputs): |
| 119 | + inferred = self.model(inputs, stage="infer") |
| 120 | + return self.model(inferred, stage="finish") |
| 121 | +``` |
| 122 | + |
| 123 | +`Infer` and `Finish` are separate logical Calls, but four actors initialize four model stacks rather than eight. Request state remains explicit in Ports and does not rely on the next task reaching the same replica. |
| 124 | + |
| 125 | +#### 2. Static keyword arguments on Calls |
| 126 | + |
| 127 | +A `RayModule` call may now combine dynamic Ports with ordinary static keyword arguments such as `stage="infer"`. Static values become part of the compiled Call contract and are passed to the UDF on every execution, without embedding control information in business records. |
| 128 | + |
| 129 | +#### 3. Logical Call and physical Pool responsibilities are separated |
| 130 | + |
| 131 | +Batching, recovery policy, and call metrics remain per logical Call. Replicas, Ray resources, and initialized UDF instances belong to the physical Pool. The scheduler rotates among ready Calls sharing a Pool while preserving input-batch isolation, recovery behavior, lineage, and ordering. |
| 132 | + |
| 133 | +### ⚡ Validation with Flash-MinerU |
| 134 | + |
| 135 | +Flash-MinerU's `v4-advanced-shared` pipeline uses this feature to separate MinerU 4 Advanced `Infer` and `Finish` into independently rebatchable stages while reusing the resident Layout, Two-Step VLM, MFR, and OCR stack on each GPU. |
| 136 | + |
| 137 | +On the same **368 PDFs, 7,072 pages, and 4× NVIDIA H20**: |
| 138 | + |
| 139 | +- Native MinerU: 1,942.44 seconds; |
| 140 | +- Flash-MinerU `v4-advanced-local`: 1,350.25 seconds; |
| 141 | +- Flash-MinerU `v4-advanced-shared`: 1,234.60 seconds; |
| 142 | +- execution speedup over Native: **1.57×**; |
| 143 | +- additional improvement over the unsplit local pipeline: **9.4%**; |
| 144 | +- 368/368 documents and 7,072/7,072 pages completed with no page-count or lineage mismatch; |
| 145 | +- mean token Jaccard: **0.9945**, mean token multiset F1: **0.9906**. |
| 146 | + |
| 147 | +These measurements belong to the stated workload and hardware and are not universal performance guarantees. Shared actor pools are most useful when several DAG stages need the same expensive resident state but still expose independent rebatching opportunities. |
| 148 | + |
| 149 | +### ✅ Compatibility and validation |
| 150 | + |
| 151 | +- Public usage of `Pipeline`, `RayModule`, `F.expand`, `F.reduce`, `Executor`, and `pipeline.run()` is unchanged. |
| 152 | +- Existing pipelines that use one `RayModule` per logical Call require no changes. |
| 153 | +- A `RayModule` invoked once retains the v0.1.0 execution behavior. |
| 154 | +- `RunResult.actor_count` continues to report the physical actor total without double-counting a Pool shared by several Calls. |
| 155 | +- Full test suite: **267 passed, 2 skipped**. |
| 156 | +- Shared-actor core unit and Executor integration suite: **212 passed**. |
| 157 | +- The complete Flash-MinerU 368-PDF run and end-to-end quality validation passed. |
| 158 | + |
| 159 | +### 📦 Installation |
| 160 | + |
| 161 | +```bash |
| 162 | +pip install rayorch==0.1.1 |
| 163 | +``` |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## 🔗 Links |
| 168 | + |
| 169 | +- [Paper](https://arxiv.org/abs/2609.18703) |
| 170 | +- [English documentation](https://opendcai.github.io/RayOrch-doc/en/) |
| 171 | +- [中文文档](https://opendcai.github.io/RayOrch-doc/zh/) |
| 172 | +- [Flash-MinerU](https://github.com/OpenDCAI/Flash-MinerU) |
| 173 | +- [Full Changelog](https://github.com/OpenDCAI/RayOrch/compare/v0.1.0...v0.1.1) |
0 commit comments