Add torchvision deform_conv2d lowering#2752
Conversation
|
Hi @TobyRoseman, you had asked about the deform_conv2d math/details in #1889. I opened this PR with a MIL When you have bandwidth, I’d appreciate your review. Maintainer edits are enabled. |
|
Your unit tests don't pass: |
|
Thanks. I reproduced the fp32 Root cause appears to be the native Core ML I pushed Validation:
|
|
I also addressed the inline test cleanup comments in
Validation for the cleaned version passed on the fork macOS matrix across macOS 14, macOS 15, and macOS latest for both TorchScript and TorchExport: https://github.com/SakshamKapoor2911/coremltools/actions/runs/28838429356 |
|
Have you verified your new unit tests are passing on macOS? |
|
Yes. All unit tests pass on macOS. I ran a fork CI matrix covering macos-14, macos-15, and macos-latest for both TorchScript and TorchExport frontends. On macOS, the test harness calls mlmodel.predict and compares Core ML output numerically against the PyTorch reference, so this is a full end-to-end check, not just a conversion smoke. CI logs: https://github.com/SakshamKapoor2911/coremltools/actions/runs/28838429356 One caveat worth flagging: these ran on GitHub-hosted virtualized macOS runners with CPU_ONLY, so I wasn't able to verify behavior on physical Apple Silicon or the ANE since I don't have access to macOS devices. If the team wants to confirm on bare metal before merging, I think that could be a reasonable step. |
Summary
torchvision::deform_conv2d.resamplecalls plus a final 1x1conv.Fixes #1889.
Testing
Local Linux conversion/structure tests:
Result:
NeuralNetwork skip path:
Result:
Other local validation:
git diff --check origin/main...HEADpassed.milinternalpassed across the seven test configs.torchvision.ops.deform_conv2dacross 8 configs with max absolute diff1.43e-6.Fork-only CI smoke:
coremltools==9.0wheel, verifiedBlobWriter, and ran the fullTestDeformConv2dclass.