[2308.12871] IPA: Inference Pipeline Adaptation to Achieve High Accuracy and Cost-Efficiency