Oldest operating system the exported package will run on.
Three features raise this floor, and until now they raised it
silently: carrying state, palettizing weights, and writing several
entry points into one package all move the program from the
CoreML7 opset to CoreML8. A package built with any of them
will not load on iOS 17, and nothing said so at the time — the
caller found out from a device.
Naming a target makes the trade explicit in the direction that
matters: ask for IOS17 and a feature that cannot be expressed
there is refused, by name, while the export is still a Python call.
There is no entry below IOS17 because the emitters do not write
below it: this package's gather and scatter carry
validate_indices, which iOS 16 has no field for. Supporting an
older floor is a change to the emitters, not a value in this enum.
Attributes
IOS17strIOS18strExamples
Read back what the package ended up needing:
>>> import shutil, tempfile
>>> import lucid, lucid.nn as nn, lucid.coreml as cml
>>> model = nn.Sequential(
... nn.Conv2d(3, 64, 3, padding=1), nn.ReLU(), nn.Conv2d(64, 64, 3, padding=1)
... ).eval()
>>> x, room = lucid.randn(1, 3, 16, 16), tempfile.mkdtemp()
>>> package = cml.export(model, x, f"{room}/m.mlpackage")
>>> package.deployment_target
<DeploymentTarget.IOS17: 'CoreML7'>
>>> package.close()
Or refuse a floor the package cannot meet, while it is still a
Python call rather than a device:
>>> cml.export(model, x, f"{room}/p.mlpackage", weights=cml.Palettize(bits=4),
... minimum_deployment_target=cml.DeploymentTarget.IOS17)
Traceback (most recent call last):
ValueError: lucid.coreml: IOS17 was asked for, ... palettization ... only from IOS18...
>>> shutil.rmtree(room)