Title: Bug: model1 outputs conflict with inputs β chunk_pre_encoder_embs as both input and output
Hi, thank you for the Sortformer CoreML conversion!
We found a bug that prevents the model from running on the Neural Engine. In model1/model.mil, the tensor chunk_pre_encoder_embs appears as both a function input and output:
func main(tensor<fp32, [1, 14, 512]> chunk_pre_encoder_embs, ...) {
...
tensor<fp32, [1, 14, 512]> chunk_pre_encoder_embs_tmp = identity(x = chunk_pre_encoder_embs);
tensor<int32, [1]> chunk_pre_encoder_lengths_tmp = identity(x = chunk_pre_encoder_lengths);
} -> (speaker_preds, chunk_pre_encoder_embs, chunk_pre_encoder_lengths);
The identity ops exist but the return references the original input names instead of _tmp. CoreML rejects this: "Inputs and outputs must be distinct, please add an explicit identity op."
Fix: Change the pipeline outputs to reference chunk_pre_encoder_embs_tmp and chunk_pre_encoder_lengths_tmp, or rename them to _out suffixes in the pipeline output mapping.
The model falls back to CPU execution, but Neural Engine compilation fails completely.
Good catch, thanks for the detailed report.
This is now fixed. The model has been recompiled with _out suffixes on all pipeline outputs β speaker_preds_out, chunk_pre_encoder_embs_out, chunk_pre_encoder_lengths_out. The updated .mlmodelc has been uploaded.
The Swift inference code has been updated to match the new output names (commit).
If you've cached the model locally, delete the cache and re-download to pick up the fix.