Model optimization improves inference efficiency by matching operations to suitable hardware and simplifying the execution graph. A GPU may handle matrix multiplication while a CPU handles control flow or sparse data. section 15.3.1
Practical optimization choices include:
- Choose an inference framework according to the target device and serving constraints. section 15.3.1
- Apply separate preparation optimizers to remove training-only graph components and fuse operations. section 15.3.1
- Treat large-language-model inference separately when memory footprint and autoregressive generation limit parallelization. section 15.3.1
Mixed-device execution
CoreML can dynamically split an execution graph across the CPU, GPU, and Apple Neural Engine to maximize efficiency rather than assigning every operation to one device. section 15.3.1
Figure 15.3 A wide spectrum of tools with their focus on either research or production serving goals
Use the spectrum to compare tools oriented toward research workflows with those designed for production serving. section 15.3.1

