-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix Bug in Bilinear Interpolation and Add Deform Conv to PT FrontEnd #7397
Merged
anijain2305
merged 9 commits into
apache:main
from
codeislife99:incubator-tvm/bilinear_sample_fix
Feb 5, 2021
Merged
Fix Bug in Bilinear Interpolation and Add Deform Conv to PT FrontEnd #7397
anijain2305
merged 9 commits into
apache:main
from
codeislife99:incubator-tvm/bilinear_sample_fix
Feb 5, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codeislife99
changed the title
Fix Bug in Bilinear Interpolation
Fix Bug in Bilinear Interpolation and Add Deform Conv to PT FrontEnd
Feb 3, 2021
cc @vinx13 |
vinx13
reviewed
Feb 4, 2021
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
vinx13
approved these changes
Feb 5, 2021
anijain2305
approved these changes
Feb 5, 2021
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 @codeislife99 @vinx13 This is merged |
alexwong
pushed a commit
to alexwong/tvm
that referenced
this pull request
Feb 11, 2021
…pache#7397) * Fix Bug in Bilinear Interpolation * Add NHWC Tests * clean * Fix Bug and Add Deformable Conv PyTorch for completeness * Add Tensor Utils * Remove stuff * Include vector * PR Comments * Empty Commit for CI Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
Lokiiiiii
pushed a commit
to Lokiiiiii/tvm
that referenced
this pull request
Mar 2, 2021
…pache#7397) * Fix Bug in Bilinear Interpolation * Add NHWC Tests * clean * Fix Bug and Add Deformable Conv PyTorch for completeness * Add Tensor Utils * Remove stuff * Include vector * PR Comments * Empty Commit for CI Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Mar 2, 2021
…pache#7397) * Fix Bug in Bilinear Interpolation * Add NHWC Tests * clean * Fix Bug and Add Deformable Conv PyTorch for completeness * Add Tensor Utils * Remove stuff * Include vector * PR Comments * Empty Commit for CI Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds deform_conv to PT Frontend. It also fixes a bug in bilinear interpolation which was causing wrong output with deformable convolutions from PT framework. The "bug" occurs when one or more the interpolation index(y, x) is outside one or more of the boundary points
(y_max, x_max)
, but within(y_max + 1, x_max + 1)
. In the current implementation both interpolation source points are on the boundary even if the point is closer to one or more of(y_max+1, x_max+1)
. In the corrected version, the first point is on the boundary and the second point value is 0 which is more logically sound and matches with how frameworks have implemented it.PS : It might seem that this is a corner case, but it really changes the accuracy by a lot
For e.g: Without this change , the relative and absolute tolerances are around 1 and 1e-2 with tolerances being more than 1e-2 for 25-40% of the output elements in deformable convolution.
Since ROI align is dependent on this change, I have made the corresponding necessary changes in ROIAlign and verified that it works like before as expected.