-
Notifications
You must be signed in to change notification settings - Fork 666
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
CreateBnnsGraphProgramFromMIL fails on model init on iOS HW #2450
Comments
I also doubt these errors are what's preventing your model from running on the NE. Without more details about your network and how you are exporting, it's difficult to help. Have you taken a look at the Apple Machine Learning Research Post: Deploying Transformers on the Apple Neural Engine? |
The problem seems to be in Pytorch-model upsampling path. Why would that not be possible on ANE?
|
I'm not sure either. What dtype is being used here? Are you using any flexible shapes? You could try converting a simple network with just that PyTorch op, and taking a look the MIL ops that get generated. |
Input shape in the real model is fixed. I made a quick test with a dummy model. Model converts to CoreML, however, when instantiating runtime in iOS I get the same error messages. Hmmm, that 16 stride is ANE's kryptonite?
MIL:
iOS runtime:
|
After a long battle I have finally ported a Music Source Separation model from the python world to iOS. The Pytorch model has been exported using the CoreMLTools and the model provides correct results vs. the desktop+GPU+python runtime.
I have been trying to get the model to utilize iOS HW (iPhone 15 Pro Max) Neural Engine (NE) but so far not so good. The model either runs on CPU or CPU+GPU. Xcode model performance tester hints that the model is possible to run on NE, but I doubt the errors at MIL-to-runtime compilation prevent NE execution?
Any hints or tips, are there any options to check in model export phase to overcome this issue? Thanks!
MLModelConfiguration (.cpuAndNeuralEngine):
model.mil: 2465:
tensor<fp32, [1, 64, 80, 226]> out_5_has_output_shape = conv_transpose(bias = decoder_0_1_convtrs_2_bias, dilations = out_5_dilations_0, groups = out_5_groups_0, output_shape = out_5_has_output_shape_output_shape_0, pad = out_5_pad_0, pad_type = out_5_pad_type_0, strides = out_5_strides_0, weight = decoder_0_1_convtrs_2_weight, x = var_1932)[name = tensor<string, []>("out_5_has_output_shape")];
The text was updated successfully, but these errors were encountered: