Billion-Row Batch Inference for Scientific Models
Built and ran a distributed TensorFlow prediction pipeline at Montai that scores 10B+ candidate rows end to end in under three hours.
- Rows
- 10B+
- End to end
- Under 3 hours
Confidentiality note. Internal service names, proprietary scientific details, and employer-specific implementations are kept general here. Every scale figure, responsibility, technology, and outcome below comes from already-published facts in Sudhanva’s résumé and public profile.
Problem
Scoring scientific models across more than ten billion candidate rows was too large for single-node scripts or interactive notebooks. Scientists needed a daily batch job with reproducible outputs and materialized tables they could query directly.
Scale and constraints
Scale
- 10B+ input rows scored per production run.
- End-to-end execution completed in under three hours.
- Multi-model TensorFlow scoring across shared GPU capacity.
Constraints
- Keep data ingestion, preprocessing, and GPU execution balanced so GPUs do not sit idle waiting on I/O.
- Produce identical outputs across runs for the same model and input snapshot.
- Run within the cost and capacity limits of a shared Kubernetes cluster.
Sudhanva’s ownership
Sudhanva designed the batch prediction pipeline and owned the production ML infrastructure it ran on.
- Architecture and implementation of the distributed batch prediction workflow.
- Throughput tuning across TensorFlow model execution and the upstream input pipeline.
- Production scheduling and monitoring on Kubernetes, Ray, and Flyte.
Architecture at a safe level
Internal service names and proprietary scientific details are omitted below, while the data flow, orchestration, and operational setup reflect the production system.
- Profiled data ingestion, preprocessing, GPU inference, and output writes together so storage I/O kept pace with GPU throughput.
- Ran distributed preprocessing and multi-GPU inference across Ray and Flyte on Kubernetes with pinned container and model versions.
- Added Prometheus metrics and Grafana dashboards for stage throughput, queue depth, and GPU utilization.
Engineering decisions and tradeoffs
- Kept deterministic execution settings enabled so higher batch throughput never changed numerical outputs.
- Capped per-run GPU concurrency so the job finished in under three hours without starving other workloads on the cluster.
Results
- Processed more than ten billion rows in under three hours.
- Cut drug-candidate screening turnaround from weeks to hours.
Reliability and operations
- Prometheus alerts and Grafana dashboards tracked run progress, stage latency, and task failures.
- Versioned Flyte workflows replaced manual notebook runs.
Transferable lessons
- At ten billion rows, storage I/O and serialization bottleneck the run long before GPU compute does.
- For downstream scientists, the metric that matters is wall-clock time from job start to a queryable output table.
Technologies
- TensorFlow
- Kubernetes
- Ray
- Flyte
- Python
- Prometheus
- Grafana
Explore more
From the blog