Skip to content

Conversation

@LukasBommes
Copy link
Contributor

@LukasBommes LukasBommes commented Oct 3, 2019

This implements CPU fallback for PSROIPool and PSROIAlign layers based on their CUDA versions implemented in PR #1259.

See also the related discussion.

@fmassa: This contains the changes you requested in PR #1404.

BTW: Sorry for creating a new PR. Since I checked out a new repo I didn't know how to push to the old repo. Can we reintroduce the commits done by @sampepose? Since I kind of "stole" his work (the CUDA implementation of the two layers) now.

@LukasBommes
Copy link
Contributor Author

The failed checks all report that package "six" is missing.

@fmassa
Copy link
Member

fmassa commented Oct 3, 2019

Can we reintroduce the commits done by @sampepose

You would need to create a new PR and do the rebase, which would be a bit more work compared to what you currently have. If @sampepose is ok with this, we could move on with this PR as is.

The failed checks all report that package "six" is missing.

This is an issue in PyTorch, which will be fixed in pytorch/pytorch#27282 and tomorrow (once the PR has been merged and the new nightly pushed) this should be fixed

The general structure looks great to me, thanks a lot!
I'll have a closer look tomorrow when CI is more well-behaved

@fmassa fmassa closed this Oct 3, 2019
@fmassa fmassa reopened this Oct 3, 2019
@sampepose
Copy link

sampepose commented Oct 3, 2019

No worries, you can keep my work in this PR. Just rename the title to reflect that it's not only CPU ops.

@LukasBommes LukasBommes changed the title CPU implementation for Position-sensitive ROI Pool/Align [updated] Implementation for Position-sensitive ROI Pool/Align [updated] Oct 4, 2019
@LukasBommes
Copy link
Contributor Author

Great! I changed the title accordingly.

Copy link
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.

The implementation looks great to me, thanks a lot!

Lint is failing for both C++ and Python, can you look into fixing it?

cc @varunagrawal if you'd like to have a look at well.

dtype=self.dtype)
assert torch.allclose(gt_y, y), 'PSRoIAlign layer incorrect on CPU'

def test_ps_roi_align_cpu(self):
Copy link
Member

Choose a reason for hiding this comment

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

For a follow-up PR: we should simplify the testing for the roi_* layers, they can be refactored so that we have many less lines of code.

@LukasBommes
Copy link
Contributor Author

@fmassa: I'll take a look at fixing the linter complaints when I am more free. This week I am a bit too busy.

@fmassa
Copy link
Member

fmassa commented Oct 8, 2019

@LukasBommes no worries, I'll also have a closer look next week

@codecov-io
Copy link

codecov-io commented Oct 10, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@da89dad). Click here to learn what that means.
The diff coverage is 72.22%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1410   +/-   ##
=========================================
  Coverage          ?   64.08%           
=========================================
  Files             ?       82           
  Lines             ?     6362           
  Branches          ?      970           
=========================================
  Hits              ?     4077           
  Misses            ?     2002           
  Partials          ?      283
Impacted Files Coverage Δ
torchvision/ops/__init__.py 100% <100%> (ø)
torchvision/ops/ps_roi_align.py 70.37% <70.37%> (ø)
torchvision/ops/ps_roi_pool.py 72% <72%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da89dad...517afd0. Read the comment docs.

@LukasBommes LukasBommes requested a review from fmassa October 11, 2019 01:59
Copy link
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.

LGTM, thanks a lot!

I have to fix CUDA and Windows build first before I can merge the PR, but this PR look like it's ready to be merged.

@fmassa
Copy link
Member

fmassa commented Oct 15, 2019

@LukasBommes can you rebase your PR on top of current master? I've issued a fix for the CUDA test, I'd like to see if tests pass on CUDA

@LukasBommes
Copy link
Contributor Author

@fmassa: Was it correct to just pull from upstream master and merge into my branch? Or is something else needed to rebase?

@fmassa
Copy link
Member

fmassa commented Oct 16, 2019

Your rebase was fine, can you list the commands you did just for completeness?
Also, CUDA CI is working. I'm going to be merging this, although I haven't finished fixing Windows CI.

@fmassa fmassa merged commit 896d7ec into pytorch:master Oct 16, 2019
@fmassa
Copy link
Member

fmassa commented Oct 16, 2019

Thanks a lot!

@LukasBommes
Copy link
Contributor Author

Welcome!
Regarding the commands:
[in my local repo]
git checkout master
git pull origin
[build & ran tests locally]
git push -u master

Thanks for merging!

@LukasBommes
Copy link
Contributor Author

I also agree on the fact that the tests should be refactored in the next step. I simply duplicated the code to prevent introducing errors in the tests.

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.

4 participants