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

support flip and rot90 for complex dtype #37826

Closed

Conversation

kshitij12345
Copy link
Collaborator

Closes #37698

@kshitij12345
Copy link
Collaborator Author

kshitij12345 commented May 5, 2020

@anjali411 @dylanbespalko Please review.

@dr-ci
Copy link

dr-ci bot commented May 5, 2020

💊 CI failures summary and remediations

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


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 83 times.

test/test_torch.py Outdated Show resolved Hide resolved
test/test_torch.py Outdated Show resolved Hide resolved
@mruberry mruberry added module: complex Related to complex number support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels May 5, 2020
test/test_torch.py Outdated Show resolved Hide resolved
test/test_torch.py Outdated Show resolved Hide resolved
@anjali411
Copy link
Contributor

@kshitij12345 any updates?

@kshitij12345
Copy link
Collaborator Author

@kshitij12345 any updates?

Hi,
Apologies for the delayed response.
Will address the comments before Saturday.

@kshitij12345 kshitij12345 force-pushed the support/complex/flip-rot90 branch 2 times, most recently from 0de9bb7 to db22d61 Compare May 8, 2020 19:12
@kshitij12345 kshitij12345 requested review from anjali411 and mruberry May 8, 2020 21:36
test/test_torch.py Outdated Show resolved Hide resolved
@mruberry mruberry self-requested a review May 10, 2020 10:53
Copy link
Collaborator

@mruberry mruberry 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 but a few questions/suggestions.

@kshitij12345
Copy link
Collaborator Author

@pytorchbot retest this please!

@kshitij12345 kshitij12345 force-pushed the support/complex/flip-rot90 branch 2 times, most recently from c755485 to 1e0623b Compare May 14, 2020 16:37
@kshitij12345
Copy link
Collaborator Author

@mruberry @anjali411 PTAL:)

test/test_torch.py Outdated Show resolved Hide resolved
@mruberry mruberry self-requested a review May 15, 2020 22:10
tensor_op_tests compare device result with cpu result.
So there is no point in having dtypes for CPU to compare
against itself.
* add `rtol=0` in assertEqual call.
@kshitij12345 kshitij12345 force-pushed the support/complex/flip-rot90 branch from b01d217 to de42c5d Compare May 28, 2020 21:12
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@mruberry
Copy link
Collaborator

The Vander test failures are real:

May 29 01:19:45 ======================================================================
May 29 01:19:45 ERROR [0.037s]: test_vander_complex_types_cuda_complex128 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11931, in test_vander_complex_types
May 29 01:19:45     pt_res = torch.vander(pt_x, increasing=inc) if n is None else torch.vander(pt_x, n, inc)
May 29 01:19:45 RuntimeError: "cumprod_cuda" not implemented for 'ComplexDouble'
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 ERROR [0.038s]: test_vander_complex_types_cuda_complex64 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11931, in test_vander_complex_types
May 29 01:19:45     pt_res = torch.vander(pt_x, increasing=inc) if n is None else torch.vander(pt_x, n, inc)
May 29 01:19:45 RuntimeError: "cumprod_cuda" not implemented for 'ComplexFloat'
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_bool (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_float32 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_float64 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.032s]: test_vander_types_cuda_int16 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_int32 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.032s]: test_vander_types_cuda_int64 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_int8 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ======================================================================
May 29 01:19:45 FAIL [0.031s]: test_vander_types_cuda_uint8 (__main__.TestTorchDeviceTypeCUDA)
May 29 01:19:45 ----------------------------------------------------------------------
May 29 01:19:45 Traceback (most recent call last):
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 798, in wrapper
May 29 01:19:45     method(*args, **kwargs)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 234, in instantiated_test
May 29 01:19:45     result = test(self, device_arg, dtype)
May 29 01:19:45   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 501, in only_fn
May 29 01:19:45     return fn(self, device, *args, **kwargs)
May 29 01:19:45   File "test_torch.py", line 11903, in test_vander_types
May 29 01:19:45     else torch.vander(pt_x, n, inc)
May 29 01:19:45 AssertionError: RuntimeError not raised
May 29 01:19:45 
May 29 01:19:45 ----------------------------------------------------------------------

test/test_torch.py Outdated Show resolved Hide resolved
@kshitij12345
Copy link
Collaborator Author

kshitij12345 commented May 29, 2020

@mruberry
I think we should wait for #39063 to land, as it will add complex support for cumprod which would break the vander test (with Runtime Error not raised).

Instead we should rebase with the master once it is in and test the CUDA as well.

@mruberry
Copy link
Collaborator

@mruberry
I think we should wait for #39063 to land, as it will add complex support for cumsum which would break the vander test (with Runtime Error not raised).

Instead we should rebase with the master once it is in and test the CUDA as well.

Sounds good to me! Please re-request review when that happens.

@kshitij12345 kshitij12345 requested a review from mruberry May 29, 2020 20:01
@kshitij12345
Copy link
Collaborator Author

@mruberry

  • Have merged with the latest master thus vander now supports complex on CUDA.
  • Have merged the complex vander test with the existing one.

Do review. Thanks.

Copy link
Collaborator

@mruberry mruberry left a comment

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@kshitij12345
Copy link
Collaborator Author

@mruberry Gentle ping

@mruberry
Copy link
Collaborator

mruberry commented Jun 2, 2020

@mruberry Gentle ping

Thanks @kshitij12345, internal tests looked good. I'll start landing now.

@mruberry
Copy link
Collaborator

mruberry commented Jun 2, 2020

Diff is landed and tests are now running on OSS Master to validate.

@facebook-github-bot
Copy link
Contributor

@mruberry merged this pull request in 09bea13.

@mruberry
Copy link
Collaborator

mruberry commented Jun 3, 2020

Awesome! OSS Master validation tests look good.

@kshitij12345 kshitij12345 deleted the support/complex/flip-rot90 branch June 3, 2020 05:13
@kshitij12345
Copy link
Collaborator Author

Great! Thanks.

Will rebase #38599 and add tests.
Will ping you once ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: complex Related to complex number support in PyTorch 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.

Implement torch.flip for complex numbers
5 participants