Mace-cl-compiled-program.bin Updated Jun 2026
: On Android devices, it is often stored in temporary directories such as /data/local/tmp/mace_run/ or within the application's internal storage cache.
OpenCL kernel caches can range from a few megabytes to dozens of megabytes. The size depends on how complex the underlying AI models are and how many different GPU operations (like convolutions, pooling, and activations) the application needs to execute.
When an AI-powered app boots up for the first time, compiling these OpenCL kernels from source code into machine code can take several seconds. This causes noticeable lag or app initialization delays.
Once generated, the paths to these binaries are linked inside the application's engine initialization routines via the GPUContextBuilder :
.
The file mace-cl-compiled-program.bin is a pre-compiled binary file generated by the framework. MACE is an open-source, high-performance deep learning inference framework optimized for mobile heterogeneous computing platforms, originally developed by Xiaomi.
The binary within the file is tailored specifically for the SoC's GPU, ensuring the most efficient execution path.
: If your deployment pipeline allows, run an invisible, short "warm-up" inference loop during an app's initial installation or onboarding screens. This forces the creation of mace-cl-compiled-program.bin when the user is not actively demanding real-time responsiveness.
When the file is missing or cannot be found in the expected location, the framework will log a warning and proceed with the slower JIT compilation. You might see a message like: "There is no precompiled OpenCL binary in all OpenCL binary paths" . mace-cl-compiled-program.bin
The first time you launch an app utilizing MACE, it compiles the open-source OpenCL code specifically for your phone's exact GPU model (e.g., an ARM Mali or Qualcomm Adreno GPU). It then writes this compiled machine code into your local storage as mace-cl-compiled-program.bin .
The compilation process may have included device-specific optimizations: vectorized loads, local memory usage, work-group sizing, and instruction reordering. These can make the model run 2-5x faster than generic OpenCL source.
To solve this, MACE compiles the kernels during the very first run, or during app installation, and saves the resulting machine code into mace-cl-compiled-program.bin . On subsequent launches, the app skips the compilation phase entirely and loads the .bin file directly, resulting in instant startup times. What Common Apps Use This File?
While its cryptic name and binary format might initially look suspicious to an everyday user, this file is actually a critical component of modern mobile artificial intelligence (AI) and machine learning (ML) frameworks. : On Android devices, it is often stored
To eliminate this initialization lag, MACE utilizes compilation or caches the compiled kernels after the very first run.
: The application crashes immediately upon initialization or triggers fatal OpenCL runtime errors (such as CL_INVALID_BINARY ).
The framework compiles the kernels and outputs mace-cl-compiled-program.bin into a designated storage path.
, it needs to translate complex mathematical AI models into a language your phone's graphics chip understands. Because every phone has a slightly different GPU (Qualcomm Adreno, ARM Mali, etc.), the app "compiles" the model the first time you run it. It then saves that result as mace-cl-compiled-program.bin When an AI-powered app boots up for the
