-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[BC-breaking] Fixed interpolation output size to match opencv if scale factor is specified #64983
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
[BC-breaking] Fixed interpolation output size to match opencv if scale factor is specified #64983
Conversation
Fixed output size to match opencv, scikit-image, scipy if scale factor is specified
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit bf36847 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This is a BC-breaking change though, so I would love to get @jbschlosser approval on how to move forward with the breaking change.
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slowFor more information, please take a look at the CI Flow Wiki. |
|
@jbschlosser could you please take a look at this PR which should fix output size issue by torch.nn.functional.interpolation vs opencv, scikit-image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fmassa do you have a sense for how disruptive this change would be if we made it outright? The breakage seems less common and less silent than fixing the off-by-one interpolate content error, and it's still possible to get the old output by slicing (e.g. out[:,:,:-1,:-1]) if necessary.
That said, the conservative route I'd default to involves the painful process of adding another flag to switch between old and new behavior (idk a good name, round_with_scale_factor?), the JIT FC workaround for adding the new kwarg, etc. If the breakage isn't too bad, I'd like to avoid this messy situation, but it's hard for me to say.
@jbschlosser I think this can be a bit more trickier, for example #70559 where slicing does not give the previous output. |
Good point and thanks for bringing it up - I think we'll have to go the long and painful route. I did a quick github code search and it does look like the behavior will be disruptive for certain use cases, especially for things like U-Nets which have a lot of I'll put forth the name of
|
|
Sounds good to me! |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
Sorry for delay on this PR. I still plan to follow #64983 (comment) and update the PR. I remove "Stale" label. |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
Just chiming in as @vfdev-5 asked me to take a look at this. The strategy described in #64983 (comment) sounds like the least disruptive way forward. Perhaps with a small amendment: according to https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy "stage 1" should probably last 2 versions instead of 1. |
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 EikanWang [ghstack-poisoned]
Addresses #62396 following the strategy described in #64983 (comment). Fixing output size to match opencv, scikit-image, scipy if scale factor is specified on ATen side only due to JIT FC. Pull Request resolved: #97868 Approved by: https://github.com/lezcano, https://github.com/mikaylagawarecki
Fixes #62396
Dscription:
cc @heitorschueroff , @fmassa