Sub topic 12
Battery Drain and Thermal Throttling
Assume you know how to run a converted vision model with an inference runtime and how to measure single-inference latency. This chapter focuses on sustained workloads, where power use heats the device and changes performance.
Why inference drains the battery
Every inference uses energy. The amount depends on more than the model's parameter count:
- Input resolution and batch size determine how much computation each inference performs.
- The number and type of operators affect CPU, GPU, or NPU activity.
- Memory transfers can consume substantial energy, especially when tensors move between processors.
- Camera capture, image conversion, and display rendering also use power.
- Repeated inference keeps hardware active instead of allowing it to enter a low-power state.
A model that finishes one frame quickly may still drain the battery if it runs continuously at 30 frames per second. Measure energy over a representative session, not only the first inference.
| Workload | Useful metric | Typical concern |
|---|---|---|
| Single photo classification | Time per inference | User-perceived delay |
| Live camera preview | Frames per second and energy per frame | Sustained heat |
| Background analysis | Energy per hour | Battery life |
| Bursty detection | Time to complete a batch | Short power spikes |
What thermal throttling does
Thermal throttling is the device reducing clock speed, voltage, or available processor resources to control temperature. It protects the hardware and the user's skin, but it increases inference latency. A pipeline may run at 20 milliseconds per frame after launch and reach 45 milliseconds several minutes later.
Throttling can affect different processors independently. A GPU delegate may slow down while the CPU remains available. A runtime can also fall back to the CPU for unsupported operators, increasing both latency and heat.
A repeatable thermal test
Use a fixed input sequence, device state, and workload. Keep the screen brightness, network state, and camera settings consistent. Record:
- Median and 95th-percentile latency.
- Completed frames per second.
- Temperature or thermal status, when the platform exposes it.
- Battery level before and after the test.
- Runtime and delegate configuration.
On an Android device connected through ADB, these commands provide useful system observations:
adb shell dumpsys battery
adb shell dumpsys thermalservice
adb shell dumpsys meminfoRun the same model repeatedly while collecting these values at regular intervals. Do not treat battery percentage as a precise energy measurement. The percentage is rounded and may be affected by charging, background activity, and battery estimation. For controlled comparisons, use an external power monitor or a platform power-profiler tool when available.
Reducing heat without losing the product goal
Start with the required user experience. A live preview may not need inference on every camera frame. Process every second or third frame, track objects between detections, or reduce the input resolution when the device is hot.
Other options include:
- Choose a smaller architecture that meets the accuracy target.
- Use integer quantization if accuracy remains acceptable.
- Prefer an NPU or GPU delegate when it reduces CPU work and energy.
- Avoid unnecessary tensor copies between processors.
- Stop inference when the app is backgrounded or the result is not visible.
- Lower the camera frame rate or inference frequency during thermal warnings.
- Batch work only when latency permits it. Batching can improve throughput but increase memory use and heat.
The best design is often adaptive. It starts at the target frame rate, observes thermal status, and reduces inference work before severe throttling begins.
Diagnose the shape of the problem
If latency is high from the first run, inspect model size, preprocessing, and delegate support. If latency starts low and rises gradually, suspect heat or competing background work. If only some devices slow down, compare their hardware delegate, operating-system version, and thermal policy.
Always compare accuracy after changing resolution, frame rate, or quantization. A cooler model that misses important objects does not satisfy the product requirement.
Exercise
A detector runs at 25 milliseconds per frame initially and 60 milliseconds after five minutes. What should you test first?
Show answer
Repeat the test with a fixed workload while recording thermal status and delegate use. If temperature rises as latency rises, test adaptive frame skipping, a smaller input, or a more efficient delegate.