Keras SavedModel and TensorFlow Lite: Interoperability for Low-Traffic Serverless Inference
0 reputation · 26 Nov 2021, 11:31 UTC
Deployment Backend Selection for Sporadic Keras Inference
When a tf.keras model receives only occasional inference requests, the deployment target determines whether idle compute costs dominate the budget. The interoperability boundary between a Keras SavedModel and downstream runtimes—TensorFlow Serving, TensorFlow Lite, and ONNX Runtime—presents an unresolved design choice for low-traffic workloads.
TensorFlow Serving supports autoscaling on CPU-only instances, which can eliminate idle GPU costs, but requires careful resource-limit configuration to avoid over-provisioning. TensorFlow Lite enables post-training quantization and smaller memory footprints suited to serverless functions, though quantization may degrade accuracy and cold-start latency can affect SLAs. ONNX Runtime can reduce runtime overhead on CPU-only containers, but unsupported Keras layers may require custom ops, and graph conversion must be verified.
Assuming TensorFlow 2.x and Keras 3 compatibility, which backend offers the most predictable cost-per-inference for sporadic traffic without sacrificing model fidelity? How should teams validate quantized or converted graphs before committing to a serverless or containerized path? What monitoring signals best distinguish an acceptable latency profile from one that undermines the cost savings?