The Apple Silicon Neural Engine
Modern Macs powered by Apple Silicon (M1, M2, M3) possess a dedicated hardware component known as the Neural Engine, designed specifically to accelerate Machine Learning (ML) tasks. When you use features like Live Text (copying text from a photo), voice dictation, or when a developer runs a complex AI model in Xcode, the heavy lifting is handled by the CoreML framework.
To maximize performance, CoreML takes the abstract mathematical models (often imported from PyTorch or TensorFlow) and compiles them into highly optimized hardware shaders specifically tuned for your exact Mac’s GPU and Neural Engine. It caches these compiled shaders on the SSD so the AI model loads instantly the next time you use it.
However, if a CoreML model is interrupted during compilation, or if a macOS system update changes the underlying GPU architecture, the Shader Cache becomes corrupted. The symptoms are severe: AI-dependent applications (like Pixelmator Pro or Final Cut Pro’s auto-crop) will instantly crash upon launch, Live Text will completely stop working, or the coremlc compiler process will max out the CPU. To restore AI functionality, you must purge the CoreML Shader Cache via the Terminal.
Locating the CoreML Caches
Because these shaders are highly specific to the applications requesting them, they are stored deep within the user’s local Library, specifically within the Darwin temporary folders (/var/folders/) and the explicit CoreML cache directories.
Purging the Cache via Terminal
You must use the Terminal with elevated (sudo) privileges to safely obliterate these compiled binary blobs.
- Close all heavy graphical or AI-dependent applications (e.g., Xcode, Final Cut Pro, Pixelmator).
- Open the Terminal application.
- First, delete the explicit CoreML model cache located in your user profile:
sudo rm -rf ~/Library/Caches/com.apple.coreml/*
Press Enter, type your Mac’s administrator password, and press Enter again.
- Next, you must purge the global Metal/CoreML shader cache. macOS stores these compiled binaries in the highly randomized
/var/folders/directory under thecom.apple.metalandcoremlnamespaces. Execute the following wildcard purge:
sudo rm -rf /var/folders/*/*/*/com.apple.metal/*
sudo rm -rf /var/folders/*/*/*/com.apple.coreml*
Resetting the Neural Engine Daemon
Deleting the physical files clears the SSD, but the Apple Silicon Neural Engine is still being managed by a background daemon that might be stuck attempting to execute the corrupted code.
You must forcefully restart the CoreML compiler daemon:
sudo killall coremlc
sudo killall coremlcompiler
The Recompilation Phase
macOS handles the recovery automatically. The next time you open an application that relies on Machine Learning (like highlighting text in a photograph using Preview), the CoreML framework will search for the cached shaders and realize they are missing.
It will instantly re-engage the coremlc process to recompile the models from scratch. You might notice the application takes an extra 2 to 3 seconds to load the very first time you use it, as the GPU is actively rebuilding the cache. Once compiled, the new, uncorrupted shaders are saved to the disk, and all AI features will resume operating at maximum hardware-accelerated speeds.