coremltools
coremltools copied to clipboard
Is torch.compile supported?
Couldn't get it to work. Leaving torch.jit.trace
on will crash and commenting it out coremltools complains
TypeError: @model must either be a PyTorch .pt or .pth file or a TorchScript object, received: <class 'torch.nn.modules.container.Sequential'>
Can provide more info if needed
torch.compile
hasn't been officially supported by coremltools.
If you need this feature, we can use this thread as a feature request ticket, and it would be great if you could attach a minimum code snippet that can reproduce the issue. Thanks!
Would love to see this feature too!
coremltools would need to be registered as a custom backend in torch.compile:
https://pytorch.org/docs/stable/dynamo/custom-backends.html