Your AI agent works great. Then the phone gets warm. Then it doesn’t.
Описание и применение
На устройствах Android постоянный запуск модели вызывает перегрев, что приводит к снижению производительности. Предварительное измерение теплового headroom и адаптивное снижение нагрузки позволяют избежать резкого падения скорости работы агента.
Задача
On-device AI agents can become slow after a few minutes of continuous inference due to thermal throttling, which is not evident during testing.
Результат
Proactive throttling based on real‑time thermal headroom prevents sudden latency spikes and maintains a smoother user experience on devices prone to thermal throttling.
Рабочий процесс
- 1. Call PowerManager.getThermalHeadroom(1) to obtain a 1‑second forecast of available thermal headroom.
- 2. If headroom < 0.3 f, decide on an action: < 0.2 f → switch to a lighter model; < 0.3 f → reduce inference frequency; < 0.5 f → skip non‑critical inference.
- 3. Implement the chosen action in the inference loop.
- 4. Continuously monitor headroom during sustained inference.
- 5. Test on a 3‑4 year‑old mid‑range device for 10 min to observe latency trends.
- 6. Use Firebase Test Lab to identify affected devices in the target market.
Доказательства
Android’s thermal system throttles CPU and GPU frequency when the device temperature rises.
PowerManager.getThermalHeadroom() gives you a 1-second forecast of available thermal headroom, from 0.0 (throttling now) to 1.0 (full capacity).
When headroom drops below your threshold: ... switchToLighterModel(), reduceInferenceFrequency(), skipNonCriticalInference()
Run sustained inference on a 3-4 year old mid-range device for 10 minutes. Watch the latency numbers. If they climb, you have a thermal problem.
- Дата записи: 2026-10-12T04:41:15.109Z