Skip to content

coreai-opt v0.4.0

Choose a tag to compare

@dengqiaoyu dengqiaoyu released this 06 Nov 00:45
· 12 commits to main since this release
v0.4.0
ba82a6c

This release pins coreai-torch==0.4.3 and coreai-core==1.0.0b3

  • Support for Python 3.14.
  • In addition to the Core AI, and Core ML backends in the finalize API, added a 3rd one: ExportBackend.Torch which performs “folding of weights” to allow for inference to happen similar to an uncompressed weight model.
  • Added state_dict flag to the prepare API, in all optimizers, to allow for loading pre-quantized weights and skip the expensive step of re-compression. Can be combined with ExportBackend.Torch to do accuracy evals on the torch model with similar inference speed as the uncompressed model, and then re-prepare the model quickly with the same config, to then finalize and export to Core AI.
  • Vector k-means (palettization with cluster_dim > 1) is now much faster on both CPU and CUDA backends.
  • Support for more dtypes in quantization (MXINT8, INT6, UINT6)
  • A new [sparsity_detection_threshold](https://apple.github.io/coreai-optimization/palettization/config.html#palettizing-already-sparse-weights) option in PalettizationSpec : if the weights are already sparse, this flag will cause the palettization to be applied only to the non-zero values, and during finalize/export to Core AI/ Core ML, both palettization and sparsity ops will be used to efficiently pack the weights to minimize disk usage and enable faster runtime on applicable delegates.
  • Dynamic activation range calibration for FP16 casting: cast_fp32_to_fp16 and cast_to_16_bit_precision accept an optional calibration_data. Activations that exceed the float16 range (> 65,504 or NaN/Inf) during calibration are kept in FP32 along with their downstream consumers

Special thanks to our external contributors:

@rohith500 @darkdi @alphasafal