Skip to content

Releases: apple/coremltools

coremltools 6.1

14 Nov 23:01
870213b
Compare
Choose a tag to compare
  • Support for TensorFlow 2.10.
  • New PyTorch ops supported: baddbmm, glu, hstack, remainder, weight_norm, hann_window, randint, cross, trace, and reshape_as.
  • Avoid root logger and use the coremltools logger instead.
  • Support dynamic input shapes for PyTorch repeat and expand op.
  • Enhance translation of torch where op with only one input.
  • Add support for PyTorch einsum equation: 'bhcq,bhck→bhqk’.
  • Optimization graph pass improvement
    • 3D convolution batchnorm fusion
    • Consecutive relu fusion
    • Noop elimination
  • Actively catch the tensor which has rank >= 6 and error out
  • Various other bug fixes, optimizations and improvements.

Special thanks to our external contributors for this release: @fukatani, @piraka9011, @giorgiop, @hollance, @SangamSwadiK, @RobertRiachi, @waylybaye, @GaganNarula, and @sunnypurewal.

coremltools 6.0

19 Sep 18:13
20b8352
Compare
Choose a tag to compare
  • MLProgram compression: affine quantization, palettize, sparsify. See coremltools.compression_utils
  • Python 3.10 support.
  • Support for latest scikit-learn version (1.1.2).
  • Support for latest PyTorch version (1.12.1).
  • Support for TensorFlow 2.8.
  • Support for options to specify input and output data types, for both images and multiarrays
    • Update coremltools python bindings to work with GRAYSCALE_FLOAT16 image datatype of CoreML
    • New options to set input and output types to multi array of type float16, grayscale image of type float16 and set output type as images, similar to the coremltools.ImageType used with inputs.
  • New compute unit enum type: CPU_AND_NE to select the model runtime to the Neural engine and CPU.
  • Support for several new TensorFlow and PyTorch ops.
  • Changes to opset (available from iOS16, macOS13)
    • New MIL ops: full_like, resample, reshape_like, pixel_unshuffle, topk
    • Existing MIL ops with new functionality: crop_resize, gather, gather_nd, topk, upsample_bilinear.
  • API Breaking Changes:
    • Do not assume source prediction column is “predictions”, fixes #58.
    • Remove useCPUOnly parameter from coremltools.convert and coremltools.models.MLModel. Use coremltools.ComputeUnit instead.
    • Remove ONNX support.
    • Remove multi-backend Keras support.
  • Various other bug fixes, optimizations and improvements.

coremltools 6.0b2

01 Aug 21:52
edf87ee
Compare
Choose a tag to compare
coremltools 6.0b2 Pre-release
Pre-release
  • Support for new MIL ops added in iOS16/macOS13: pixel_unshuffle, resample, topk
  • Update coremltools python bindings to work with GRAYSCALE_FLOAT16 image datatype of CoreML
  • New compute unit enum type: CPU_AND_NE
  • New PyTorch ops: AdaptiveAvgPool2d, cosine_similarity, eq, linalg.norm, linalg.matrix_norm, linalg.vector_norm, ne, PixelUnshuffle
  • Support for identity_n TensorFlow op
  • Various other bug fixes, optimizations and improvements.

coremltools 6.0b1

07 Jun 17:37
973eae6
Compare
Choose a tag to compare
coremltools 6.0b1 Pre-release
Pre-release
  • MLProgram compression: affine quantization, palettize, sparsify. See coremltools.compression_utils.
  • New options to set input and output types to multi array of type float16, grayscale image of type float16 and set output type as images, similar to the coremltools.ImageType used with inputs.
  • Support for PyTorch 1.11.0.
  • Support for TensorFlow 2.8.
  • [API Breaking Change] Remove useCPUOnly parameter from coremltools.convert and coremltools.models.MLModel. Use coremltools.ComputeUnit instead.
  • Support for many new PyTorch and TensorFlow layers
  • Many bug fixes and enhancements.

Known issues

  • While conversion and CoreML models with Grayscale Float16 images should work with ios16/macos13 beta, the coremltools-CoreML python binding has an issue which would cause the predict API in coremltools to crash when the either the input or output is of type grayscale float16
  • The new Compute unit configuration MLComputeUnitsCPUAndNeuralEngine is not available in coremltools yet

coremltools 5.2

22 Feb 22:36
e3032bf
Compare
Choose a tag to compare
  • Support latest version (1.10.2) of PyTorch
  • Support TensorFlow 2.6.2
  • Support New PyTorch ops:
    • bitwise_not
    • dim
    • dot
    • eye
    • fill
    • hardswish
    • linspace
    • mv
    • new_full
    • new_zeros
    • rrelu
    • selu
  • Support TensorFlow ops
    • DivNoNan
    • Log1p
    • SparseSoftmaxCrossEntropyWithLogits
  • Various bug fixes, clean ups and optimizations.
  • This is the final coremltools version to support Python 3.5

coremltools 5.1

09 Nov 18:31
acadd11
Compare
Choose a tag to compare
  • New supported PyTorch operations: broadcast_tensors, frobenius_norm, full, norm and scatter_add.
  • Automatic support for inplace PyTorch operations if non-inplace operation is supported.
  • Support PyTorch 1.9.1
  • Various other bug fixes, optimizations and improvements.

coremltools 5.0

04 Oct 19:17
89d058f
Compare
Choose a tag to compare

What’s New

  • Added a new kind of Core ML model type, called ML Program. TensorFlow and Pytorch models can now be converted to ML Programs.
    • To learn about ML Programs, how they are different from the classicial Core ML neural network types, and what they offer, please see the documentation here
    • Use the convert_to argument with the unified converter API to indicate the model type of the Core ML model.
      • coremltools.convert(..., convert_to=“mlprogram”) converts to a Core ML model of type ML program.
      • coremltools.convert(..., convert_to=“neuralnetwork”) converts to a Core ML model of type neural network. “Neural network” is the older Core ML format and continues to be supported. Using just coremltools.convert(...) will default to produce a neural network Core ML model.
    • When targeting ML program, there is an additional option available to set the compute precision of the Core ML model to either float 32 or float16. The default is float16. Usage example:
      • ct.convert(..., convert_to=“mlprogram”, compute_precision=ct.precision.FLOAT32) or ct.convert(..., convert_to=“mlprogram”, compute_precision=ct.precision.FLOAT16)
      • To know more about how this affects the runtime, see the documentation on Typed execution.
  • You can save to the new Model Package format through the usual coremltool’s save method. Simply use model.save("<model_name>.mlpackage") instead of the usual model.save(<"model_name>.mlmodel")
    • Core ML is introducing a new model format called model packages. It’s a container that stores each of a model’s components in its own file, separating out its architecture, weights, and metadata. By separating these components, model packages allow you to easily edit metadata and track changes with source control. They also compile more efficiently, and provide more flexibility for tools which read and write models.
    • ML Programs can only be saved in the model package format.
  • Adds the compute_units parameter to MLModel and coremltools.convert. This matches the MLComputeUnits in Swift and Objective-C. Use this parameter to specify where your models can run:
    • ALL - use all compute units available, including the neural engine.
    • CPU_ONLY - limit the model to only use the CPU.
    • CPU_AND_GPU - use both the CPU and GPU, but not the neural engine.
  • Python 3.9 Support
  • Native M1 support for Python 3.8 and 3.9
  • Support for TensorFlow 2.5
  • Support Torch 1.9.0
  • New Torch ops: affine_grid_generator, einsum, expand, grid_sampler, GRU, linear, index_put maximum, minimum, SiLUs, sort, torch_tensor_assign, zeros_like.
  • Added flag to skip loading a model during conversion. Useful when converting for new macOS on older macOS:
    ct.convert(....., skip_model_load=True)
  • Various bug fixes, optimizations and additional testing.

Deprecations and Removals

  • Caffe converter has been removed. If you are still using the Caffe converter, please use coremltools 4.
  • Keras.io and ONNX converters will be deprecated in coremltools 6. Users are recommended to transition to the TensorFlow/PyTorch conversion via the unified converter API.
  • Methods, such as convert_neural_network_weights_to_fp16(), convert_neural_network_spec_weights_to_fp16() , that had been deprecated in coremltools 4, have been removed.
  • The useCPUOnly parameter for MLModel and MLModel.predicthas been deprecated. Instead, use the compute_units parameter for MLModel and coremltools.convert.

coremltools 5.0b5

22 Sep 18:49
30ea1da
Compare
Choose a tag to compare
coremltools 5.0b5 Pre-release
Pre-release
  • Added support for pytorch conversion for tensor assignment statements: torch_tensor_assign op and index_put_ op . Fixed bugs in translation of expand ops and sort ops.
  • Model input/output name sanitization: input and output names for "neuralnetwork" backend are sanitized (updated to match regex [a-zA-Z_][a-zA-Z0-9_]*), similar to the "mlprogram" backend. So instead of producing input/output names such as "1" or "input/1", "var_1" or "input_1", names will be produced by the unified converter API.
  • Fixed a bug preventing a Model Package from being saved more than once to the same path.
  • Various bug fixes, optimizations and additional testing.

coremltools 5.0b4

01 Sep 18:09
0436276
Compare
Choose a tag to compare
coremltools 5.0b4 Pre-release
Pre-release
  • Fixes Python 3.5 and 3.6 errors when importing some specific submodules.
  • Fixes Python 3.9 import error for arm64. #1288

coremltools 5.0b3

16 Aug 21:00
c6354af
Compare
Choose a tag to compare
coremltools 5.0b3 Pre-release
Pre-release
  • Native M1 support for Python 3.8 and Python 3.9
  • Adds the compute_units parameter to MLModel and coremltools.convert. Use this to specify where your models can run:
    • ALL - use all compute units available, including the neural engine.
    • CPU_ONLY - limit the model to only use the CPU.
    • CPU_AND_GPU - use both the CPU and GPU, but not the neural engine.
  • With the above change we are deprecating the useCPUOnly parameter for MLModel and coremltools.convert.
  • For ML programs the default compute precision has changed from Float 32 to Float 16. This can be overridden with the compute_precision parameter of coremltools.convert.
  • Support for TensorFlow 2.5
  • Removed scipy dependency
  • Various bug fixes and optimizations