You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit af57e9d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,9 +268,9 @@ See [Framework Design](https://opendcai.github.io/RayOrch-doc/en/architecture/)
268
268
269
269
## 🧩 4. Workloads and Integrations
270
270
271
-
### 4.1 MinerU 2.5 and Flash-MinerU
271
+
### 4.1 MinerU and Flash-MinerU
272
272
273
-
The MinerU integration connects the MinerU 2.5 implementation from [Flash-MinerU](https://github.com/OpenDCAI/Flash-MinerU) as an explicit page-level RayOrch workload. A PDF first expands into a variable number of page records, page images are processed by a persistent GPU actor pool, and the page-level model outputs are reduced in the original order before Markdown, layout JSON, and extracted images are written. The workload is irregular because PDFs have different page counts, rendering and assembly are CPU-oriented while inference is GPU-oriented, and ready pages from different PDFs should share model batches without losing their document ownership.
273
+
The following MinerU 2.5 integration connects the implementation from [Flash-MinerU](https://github.com/OpenDCAI/Flash-MinerU) as an explicit page-level RayOrch workload. A PDF first expands into a variable number of page records, page images are processed by a persistent GPU actor pool, and the page-level model outputs are reduced in the original order before Markdown, layout JSON, and extracted images are written. The workload is irregular because PDFs have different page counts, rendering and assembly are CPU-oriented while inference is GPU-oriented, and ready pages from different PDFs should share model batches without losing their document ownership.
274
274
275
275
```mermaid
276
276
flowchart LR
@@ -310,7 +310,6 @@ The important intermediate values are deliberately ordinary Python values; RayOr
310
310
The core RayOrch topology is small because model code remains inside the UDFs and dataflow relationships remain inside `forward()`:
311
311
312
312
```python
313
-
from typing import cast
314
313
import rayorch as ro
315
314
316
315
from rayorch.benchmarks.mineru.udfs import (
@@ -355,10 +354,10 @@ class MinerUPipeline(ro.Pipeline):
@@ -371,28 +370,28 @@ class MinerUPipeline(ro.Pipeline):
371
370
372
371
`F.expand` makes every rendered page independently schedulable, so one OCR microbatch may contain pages from several PDFs. `F.reduce_aligned` uses the OCR output as the member set and returns both model outputs and matching page metadata to the PDF Domain in original page order, while the separate metadata branch provides the PDF stem without forwarding PDF bytes through the GPU stage. The model is constructed once per OCR actor and remains loaded across batches and repeated executor runs. Each completed PDF is written under `output_dir/<pdf-stem>/vlm/`, including `<pdf-stem>.md`, `layout.json`, and extracted images.
373
372
374
-
Most users do not need to assemble MinerU UDFs themselves. The separately packaged Flash-MinerU integration preserves its small application-facing API and uses the installed RayOrch runtime:
373
+
Most users do not need to assemble MinerU UDFs themselves. Flash-MinerU 1.1.0 packages the same pattern behind a small API and the installed RayOrch runtime, with nine versioned pipelines covering MinerU 2.5, 2.5 Pro, and MinerU 4. The versioned layout isolates upstream runtime changes, while `v4-advanced-shared` also demonstrates separate DAG stages reusing one resident model Actor Pool.
375
374
376
375
```bash
377
-
pip install "flash-mineru[vllm]"
376
+
pip install "flash-mineru[mineru25]==1.1.0"
378
377
```
379
378
380
379
```python
381
380
from flash_mineru import MineruEngine
382
381
383
-
engine = MineruEngine(
384
-
model="/path/to/MinerU2.5", # Local path visible to every Ray node.
385
-
save_dir="./outputs", # Markdown, layout JSON, and extracted images.
386
-
batch_size=8, # Maximum pages in one model call.
387
-
replicas=2, # Two persistent MinerU actors.
388
-
num_gpus_per_replica=1, # One GPU reserved by each actor.
389
-
)
390
-
# The public Flash-MinerU API stays unchanged; RayOrch is internal.
391
-
result = engine.run(["document-a.pdf", "document-b.pdf"])
392
-
engine.close()
382
+
with MineruEngine(
383
+
pipeline_version="v2.5", # Select one bundled, versioned pipeline.
384
+
model="/path/to/MinerU2.5", # Local path visible to every Ray node.
385
+
save_dir="./outputs", # Markdown, layout JSON, and extracted images.
386
+
batch_size=8, # Compatibility grouping for returned paths.
387
+
ocr_batch_size=128, # Ready pages collected into a model call.
388
+
replicas=2, # Two persistent MinerU actors.
389
+
num_gpus_per_replica=1, # One GPU reserved by each actor.
390
+
) as engine:
391
+
result =engine.run(["document-a.pdf", "document-b.pdf"])
393
392
```
394
393
395
-
For reproducible experiments and standard profiling artifacts, see the [MinerU Benchmark guide](https://opendcai.github.io/RayOrch-doc/en/benchmarks/mineru.html).
394
+
Choose another `pipeline_version` and its matching installation extra to run the other supported MinerU generations; MinerU 2.5 and MinerU 4 should remain in separate environments. See the [Flash-MinerU pipeline guide](https://github.com/OpenDCAI/Flash-MinerU/blob/main/docs/PIPELINES.md) for runnable configurations, or the [RayOrch MinerU Benchmark guide](https://opendcai.github.io/RayOrch-doc/en/benchmarks/mineru.html) for reproducible experiments and profiling artifacts.
0 commit comments