Model export converts a trained model into a representation another inference framework or deployment environment can run. It separates research flexibility from production requirements: a model may be trained in PyTorch, then exported for iOS, backend, server, or mobile inference. section 15.3.1 section 15.6
Treat export as a deployment and verification step:
- Choose an intermediate or target format according to latency, throughput, scalability, cost, reliability, flexibility, security, privacy, and platform constraints. section 15.3.1 section 15.6
- Use ONNX as a common interframework language when training and inference environments differ; ONNX also supplies runtime and conversion tools. section 15.3.1
- Test sensitive conversion paths by comparing predictions from the converted model with predictions from the original model. section 10.5
- Accept that a general format can balance flexibility and performance without matching a custom solution for one model, hardware target, and usage pattern. section 15.3.1
One model, multiple targets
A model trained with PyTorch can be converted for iOS inference with CoreML and backend inference with ONNX. The conversion test checks that both converted models preserve the original results. section 10.5
Figure 15.3 A wide spectrum of tools with their focus on either research or production serving goals
Use the tool spectrum to compare research-oriented frameworks with production-serving engines and deployment formats. section 15.3.1
