Skip to content

Added nearest-exact interpolation mode#64501

Closed
vfdev-5 wants to merge 21 commits intopytorch:masterfrom
Quansight:vfdev-5/fix-nearest-upsampling
Closed

Added nearest-exact interpolation mode#64501
vfdev-5 wants to merge 21 commits intopytorch:masterfrom
Quansight:vfdev-5/fix-nearest-upsampling

Conversation

@vfdev-5
Copy link
Copy Markdown
Contributor

@vfdev-5 vfdev-5 commented Sep 3, 2021

Added "nearest-exact" interpolation mode to fix the issues: #34808 and #62237.

Description:

As we can not fix "nearest" mode without large impact on already trained model it was suggested to introduce new mode instead of fixing exising "nearest" mode.

"nearest":

input_index_f32 = output_index * scale
input_index = floor(input_index_f32)

"nearest-exact"

input_index_f32 = (output_index + 0.5) * scale - 0.5
input_index = round(input_index_f32)

Comparisions with other libs: https://gist.github.com/vfdev-5/a5bd5b1477b1c82a87a0f9e25c727664

PyTorch version 1.9.0 "nearest" this PR "nearest" this PR "nearest-exact"
Resize option:
OpenCV INTER_NEAREST result mismatches 0 0 10
OpenCV INTER_NEAREST_EXACT result mismatches 9 9 9
Scikit-Image result mismatches 10 10 0
Pillow result mismatches 10 10 7
TensorFlow result mismatches 10 10 0
Rescale option:
size mismatches (#62396) 10 10 10
OpenCV INTER_NEAREST result mismatches 3 3 5
OpenCV INTER_NEAREST_EXACT result mismatches 3 3 4
Scikit-Image result mismatches 4 4 0
Scipy result mismatches 4 4 0
TensorFlow: no such option - -

Versions:

skimage: 0.19.0.dev0
opencv: 4.5.4-dev
scipy: 1.7.2
Pillow: 8.4.0
TensorFlow: 2.7.0

Implementations in other libs:

Additionally:

  • Updated upsampling tests

cc @ezyang @gchanan @albanD @mruberry @jbschlosser @walterddr @fmassa @heitorschueroff @ppwwyyxx

vfdev-5 added 3 commits September 3, 2021 04:32
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Sep 3, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit a612bb1 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@ppwwyyxx
Copy link
Copy Markdown
Collaborator

ppwwyyxx commented Sep 3, 2021

FYI I just noticed that opencv already fixed the issue with a new interpolation mode: opencv/opencv#18053

@albanD albanD removed their request for review September 6, 2021 21:24
@vfdev-5
Copy link
Copy Markdown
Contributor Author

vfdev-5 commented Sep 7, 2021

opencv already fixed the issue with a new interpolation mode: opencv/opencv#18053

@ppwwyyxx I have an impression that it gives other results and not always matches PIL or Scikit-Image (which not always match neither).
For example

import numpy as np
from PIL import Image
import cv2
from skimage.transform import resize

size = 10
a_in = np.arange(0, 3 * 32 * 32, dtype="uint8").reshape(32, 32, 3)

pil_in = Image.fromarray(a_in)
pil_out = pil_in.resize((size, size), resample=Image.NEAREST)
a_pil_out = np.array(pil_out)

a_cv2_out = cv2.resize(a_in, dsize=(size, size), interpolation=cv2.INTER_NEAREST_EXACT)

a_skimg_out = resize(a_in, (size, size), order=0, preserve_range=True, anti_aliasing=False).astype("uint8")

print(np.allclose(a_cv2_out, a_pil_out), np.mean(np.abs(a_cv2_out - a_pil_out)))
# > (False, 38.74)

print(np.allclose(a_cv2_out, a_skimg_out), np.mean(np.abs(a_cv2_out - a_skimg_out)))
# > (False, 25.3)

@mrshenli mrshenli added module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Sep 7, 2021
Copy link
Copy Markdown
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thanks!

But due to BC-breakages on the numerics of the function, I'll defer to @jbschlosser to decide how to handle this.

@albanD albanD added the module: bc-breaking Related to a BC-breaking change label Sep 8, 2021
@ppwwyyxx
Copy link
Copy Markdown
Collaborator

ppwwyyxx commented Sep 8, 2021

@vfdev-5 From what I can tell the difference is only due to half-rounding: when a sample fall into the middle point between two pixels, it's ambiguous which pixel is its nearest neighbor, and then different implementations make different choices.

The below script verify that for all (input_size, output_size) in (1, 100), all the differences between cv2(NEAREST_EXACT), PIL and skimage are due to the above reason. In other words, these three libraries are in full agreement except for this unavoidable ambiguity of nearest neighbor resize. Please also test this against your PR if possible.

import numpy as np
from PIL import Image
import cv2
from skimage.transform import resize
np.set_printoptions(threshold=9888888)

for size in range(1, 100):
    for isize in range(1, 100):
        a_in = (np.random.rand(isize, isize) * 255).astype("uint8")

        pil_in = Image.fromarray(a_in)
        pil_out = pil_in.resize((size, size), resample=Image.NEAREST)
        a_pil_out = np.array(pil_out)

        a_cv2_out = cv2.resize(a_in, dsize=(size, size), interpolation=cv2.INTER_NEAREST_EXACT)

        a_skimg_out = resize(a_in, (size, size), order=0, mode='edge',
                preserve_range=True, anti_aliasing=False).astype("uint8")

        def is_int(x):
            return np.allclose(np.round(x), x)

        def find_diff(a, b):
            diff = a - b
            if np.abs(diff).max() < 1e-6:
                return
            for y, x in zip(*np.nonzero(diff)):
                oy = (1 / size) * (y + 0.5) / (1 / isize)
                ox = (1 / size) * (x + 0.5) / (1 / isize)
                assert is_int(oy) | is_int(ox), (oy, ox)

        find_diff(a_cv2_out, a_pil_out)
        find_diff(a_cv2_out, a_skimg_out)
        find_diff(a_pil_out, a_skimg_out)

@vfdev-5
Copy link
Copy Markdown
Contributor Author

vfdev-5 commented Sep 8, 2021

Thanks @ppwwyyxx for pointing out that. Yes, you are right, I see what you mean. I think more precisely the point is about int(float_index) where float index has no floating point and producing either i - 1 or i.

isize = 32
size = 10

scale = 1.0 * isize / size
for o in range(size):
    i_f32 = (o + 0.5) * scale
    i = int(i_f32)
    print(o, " <- ", i, i_f32)

> 
0  <-  1 1.6
1  <-  4 4.800000000000001
2  <-  8 8.0
3  <-  11 11.200000000000001
4  <-  14 14.4
5  <-  17 17.6
6  <-  20 20.8
7  <-  24 24.0
8  <-  27 27.200000000000003
9  <-  30 30.400000000000002

a_in = np.arange(0, isize, dtype="float32")[:, None]
pil_in = Image.fromarray(a_in)
pil_out = pil_in.resize((1, size), resample=Image.NEAREST)
a_pil_out = np.array(pil_out)
a_cv2_out = cv2.resize(a_in, dsize=(1, size), interpolation=cv2.INTER_NEAREST_EXACT)
a_skimg_out = resize(a_in, (size, 1), order=0, preserve_range=True, anti_aliasing=False).astype(a_in.dtype)

print("PIL", "SKI", "CV")
print(a_pil_out[:, 0])
print(a_skimg_out[:, 0])
print(a_cv2_out[:, 0])
>
PIL SKI CV
[ 1.  4.  8. 11. 14. 17. 20. 23. 27. 30.]
[ 1.  4.  8. 11. 14. 17. 20. 24. 27. 30.]
[ 1.  4.  7. 11. 14. 17. 20. 23. 27. 30.]

Copy link
Copy Markdown
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

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

But due to BC-breakages on the numerics of the function, I'll defer to @jbschlosser to decide how to handle this.

I'm wary of making this change all at once, since it would certainly require model retraining to avoid performance metric regressions from preprocessing / trained model mismatch.

opencv already fixed the issue with a new interpolation mode: opencv/opencv#18053

I think the way to go here is to follow suit and add a new interpolation mode as well to maintain BC. It's unfortunate but I don't see a way around it while still avoiding lots of painful breakage.

@vfdev-5
Copy link
Copy Markdown
Contributor Author

vfdev-5 commented Sep 9, 2021

Thanks for your comment @jbschlosser !

I think the way to go here is to follow suit and add a new interpolation mode as well to maintain BC. It's unfortunate but I don't see a way around it while still avoiding lots of painful breakage.

Seems reasonable. For example, new mode can be called "nearest-exact" or something similar. Maybe, we can keep both "nearest" and "nearest-exact" in v1.X and remove "nearest-exact", keep "nearest" and replace buggy code for v2.X (as TF did according to https://ppwwyyxx.com/blog/2021/Where-are-Pixels/#Libraries)

Any better suggestions for the mode name, e.g "nearest-exact" ?

@vfdev-5 vfdev-5 changed the title [BC-breaking] Fixes nearest interpolation Added nearest-exact interpolation mode Sep 10, 2021
@vfdev-5 vfdev-5 requested a review from jbschlosser September 10, 2021 14:21
@ppwwyyxx
Copy link
Copy Markdown
Collaborator

I'm not so sure why opencv chooses to call it "Bit-Exact". From opencv/opencv#18053 (comment) it appears it means "it produces bitwise identical output regardless of platform". If that's what the name means that doesn't sound like what we're looking for.
From my point of view the old "nearest" is just wrong (in both opencv and pytorch) and the new one would be "nearest-correct" or something.

@pytorch-probot
Copy link
Copy Markdown

pytorch-probot bot commented Nov 8, 2021

CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/Quansight/pytorch/blob/0de5467ea8f7d46257e501e3da001e3feabc64b3/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/xla ✅ triggered
linux-vulkan-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-dynamic ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3.6-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers ✅ triggered
linux-xenial-py3.6-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx ✅ triggered
linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single-full-jit ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
docker-builds ciflow/all 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow 🚫 skipped
linux-xenial-py3-clang5-mobile-code-analysis ciflow/all, ciflow/linux, ciflow/mobile 🚫 skipped
parallelnative-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped

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/slow

For more information, please take a look at the CI Flow Wiki.

@vfdev-5
Copy link
Copy Markdown
Contributor Author

vfdev-5 commented Nov 9, 2021

@jbschlosser I updated the PR according to your previous recommendations: a) separate private ops doing the nearest exact interpolation and b) added work around for JIT FC. Could you please review the PR. Thanks!

Copy link
Copy Markdown
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

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

Looking pretty good, just a minor script-gating thing :)

@pytorch-probot
Copy link
Copy Markdown

CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/Quansight/pytorch/blob/669817e71c67b8809c93271618edfacce35da815/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/xla ✅ triggered
linux-vulkan-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-dynamic ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3.6-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers ✅ triggered
linux-xenial-py3.6-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx ✅ triggered
linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single-full-jit ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
docker-builds ciflow/all 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow 🚫 skipped
linux-xenial-py3-clang5-mobile-code-analysis ciflow/all, ciflow/linux, ciflow/mobile 🚫 skipped
parallelnative-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped

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/slow

For more information, please take a look at the CI Flow Wiki.

@pytorch-probot
Copy link
Copy Markdown

CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/Quansight/pytorch/blob/a612bb1bb3729d8e42f7cce94cc1d0bcc9cae148/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/xla ✅ triggered
linux-vulkan-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-dynamic ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3.6-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers ✅ triggered
linux-xenial-py3.6-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx ✅ triggered
linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single-full-jit ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
docker-builds ciflow/all 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow 🚫 skipped
linux-xenial-py3-clang5-mobile-code-analysis ciflow/all, ciflow/linux, ciflow/mobile 🚫 skipped
macos-10-15-py3-arm64 ciflow/all, ciflow/macos 🚫 skipped
macos-10-15-py3-lite-interpreter-x86-64 ciflow/all, ciflow/macos 🚫 skipped
macos-10-15-py3-x86-64 ciflow/all, ciflow/macos 🚫 skipped
parallelnative-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped

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/slow

For more information, please take a look at the CI Flow Wiki.

Copy link
Copy Markdown
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

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

Looks good on my end!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@jbschlosser has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@jbschlosser merged this pull request in 6adbe04.

@vfdev-5 vfdev-5 deleted the vfdev-5/fix-nearest-upsampling branch November 15, 2021 22:31
vfdev-5 added a commit to vfdev-5/pytorch that referenced this pull request Dec 2, 2021
Description:

Following pytorch#65142 (comment) adding missing nearest-exact mode and anti-alias flag
- pytorch#65142
- pytorch#64501

cc @cpuhrsch
facebook-github-bot pushed a commit that referenced this pull request Dec 22, 2021
Summary:
Description:

Following #65142 (comment) adding missing nearest-exact mode and anti-alias flag to C++ frontend.

- #65142
- #64501

- added tests in pytorch/test/cpp/api/functional.cpp

Pull Request resolved: #69318

Reviewed By: davidberard98

Differential Revision: D33278995

Pulled By: jbschlosser

fbshipit-source-id: fa87c0c78df6b398e4f9688cc02111eed187afa7
facebook-github-bot pushed a commit that referenced this pull request Jan 28, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- #64501 (Sept 04 2021)
- #65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: #71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
pytorchmergebot pushed a commit that referenced this pull request Jan 28, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- #64501 (Sept 04 2021)
- #65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: #71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
(cherry picked from commit b21173d)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 3, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- pytorch/pytorch#64501 (Sept 04 2021)
- pytorch/pytorch#65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: pytorch/pytorch#71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
(cherry picked from commit b21173d)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 3, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- pytorch/pytorch#64501 (Sept 04 2021)
- pytorch/pytorch#65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: pytorch/pytorch#71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
(cherry picked from commit b21173d)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 9, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- pytorch/pytorch#64501 (Sept 04 2021)
- pytorch/pytorch#65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: pytorch/pytorch#71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
(cherry picked from commit b21173d)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 9, 2022
Summary:
Description:
- Removed JIT FC tweaks for interpolation options : nearest-exact and antialiasing

They were added in
- pytorch/pytorch#64501 (Sept 04 2021)
- pytorch/pytorch#65142 (Sept 16 2021)

cc jbschlosser

Pull Request resolved: pytorch/pytorch#71937

Reviewed By: mrshenli

Differential Revision: D33845502

Pulled By: jbschlosser

fbshipit-source-id: 8a94454fd643cd2aef21b06689f72a0f16620d30
(cherry picked from commit b21173d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: bc-breaking Related to a BC-breaking change module: nn Related to torch.nn open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants