Mace-cl-compiled-program.bin ✓ [ FULL ]
mace-cl-compiled-program.bin is a compiled binary containing OpenCL kernels specifically compiled for the Movidius Myriad X VPU (or similar MACE-compatible hardware). This file is generated by the MACE compiler toolchain and is used for deploying neural network inference or custom OpenCL compute tasks on edge devices (e.g., Intel Neural Compute Stick 2).
| Offset (hex) | Size (bytes) | Typical Content |
|--------------|--------------|------------------|
| 0x00 | 4 | Magic number (e.g., 0x4D414345 = "MACE") |
| 0x04 | 4 | Version (e.g., 0x00010002) |
| 0x08 | 8 | Total binary size |
| 0x10 | 64 | SHA-256 hash of payload |
| 0x50 | 256 | Signature (RSA or ECDSA) |
| 0x150 | variable | Compressed/encrypted OpenCL kernel binary |
Note: Actual structure varies by SoC (SM8250, SM8450, etc.) and Android release. Some versions use ELF headers disguised with a
.binextension.
You can also manually compile OpenCL kernels with:
mace_cl_compiler --input kernel.cl --output mace-cl-compiled-program.bin --target myriad
This guide should give you full control over generating, deploying, and debugging mace-cl-compiled-program.bin for Movidius-based edge AI applications.
mace-cl-compiled-program.bin is a specialized binary file used by the Mobile AI Compute Engine (MACE) framework—an open-source deep learning inference engine developed by Xiaomi for mobile heterogeneous computing.
This file acts as a pre-compiled OpenCL kernel cache, specifically designed to accelerate the initialization and execution of AI models on mobile GPUs. 1. Purpose and Functionality
When a deep learning model (like MobileNet or Inception) runs on a mobile device's GPU via OpenCL, the framework must compile "kernels"—small programs that execute mathematical operations on the GPU hardware. mace-cl-compiled-program.bin
Speeding Up Initialization: Compiling these kernels from source code at runtime is computationally expensive and slow. The mace-cl-compiled-program.bin file stores the already-compiled binary version of these kernels.
Reduced Latency: By loading this binary directly, MACE bypasses the compilation phase, significantly reducing the "warm-up" time or first-inference latency for AI-powered features like camera scene detection or face recognition.
SoC Specificity: These binaries are often tuned for specific System-on-Chip (SoC) architectures (e.g., Qualcomm Snapdragon's Adreno GPUs) to extract maximum performance, sometimes yielding a 1–10% improvement over generic kernels. 2. File Location and Generation
The file is typically found within a mobile application's internal data directory or a temporary storage path designated by the MACE engine. How to build - MACE documentation - Read the Docs
// Include the headers #include "mace/public/mace.h" #include "mace/public/mace_runtime.h" // If the build_type is code #include " Read the Docs How to build — MiAI Compute Engine documentation
The file mace_cl_compiled_program.bin is a binary cache file generated by the Mobile AI Compute Engine (MACE) framework. It contains pre-compiled OpenCL kernels specifically optimized for a device's GPU. Purpose and Functionality
In mobile AI inference, compiling OpenCL kernels at runtime (JIT compilation) can be a slow process, sometimes taking several seconds. This file solves that by storing the compiled binary so it can be reused in future sessions:
Initialization Speed: By loading this pre-compiled binary, the MACE Engine skips the compilation step, drastically reducing the startup time for machine learning models on mobile devices. mace-cl-compiled-program
Performance Tuning: MACE can automatically tune GPU parameters for specific System-on-Chips (SoCs). These tuned parameters and kernels are then stored in this .bin file to ensure the best possible performance. Key Characteristics
Device Dependency: The content of this file is strictly tied to the OpenCL version and the specific GPU architecture of the device that generated it. A binary generated on one phone (e.g., a Qualcomm Snapdragon device) will typically not be compatible with a different SoC.
Generation: It is typically created during the first run of a MACE-powered application or during an offline "tuning" process where the model is benchmarked on the target hardware.
Typical Path: On Android devices, applications using MACE often look for or save this file in the app's internal data directory or public storage (e.g., /storage/emulated/0/mace_cl_compiled_program.bin). Common Issues How to build - MACE documentation - Read the Docs
The file "mace-cl-compiled-program.bin" is a binary file generated by Xiaomi's MACE (Mobile AI Compute Engine), a deep learning inference framework optimized for mobile devices. This specific file contains compiled OpenCL kernels, which are small programs that allow AI models to run efficiently on a device's GPU.
Generating this "piece" or file is typically done during the deployment phase to avoid slow runtime compilation. How to Generate "mace-cl-compiled-program.bin"
To create this file, you must use the MACE converter tool to process your model for a specific target device.
Configure a Deployment YAML: Create a .yml file that defines your model and specifies the gpu as a runtime. Note: Actual structure varies by SoC (SM8250, SM8450, etc
Specify Target SOCs: Ensure your configuration includes the target_socs (System-on-Chip) relevant to the device you are targeting.
Run the MACE Converter: Execute the converter.py tool. When the gpu runtime and target SOCs are correctly specified, MACE automatically compiles the OpenCL kernels for that hardware.
Extract the Binary: The compilation process produces the binary file (often named $library_name_compiled_opencl_kernel.$device_name.$soc.bin), which you can then rename or use as the required mace-cl-compiled-program.bin in your project. Key Considerations
Hardware Dependency: These binaries are device-specific. A file compiled for a Snapdragon 835 may not work on a Snapdragon 888 because the GPU architectures differ.
Performance: Using a pre-compiled .bin file significantly reduces the "first-run" latency of an AI application by skipping the kernel compilation step at startup.
Troubleshooting: If the file is missing, the MACE engine may try to compile kernels at runtime, which can cause significant delays or crashes if the OpenCL environment is not properly set up.
Are you trying to deploy a specific AI model (like MobileNet) to an Android device using MACE? How to build - MACE documentation - Read the Docs