The file mace-cl-compiled-program.bin is a binary file generated by the Mobile AI Compute Engine (MACE), a deep learning inference framework developed by Xiaomi. This specific file contains compiled OpenCL kernels and tuned parameters optimized for a specific mobile device's GPU.

| Offset | Size (bytes) | Description | |--------|--------------|-------------| | 0x00 | 4 | Magic number (MACE or MCLP) | | 0x04 | 4 | Version (e.g., 0x00010000) | | 0x08 | 4 | Number of kernels | | 0x0C | 4 | Total binary size | | 0x10 | 4 | Offset to kernel table | | ... | ... | Vendor-specific headers (Movidius blob) | | ... | ... | Compiled ELF-like sections (VPU instructions) | | End | ... | Possibly signature/hash |

Hardware Targeting: Because OpenCL kernels are hardware-dependent, this .bin file is typically generated at runtime on the target device (like a smartphone) to match its specific GPU architecture.

Conclusion

The Mystery of mace-cl-compiled-program.bin : A Deep Dive into Mobile AI

Create runtime

runtime = mace.MaceRuntime( model_name="my_model", device="myriad", compiled_program=prog_bin )

Verify with MACE CLI

# MACE provides a validation tool
mace_check_compiled_program --file mace-cl-compiled-program.bin --device myriad
# Convert a model (e.g., TensorFlow .pb, PyTorch) to MACE format
mace_converter --model=mobilenet_v1.pb --target_abis=arm64-v8a --device=gpu

. It is designed specifically to run artificial intelligence models efficiently on mobile devices (Android, iOS, and Linux). : Stands for