Overview
The edge device deployment configuration is optimized for resource-constrained environments such as embedded systems, IoT devices, or low-power compute nodes. This mode prioritizes memory safety and resilience over maximum throughput.Memory and Compute Constraints
Default Constraints
Edge deployments operate under strict resource limits:- Memory limit: 256 MB maximum
- Compute units: 0.4 (40% of available compute capacity)
- Chunk size: 64 rows per chunk
- Batch size: 96 rows
- Parallel jobs: 1 (sequential processing)
Adaptive Resource Management
The pipeline automatically adjusts to available resources:- Adaptive chunk resizing: Enabled by default
- Maximum chunk retries: 3 attempts with exponential backoff
- Spill to disk: Enabled to prevent out-of-memory failures
- Memory monitoring: Per-chunk memory tracking with automatic downscaling
Configuration
Edge Configuration Template
Location:configs/pipeline.edge.template.json
Configuration Parameters
| Parameter | Value | Purpose |
|---|---|---|
chunk_size | 64 | Small chunks reduce memory pressure |
batch_size | 96 | Conservative batch size for model updates |
n_jobs | 1 | Sequential processing avoids contention |
max_memory_mb | 256 | Hard memory cap for safety |
max_compute_units | 0.4 | Leave headroom for system processes |
adaptive_chunk_resize | true | Automatic downscaling on memory pressure |
spill_to_disk | true | Persist intermediate results to storage |
Running on Edge Devices
Basic Deployment
Custom Memory Limit
Disable Disk Spill (Risk)
Performance Characteristics
Expected Behavior
- Latency: Higher per-row latency due to small chunks and retry logic
- Throughput: 50-200 rows/second depending on hardware
- Memory: Stays within 256 MB limit with adaptive resizing
- Energy: ~30J estimated per run on typical ARM devices
Failure Modes
Adaptive Chunk Resizing
When memory exceeds the limit, the pipeline automatically:- Detects memory pressure after processing each chunk
- Splits pending chunk in half (minimum 16 rows)
- Retries up to 3 times with exponential backoff (50ms, 100ms, 200ms)
- Processes smaller chunk with reduced memory footprint
engine.py:251-258:
Disk Spill Strategy
Whenspill_to_disk is enabled, intermediate results are persisted:
- X features:
intermediate/stream_chunk_{id}_X.csv - y targets:
intermediate/stream_chunk_{id}_y.csv
Disk spill adds 10-50% latency overhead on slow storage (e.g., SD cards) but provides resilience against OOM failures.
Deployment Checklist
Verify System Requirements
- Python 3.8+ installed
- Required dependencies from
requirements.txt - At least 256 MB available RAM
- Storage space for input data + artifacts (typically 50-100 MB)
Monitor First Run
Check for:
- Memory exceeded warnings in
reports/streaming_chunks.jsonl - Retry count in chunk metrics
- Spill file creation in
intermediate/directory
Tune Configuration
Adjust based on first run:
- Reduce
chunk_sizeif frequent retries occur - Reduce
max_memory_mbif system becomes unstable - Disable
spill_to_diskif storage is limited
Troubleshooting
High Memory Usage
Symptom: Memory exceeds limit frequently Solutions:- Reduce
chunk_sizeto 32 or 16 - Lower
max_memory_mbto trigger adaptive resizing earlier - Enable
spill_to_diskif disabled
Slow Processing
Symptom: Throughput below 50 rows/second Solutions:- Check storage I/O (disable
spill_to_diskif possible) - Increase
chunk_sizeslightly if memory allows - Verify no background processes consuming CPU
Model Quality Degradation
Symptom: R² score significantly lower than server deployment Solutions:- Increase
max_compute_unitsto 0.5 or 0.6 - Increase
benchmark_runsfor more stable estimates - Review chunk metrics for excessive retries
Best Practices
Always enable adaptive resizing
Always enable adaptive resizing
Keep
adaptive_chunk_resize: true to prevent out-of-memory failures. Only disable if you have strict latency requirements and have validated memory safety.Use disk spill on production devices
Use disk spill on production devices
Enable
spill_to_disk: true for production deployments to ensure resilience. The latency overhead is acceptable compared to pipeline failures.Run validation tests first
Run validation tests first
Before deploying to edge devices, run unit tests:
Monitor energy consumption
Monitor energy consumption
On ARM devices without RAPL, the pipeline uses a fallback estimate (~30J). For precise measurements, use external power meters.
Related Documentation
- Server Deployment - High-throughput configuration
- Output Artifacts - Understanding pipeline outputs
- Hardware Profiling - Detailed telemetry analysis