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 GPU support for draw_segmentation_masks #7684

Merged
merged 5 commits into from
Jun 23, 2023

Conversation

mshr-h
Copy link
Contributor

@mshr-h mshr-h commented Jun 20, 2023

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 20, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7684

Note: Links to docs will display an error until the docs builds have been completed.

❌ 7 New Failures

As of commit 43e8034:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @mshr-h!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @mshr-h . We should probably add a quick test to make sure it works as expected, by e.g. adding the cpu_and_gpu() decorator to this test:

def test_draw_segmentation_masks(colors, alpha):

See

@pytest.mark.parametrize("device", cpu_and_gpu())
def test_resize_asserts(device):
for an example of how it's used

@mshr-h mshr-h marked this pull request as draft June 20, 2023 10:18
@mshr-h mshr-h force-pushed the draw_segmentation_masks-on-cuda branch from fe0317b to 257de9b Compare June 20, 2023 10:21
@mshr-h
Copy link
Contributor Author

mshr-h commented Jun 20, 2023

Thank you for your quick review.
I updated the unit test.

I need to ask my employer to sign the CLA. I guess it takes a few weeks.

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

CI failures are unrelated. Thanks a lot @mshr-h!

I need to ask my employer to sign the CLA. I guess it takes a few weeks.

Unfortunately, we cannot merge until that is done. We should get a notification as soon as that is done, but in case we miss it, feel free to ping us here.

@pmeier pmeier linked an issue Jun 20, 2023 that may be closed by this pull request
@mshr-h mshr-h marked this pull request as ready for review June 23, 2023 01:50
@mshr-h
Copy link
Contributor Author

mshr-h commented Jun 23, 2023

@pmeier
I've completed signing the CLA.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @mshr-h , I fixed a conflict issue and I'll merge when green

@@ -245,11 +246,12 @@ def test_draw_segmentation_masks(colors, alpha):
torch.testing.assert_close(out[:, mask], interpolated_color, rtol=0.0, atol=1.0)


def test_draw_segmentation_masks_errors():
@pytest.mark.parametrize("device", cpu_and_cuda())
def test_draw_segmentation_masks_errors(device):
Copy link
Member

Choose a reason for hiding this comment

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

I'll leave this here to avoid churn but we typically don't need to run those tests on cuda, as there's nothing cuda-spcecific there. Same for test_draw_no_segmention_mask

@NicolasHug NicolasHug merged commit 887b6f1 into pytorch:main Jun 23, 2023
@mshr-h mshr-h deleted the draw_segmentation_masks-on-cuda branch June 26, 2023 01:23
facebook-github-bot pushed a commit that referenced this pull request Jul 3, 2023
Reviewed By: vmoens

Differential Revision: D47186583

fbshipit-source-id: 2e1c92fcd58b48c030bc131842c941bfaf3b6948

Co-authored-by: Nicolas Hug <nh.nicolas.hug@gmail.com>
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

draw_segmentation_masks: Add support for GPU
4 participants