Scaling Model Evaluation at Pi... Note

Scaling Model Evaluation at Pinterest with Ray (Part 4)

This article discusses the application of Ray to a model evaluation platform, aiming to improve efficiency and scalability. Previously, inference and evaluation were separate processes, leading to overhead from cluster startup and data movement between S3 and Spark jobs. The authors propose a fused approach where metrics are computed within the Ray inference job itself. This requires metrics to be decomposable, allowing for partial calculations on individual data batches.They define a common metric contract with methods for dataset preprocessing, computing partials from batches, and reducing these partials to a final result. Decomposable metrics like Mean Absolute Error (MAE) can be calculated directly from batch sums and counts. Holistic metrics like ROC-AUC, which typically require global sorting, are approximated using batch-wise confusion matrices and then integrated. Group-wise metrics, such as Precision@K, require careful data organization into buckets to ensure segments are not split across batches while maximizing computational efficiency. By allowing metrics to be computed batch-wise, they can amortize the compute cost with inference, reducing end-to-end evaluation time and enabling linear scaling.
CdXz5zHNQW_LpEhm7WQ6n.png