Skip to content

Disables complex floor, ceil, trunc (to be compatible with NumPy)#35592

Closed
mruberry wants to merge 3 commits intomasterfrom
complex_ceil_trunc_floor
Closed

Disables complex floor, ceil, trunc (to be compatible with NumPy)#35592
mruberry wants to merge 3 commits intomasterfrom
complex_ceil_trunc_floor

Conversation

@mruberry
Copy link
Collaborator

@mruberry mruberry commented Mar 28, 2020

NumPy doesn't allow complex inputs to floor, ceil, or trunc, and without careful deliberation I don't think PyTorch should, either: is it intuitive that these functions apply to both the real and imaginary parts of complex tensors, or only to the real parts?

This PR disables these functions for complex inputs so we don't prematurely commit a particular behavior.

@dr-ci
Copy link

dr-ci bot commented Mar 28, 2020

💊 CircleCI build failures summary and remediations

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


  • 1/3 failures introduced in this PR

  • 1/3 tentatively recognized as flaky ❄️

  • 1/3 broken upstream at merge base c672a73 since Mar 27

    Please rebase on the viable/strict branch (expand for instructions)

    If your commit is newer than viable/strict, you can try basing on an older, stable commit:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase --onto FETCH_HEAD $(git merge-base origin/master HEAD)
    

    If your commit is older than viable/strict:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase FETCH_HEAD
    

    Check out the recency history of this "viable master" tracking branch.


🕵️ 1 new failure recognized by patterns

The following build failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_xla_linux_xenial_py3_6_clang7_build (1/1)

Step: "Build" (full log | pattern match details)

Mar 28 04:21:03 caused by: Connection refused (os error 111)
Mar 28 04:21:03 +++ eval 'extract_trap_cmd ' 
Mar 28 04:21:03 ++++ extract_trap_cmd 
Mar 28 04:21:03 ++++ printf '%s\n' '' 
Mar 28 04:21:03 +++ printf '%s\n' cleanup 
Mar 28 04:21:03 ++ trap -- ' 
Mar 28 04:21:03 cleanup' EXIT 
Mar 28 04:21:03 ++ which sccache 
Mar 28 04:21:03 ++ sccache --stop-server 
Mar 28 04:21:03 Stopping sccache server... 
Mar 28 04:21:03 error: couldn't connect to server 
Mar 28 04:21:03 caused by: Connection refused (os error 111) 
Mar 28 04:21:03 ++ true 
Mar 28 04:21:03 ++ rm /var/lib/jenkins/sccache_error.log 
Mar 28 04:21:03 rm: cannot remove '/var/lib/jenkins/sccache_error.log': No such file or directory 
Mar 28 04:21:03 ++ true 
Mar 28 04:21:03 ++ SCCACHE_ERROR_LOG=/var/lib/jenkins/sccache_error.log 
Mar 28 04:21:03 ++ SCCACHE_IDLE_TIMEOUT=1200 
Mar 28 04:21:03 ++ RUST_LOG=sccache::server=error 
Mar 28 04:21:03 ++ sccache --start-server 
Mar 28 04:21:03 Starting sccache server... 
Mar 28 04:21:03 ++ sccache --zero-stats 

❄️ 1 tentatively flaky failure

1 failure tentatively classified as flaky but have not triggered reruns to confirm:

See CircleCI build pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test (1/1)

Step: "Test" (full log | pattern match details) ❄️

Mar 28 06:44:41 AssertionError: 11 not less than or equal to 1e-05 :
Mar 28 06:44:41 ---------------------------------------------------------------------- 
Mar 28 06:44:41 Traceback (most recent call last): 
Mar 28 06:44:41   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_distributed.py", line 175, in wrapper 
Mar 28 06:44:41     self._join_processes(fn) 
Mar 28 06:44:41   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_distributed.py", line 285, in _join_processes 
Mar 28 06:44:41     self._check_return_codes(elapsed_time) 
Mar 28 06:44:41   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_distributed.py", line 324, in _check_return_codes 
Mar 28 06:44:41     self.assertEqual(p.exitcode, first_process.exitcode) 
Mar 28 06:44:41   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 915, in assertEqual 
Mar 28 06:44:41     super(TestCase, self).assertLessEqual(abs(x - y), prec, message) 
Mar 28 06:44:41 AssertionError: 11 not less than or equal to 1e-05 :  
Mar 28 06:44:41  
Mar 28 06:44:41 ---------------------------------------------------------------------- 
Mar 28 06:44:41 Ran 62 tests in 67.074s 
Mar 28 06:44:41  
Mar 28 06:44:41 FAILED (failures=1, skipped=2) 
Mar 28 06:44:41  
Mar 28 06:44:41 Generating XML reports... 
Mar 28 06:44:41 Generated XML report: test-reports/dist-gloo/TEST-DistAutogradTestWithSpawn-20200328064334.xml 
Mar 28 06:44:41 Traceback (most recent call last): 
Mar 28 06:44:41   File "test/run_test.py", line 682, in <module> 

🚧 1 upstream failure:

These were probably caused by upstream breakages:


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.

See how this bot performed.

This comment has been revised 3 times.

@mruberry mruberry changed the title Disables complex floor, ceil, trunc (to be compatible with NumPy) [WIP] Disables complex floor, ceil, trunc (to be compatible with NumPy) Mar 28, 2020
@mruberry mruberry changed the title [WIP] Disables complex floor, ceil, trunc (to be compatible with NumPy) Disables complex floor, ceil, trunc (to be compatible with NumPy) Mar 29, 2020
@mruberry mruberry requested a review from gchanan March 29, 2020 07:38
@mruberry mruberry requested a review from anjali411 March 29, 2020 07:59
@mruberry mruberry added module: numpy Related to numpy support, and also numpy compatibility of our operators module: complex Related to complex number support in PyTorch labels Mar 29, 2020
Copy link
Contributor

@anjali411 anjali411 left a comment

Choose a reason for hiding this comment

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

yup agreed! LGTM thank you for fixing this :D

@gchanan
Copy link
Contributor

gchanan commented Mar 30, 2020

if we support writable imag/real for complex you can just call:

torch.real.floor(...)
torch.imag.floor_(...)

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.

@facebook-github-bot
Copy link
Contributor

@mruberry merged this pull request in d2343be.

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 module: numpy Related to numpy support, and also numpy compatibility of our operators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants