- π Queue-based Streaming Architecture: Efficient data flow between pipeline stages with non-blocking I/O
- π» Heterogeneous Computing Support: Hybrid CPU/GPU execution with fine-grained resource allocation
- π AIMD Dynamic Batch Sizing: Adaptive batch size tuning using Additive Increase Multiplicative Decrease algorithm
- π Recipe-driven Configuration: Declarative YAML/JSON pipeline definitions for easy customization
- π§ Extensible Operator System: Simple base class for creating custom operators
- βοΈ Load-balanced Scheduling: Intelligent worker selection for optimal throughput
- π‘οΈ Fault Tolerance: Two-layer checkpointing with automatic recovery and health monitoring
- π― Bayesian Hyperparameter Optimization: Optional multi-fidelity tuning for performance optimization
# Clone the repository
git clone https://github.com/yourusername/DataTurbo.git
cd DataTurbo
# Install in development mode (recommended for trying examples)
pip install -e .
# Or install from PyPI (coming soon)
# pip install dataturboRequirements:
- Python 3.8+
- Ray 2.0+
- 8GB+ RAM recommended
- CUDA-compatible GPU (optional, for GPU operators)
We provide a GitHub Action workflow for reproducible experiments. It runs the math pipeline demo on each push to main or on manual trigger (workflow_dispatch), so reviewers can verify the pipeline without a local setup.
- Workflow:
.github/workflows/reproduce.ymlβ installs dependencies and runs the demo. - Demo script:
scripts/reproduce.shβ invokes the math pipeline with demo data (e.g.--input ./demo_data,--output ./output/math_alpha_test,--max-size 30,--enable-ft).
You can edit scripts/reproduce.sh to change the launch configuration (recipe, input path, output dir, --max-size, --enable-ft, etc.).
Note: The demo uses a shared API with rate limits. For runs with more than ~30 items, replace the API key and base URL in your recipe (e.g. examples/math_pipeline/recipe.yaml) with your own endpoint to avoid throttling.
The easiest way to get started is to run one of our example pipelines:
# 1. Install DataTurbo and requirements.txt
cd DataTurbo
pip install -e .
pip install -r requirements.txt
# 2. Navigate to math pipeline example
cd examples/math_pipeline
# 3. Run the pipeline with your data
./run.sh \
--recipe recipe.yaml \
--input /path/to/your/data/ \
--output output/math_processed \
--max-size 300 \
# --enable-ftWhat this does:
- β Loads your math problem dataset
- β Runs quality assessment, domain classification, and difficulty analysis
- β
Outputs processed results to
output/processed/final_output.json - β
Generates performance metrics in
output/processed/metrics.json
Available Examples:
# Math dataset processing
cd examples/math_pipeline && ./run.sh --input data.json --output output/
# Code dataset processing
cd examples/code_pipeline && ./run.sh --input code.json --output output/
# Multimodal (image-text) processing
cd examples/multimodal_pipeline && ./run.sh --input images.json --output output/DataTurbo provides two ways to build and run data processing pipelines:
Use declarative YAML/JSON files to define your pipeline. This approach separates configuration from code and makes it easy to modify pipelines without changing code.
cd examples/math_pipeline
./run.sh \
--recipe recipe.yaml \
--input /path/to/your/data/ \
--output output/math_processed \
--max-size 1000 \
--enable-ftScript Parameters:
| Parameter | Required | Default | Description |
|---|---|---|---|
--recipe |
No | recipe.yaml |
Recipe configuration file |
--input |
Yes | - | Input data path (file or directory) |
--output |
Yes | - | Output directory |
--max-size |
No | All data | Maximum number of items to process |
--enable-ft |
No | Disabled | Enable fault tolerance (checkpointing & recovery) |
Customization:
Each example includes a recipe.yaml file you can modify to customize the pipeline:
- Change batch sizes and worker counts
- Add/remove processing operators
- Adjust model parameters and API settings
- Configure CPU/GPU resource allocation
from dataturbo import RecipeParser, OperatorRegistry, QueueBasedPipeline
# Create operator registry
registry = OperatorRegistry()
# Register your operators here...
# Load recipe
parser = RecipeParser(registry)
config, stage_configs = parser.create_pipeline_from_recipe(
recipe_path="pipeline.yaml",
input_path="data/input.json",
output_dir="output/"
)
# Run pipeline
pipeline = QueueBasedPipeline(config, stage_configs)
metrics = pipeline.run("data/input.json", "output/")
print(f"Processed {metrics['input_count']} items in {metrics['total_time']:.2f}s")When to use Recipe-driven:
- β Quick prototyping and experimentation
- β Production deployments with standardized configs
- β When non-developers need to adjust pipeline settings
- β When you want configuration version control separate from code
Define your pipeline entirely in Python code for maximum flexibility and programmatic control.
import ray
import sys
from pathlib import Path
# Add examples to path to import custom operators
sys.path.insert(0, str(Path(__file__).parent / 'examples' / 'math_pipeline'))
from dataturbo import QueueBasedPipeline, PipelineConfig, ModelConfig
from math_pipeline.operators import QualityAssessmentActor, DomainClassificationActor
from math_pipeline.config import QualityAssessmentConfig, DomainClassificationConfig
# Initialize Ray
ray.init()
# Create configuration
model_config = ModelConfig(
name="Qwen2.5-0.5B-Instruct",
api_key="your-api-key",
base_url="http://localhost:8000/v1"
)
config = PipelineConfig(
input_path="data/input.json",
output_dir="output/",
model=model_config,
pipeline_batch_size=50,
workers_per_stage=2
)
# Create operator configurations
quality_config = QualityAssessmentConfig(batch_size=50, workers_per_stage=2)
domain_config = DomainClassificationConfig(batch_size=50, workers_per_stage=2)
# Define stage configurations
stage_configs = {
'quality': (QualityAssessmentActor, quality_config, model_config),
'domain': (DomainClassificationActor, domain_config, model_config),
}
# Create and run pipeline
pipeline = QueueBasedPipeline(config, stage_configs)
metrics = pipeline.run("data/input.json", "output/")
print(f"Processed {metrics['input_count']} items in {metrics['total_time']:.2f}s")
print(f"Throughput: {metrics['throughput']:.2f} items/s")When to use Python API:
- β Embedding DataTurbo into larger Python applications
- β Dynamic pipeline construction based on runtime conditions
- β Fine-grained control over every aspect of the pipeline
- β Programmatic processing of pipeline results
Note: DataTurbo provides the framework and BaseOperator base class. All operator implementations are in examples/ as references. Copy and modify them for your needs.
DataTurbo/
βββ .github/workflows/ # GitHub Actions (reproducibility)
β βββ reproduce.yml
βββ assets/ # Images for README/docs
βββ dataturbo/ # Core framework package
β βββ core/ # Pipeline engine (QueueBasedPipeline + StageCoordinator)
β β βββ pipeline.py
β β βββ coordinator.py
β β βββ base_operator.py
β βββ recipe/ # Recipe parser + operator registry
β βββ config/ # Pipeline/Model configs
β βββ fault_tolerance/ # Optional checkpointing + monitoring
β βββ operators/ # Optional place for user-defined operators (empty by default)
β βββ utils/ # Utilities
βββ examples/ # Example pipelines (operators live here)
β βββ math_pipeline/
β β βββ operators.py
β β βββ config.py
β β βββ recipe.yaml
β β βββ run_from_recipe.py
β β βββ run.sh
β β βββ demo_data/
β βββ code_pipeline/
β β βββ ...
β βββ multimodal_pipeline/
β βββ ...
βββ scripts/
β βββ reproduce.sh # Local reproducibility entrypoint (used by GitHub Action)
βββ docs/ # Documentation
βββ optimization/ # Bayesian optimization module
βββ LICENSE
βββ README.md
βββ requirements.txt
βββ setup.py
βββ pyproject.toml
Extend BaseOperator to create custom operators:
import ray
from dataturbo.core.base_operator import BaseOperator
@ray.remote
class MyCustomOperator(BaseOperator):
def __init__(self, config, model_config=None, gpu_id=None):
super().__init__(config, model_config, gpu_id)
# Initialize your operator
def process_chunk(self, chunk):
# Process data and return results
results = {}
for item in chunk:
# Your processing logic
results[item['id']] = processed_value
return {'results': results}name: "My Pipeline"
version: "1.0"
global:
model_name: "your-model"
api_key: "your-api-key"
base_url: "http://localhost:8000/v1"
pipeline_batch_size: 100
operators:
- name: deduplication
type: deduplication
params:
similarity_threshold: 0.85
workers_per_stage: 2
- name: quality_check
type: quality_assessment
params:
batch_size: 50
device: gpu
num_gpus: 0.5Use the optimization module for automatic hyperparameter tuning:
from optimization import MultiFidelityTuner, FidelityLevel
tuner = MultiFidelityTuner(
objective_fn=my_objective,
param_space={
'batch_size': (50, 200, 10),
'workers': [2, 3, 4, 5]
},
fidelity_levels=[
FidelityLevel("quick", 100, 30),
FidelityLevel("final", 1000, 15)
]
)
result = tuner.optimize()Apache License 2.0
Contributions are welcome! Please read our contributing guidelines before submitting PRs.

