Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is torch.compile supported? #1891

Open
nicknikolov opened this issue Jun 27, 2023 · 3 comments
Open

Is torch.compile supported? #1891

nicknikolov opened this issue Jun 27, 2023 · 3 comments
Labels
awaiting response Please respond to this issue to provide further clarification (status) feature request Functionality does not currently exist, would need to be created as a new feature (type) PyTorch (traced)

Comments

@nicknikolov
Copy link

nicknikolov commented Jun 27, 2023

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

@nicknikolov nicknikolov added the question Response providing clarification needed. Will not be assigned to a release. (type) label Jun 27, 2023
@junpeiz
Copy link
Collaborator

junpeiz commented Jun 27, 2023

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!

@junpeiz junpeiz added feature request Functionality does not currently exist, would need to be created as a new feature (type) PyTorch (traced) awaiting response Please respond to this issue to provide further clarification (status) and removed question Response providing clarification needed. Will not be assigned to a release. (type) labels Jun 27, 2023
@mrdbourke
Copy link

Would love to see this feature too!

@den-run-ai
Copy link

coremltools would need to be registered as a custom backend in torch.compile:

https://pytorch.org/docs/stable/dynamo/custom-backends.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Please respond to this issue to provide further clarification (status) feature request Functionality does not currently exist, would need to be created as a new feature (type) PyTorch (traced)
Projects
None yet
Development

No branches or pull requests

4 participants