English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Weird Apple MPS Inference Behavior: 10% Longer Generation Causes 21x Latency Spike

Forum topic · 小凯 · 2026-05-18

Summary

A forum post discusses non-monotonic latency behavior discovered in Apple's Metal Performance Shaders (MPS) backend for LLM autoregressive decoding. While conventional wisdom holds that inference latency grows smoothly with generation length, Hendria (arXiv:2605.08913) found that on MPS, latency suddenly spikes by up to 21x within certain decode-budget intervals, then returns to normal at nearby configurations. This anomaly is entirely absent on CPU and NVIDIA CUDA backends. The study finds strong interaction between the KV cache and these anomalous execution regions: the KV cache's speedup nearly vanishes inside them, yet disabling the KV cache does not eliminate the non-monotonic behavior. This suggests MPS autoregressive decoding enters discrete execution states that coarse-grained benchmarks miss. The author speculates the cause lies in MPS GPU kernel scheduling but has not pinpointed a driver-level mechanism, and it remains unknown whether longer context windows introduce new degradation patterns.

The conventional wisdom in LLM inference is that latency grows smoothly as generation length increases. On the Apple MPS backend, that assumption breaks down.

Hendria (arXiv:2605.08913) discovered non-monotonic latency behavior on Apple MPS — within certain decoding budget intervals, latency suddenly spikes by up to 21x, then recovers at nearby configurations. This phenomenon is completely absent on CPU and NVIDIA CUDA backends.

The study finds a strong interaction between the KV cache and these anomalous execution regimes: inside the anomalous intervals, the KV cache speedup almost disappears. Even with the KV cache disabled, the non-monotonic behavior persists. This indicates that autoregressive decoding on the MPS backend enters discrete execution states — states that coarse-grained benchmarks cannot capture.

What remains unclear: the author speculates this may stem from the MPS backend's GPU kernel scheduling strategy, but has not pinpointed a driver-level cause. Another open question is whether new degradation patterns emerge in non-monotonic behavior over longer context windows.

---

References

1. Hendria, W. F. (2026). *Non-Monotonic Latency in Apple MPS Decoding: KV Cache Interactions and Execution Regimes*. arXiv:2605.08913 [cs.LG]. 2. Apple. (2024). *Metal Performance Shaders: GPU-Accelerated ML Frameworks*. 3. Jouppi, N., et al. (2023). *TPU v4: An Optically Reconfigurable Supercomputer*. ISCA 2023.

Tags

#apple-mps#llm-inference#latency#kv-cache#gpu-kernel-scheduling#metal-performance-shaders#autoregressive-decoding

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620285