Skip to content

Conversation

@IvanYashchuk
Copy link
Collaborator

Description

In PyTorch, it's possible to pass unpacked shape to Tensor.view/reshape, and when this call is translated to use refs it caused an error.
Now refs.reshape and refs.view support passing variable arguments for the shape.

Testing

Added a simple test test_reshape_view_method that compares Tensor.reshape/view to torch._refs.reshape/view result.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Aug 2, 2022

🔗 Helpful links

❌ 2 New Failures, 1 Base Failures

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

Expand to see more
  • 2/3 failures introduced in this PR
  • 1/3 broken upstream at merge base b2bb225 on Aug 02 from 6:59am to 11:08am

🕵️ 2 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / win-vs2019-cpu-py3 / test (default, 1, 2, windows.4xlarge) (1/2)

Step: "Test" (full log | diagnosis details)

2022-08-02T16:12:07.8944796Z AssertionError: Th...functional.prelu on device type cpu are incorrect!
2022-08-02T16:12:07.8934310Z [gw2] [  1%] FAILED test_ops.py::TestCommonCPU::test_dtypes__refs_nn_functional_prelu_cpu 
2022-08-02T16:12:07.8934514Z 
2022-08-02T16:12:07.8934697Z ================================== FAILURES ===================================
2022-08-02T16:12:07.8935014Z ___________ TestCommonCPU.test_dtypes__refs_nn_functional_prelu_cpu ___________
2022-08-02T16:12:07.8935350Z [gw2] win32 -- Python 3.8.13 C:\Jenkins\Miniconda3\python.exe
2022-08-02T16:12:07.8935605Z Traceback (most recent call last):
2022-08-02T16:12:07.8943314Z   File "C:\actions-runner\_work\pytorch\pytorch\test\test_ops.py", line 1230, in test_dtypes
2022-08-02T16:12:07.8943816Z     self.fail(msg)
2022-08-02T16:12:07.8944139Z   File "C:\Jenkins\Miniconda3\lib\unittest\case.py", line 753, in fail
2022-08-02T16:12:07.8944460Z     raise self.failureException(msg)
2022-08-02T16:12:07.8944796Z AssertionError: The supported dtypes for _refs.nn.functional.prelu on device type cpu are incorrect!
2022-08-02T16:12:07.8945244Z The following dtypes did not work in forward but are listed by the OpInfo: {torch.bfloat16, torch.float64, torch.float32}.
2022-08-02T16:12:07.8945489Z 
2022-08-02T16:12:07.8945739Z - generated xml file: C:\actions-runner\_work\pytorch\pytorch\test\test-reports\python-pytest\test_ops\test_ops.xml -
2022-08-02T16:12:07.8946127Z =========================== short test summary info ===========================
2022-08-02T16:12:07.8946436Z FAILED test_ops.py::TestCommonCPU::test_dtypes__refs_nn_functional_prelu_cpu
2022-08-02T16:12:07.8946759Z !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!
2022-08-02T16:12:07.8947073Z !!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!
2022-08-02T16:12:07.8947381Z ======= 1 failed, 240 passed, 7 skipped, 42 warnings, 2 rerun in 20.68s =======
2022-08-02T16:12:08.5817752Z Traceback (most recent call last):
2022-08-02T16:12:08.5818159Z   File "run_test.py", line 974, in <module>

See GitHub Actions build pull / win-vs2019-cpu-py3 / test (default, 2, 2, windows.4xlarge) (2/2)

Step: "Test" (full log | diagnosis details)

2022-08-02T16:22:40.6576671Z RuntimeError: test_ops_gradients failed!
2022-08-02T16:22:39.9951298Z =========================== short test summary info ===========================
2022-08-02T16:22:39.9951661Z FAILED test_ops_gradients.py::TestGradientsCPU::test_fn_fwgrad_bwgrad_nn_functional_prelu_cpu_float64
2022-08-02T16:22:39.9952001Z !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!
2022-08-02T16:22:39.9952305Z !!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!
2022-08-02T16:22:39.9952620Z = 1 failed, 321 passed, 1001 skipped, 7 xfailed, 49 warnings, 2 rerun in 52.71s =
2022-08-02T16:22:40.6575263Z Traceback (most recent call last):
2022-08-02T16:22:40.6575703Z   File "run_test.py", line 974, in <module>
2022-08-02T16:22:40.6575937Z     main()
2022-08-02T16:22:40.6576157Z   File "run_test.py", line 952, in main
2022-08-02T16:22:40.6576433Z     raise RuntimeError(err_message)
2022-08-02T16:22:40.6576671Z RuntimeError: test_ops_gradients failed!
2022-08-02T16:22:40.9670476Z 
2022-08-02T16:22:40.9671094Z (base) C:\actions-runner\_work\pytorch\pytorch\test>if ERRORLEVEL 1 goto fail 
2022-08-02T16:22:40.9673053Z 
2022-08-02T16:22:40.9673406Z (base) C:\actions-runner\_work\pytorch\pytorch\test>exit /b 1 
2022-08-02T16:22:40.9735136Z ##[error]Process completed with exit code 1.
2022-08-02T16:22:40.9984898Z Prepare all required actions
2022-08-02T16:22:40.9985541Z Getting action download info
2022-08-02T16:22:41.1729714Z Download action repository 'nick-fields/retry@71062288b76e2b6214ebde0e673ce0de1755740a' (SHA:71062288b76e2b6214ebde0e673ce0de1755740a)
2022-08-02T16:22:41.4453765Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-08-02T16:22:41.4454003Z with:

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

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

If your commit is older than viable/strict, run these commands:

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

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Refusing to merge as mandatory check(s) pull failed for rule superuser
Raised by https://github.com/pytorch/pytorch/actions/runs/2784268309

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -f "windows failures are on trunk"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Hey @IvanYashchuk.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Aug 4, 2022
…82651)

Summary:
### Description
In PyTorch, it's possible to pass unpacked shape to Tensor.view/reshape, and when this call is translated to use refs it caused an error.
Now `refs.reshape` and `refs.view` support passing variable arguments for the shape.

### Testing
Added a simple test `test_reshape_view_method` that compares Tensor.reshape/view to torch._refs.reshape/view result.

Pull Request resolved: #82651
Approved by: https://github.com/ngimel

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/d693478789c724c6a74c6b28db236e01db97edf6

Reviewed By: kit1980

Differential Revision: D38395071

fbshipit-source-id: 78ed92ed925c07b781ce61919847aa3aec2488fd
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.

5 participants