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

Add deform_conv2d as implemented in torchvision #2147

Merged
merged 40 commits into from
Sep 23, 2024

Conversation

wingertge
Copy link
Contributor

@wingertge wingertge commented Aug 9, 2024

Add Deformable Convolution Layers v1/v2

Help would be welcome, I've been looking at the kernel so long I can no longer see my mistakes. Getting a few more pairs of eyes on it would be helpful.

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

A lot of resnet variants currently replace most conv2d layers with deform_conv2d. See torchvision docs

Changes

Adds the relatively popular deform_conv2d layer initially implemented in torchvision in 2021.

Testing

  • Tested with comparison to pytorch output
  • All tests passing

@wingertge
Copy link
Contributor Author

Currently blocked on atomics being added to cubecl

@wingertge wingertge marked this pull request as ready for review September 16, 2024 20:52
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 82.46020% with 683 lines in your changes missing coverage. Please review.

Project coverage is 85.67%. Comparing base (aa79e36) to head (04937ed).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...urn-jit/src/kernel/conv/deform_conv_transpose2d.rs 51.41% 240 Missing ⚠️
crates/burn-autodiff/src/ops/module.rs 25.69% 214 Missing ⚠️
crates/burn-jit/src/kernel/conv/deform_conv2d.rs 45.41% 143 Missing ⚠️
crates/burn-core/src/nn/conv/deform_conv2d.rs 82.35% 27 Missing ⚠️
crates/burn-candle/src/ops/module.rs 0.00% 19 Missing ⚠️
crates/burn-tch/src/ops/module.rs 0.00% 19 Missing ⚠️
crates/burn-fusion/src/ops/module.rs 94.79% 10 Missing ⚠️
crates/burn-tensor/src/repr/operation.rs 72.72% 9 Missing ⚠️
crates/burn-tensor/src/tensor/ops/modules/base.rs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2147      +/-   ##
==========================================
- Coverage   85.79%   85.67%   -0.13%     
==========================================
  Files         754      760       +6     
  Lines       95189    99082    +3893     
==========================================
+ Hits        81671    84888    +3217     
- Misses      13518    14194     +676     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wingertge
Copy link
Contributor Author

Finally done and ready to review

@wingertge wingertge changed the title [WIP] Add deform_conv2d as implemented in torchvision Add deform_conv2d as implemented in torchvision Sep 17, 2024
Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions, otherwise very nice!

Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louisfd louisfd merged commit 2c8514c into tracel-ai:main Sep 23, 2024
11 checks passed
@wingertge wingertge deleted the deformable_conv branch September 23, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants