KEMBAR78
[testing] add `broadcasts_input` and verifies the behaviour for inplace_variant. by kshitij12345 · Pull Request #55771 · pytorch/pytorch · GitHub
Skip to content

Conversation

@kshitij12345
Copy link
Collaborator

Fixes #55595

  • Add broadcasts_input attribute to SampleInput
  • Update test_variant_consistency_eager to verify that sample with broadcasts_input==True and inplace variant raises an error.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Apr 12, 2021

💊 CI failures summary and remediations

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


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

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 to the (internal) Dr. CI Users group.

@kshitij12345 kshitij12345 requested a review from mruberry April 12, 2021 05:51
cloned = clone_input_helper(sample.input) if variant in inplace_ops else sample.input

if variant in inplace_ops and sample.broadcasts_input:
with self.assertRaises(RuntimeError):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Received two different error messages, so haven't used assertRaisesRegex.

Message 1:

expand(CUDABoolType{[5, 5]}, size=[5]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)

Message 2:

output with shape [5, 5] doesn't match the broadcast shape [5, 5, 5]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not using assertRaisesRegex sounds good

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #55771 (59f1df7) into master (09c0bb4) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 59f1df7 differs from pull request most recent head 0bb8bbb. Consider uploading reports for the commit 0bb8bbb to get more accurate results

@@            Coverage Diff             @@
##           master   #55771      +/-   ##
==========================================
+ Coverage   77.13%   77.25%   +0.11%     
==========================================
  Files        1912     1896      -16     
  Lines      189312   187966    -1346     
==========================================
- Hits       146024   145209     -815     
+ Misses      43288    42757     -531     

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.

Cool! This might pick up a merge conflict. When it's about to be landed (after the internal CI and approval process) I'll ping so we can update it (if needed) and then land it immediately.

@facebook-github-bot
Copy link
Contributor

@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 updated. Have tested locally. Lets wait for the CI to pass.

@facebook-github-bot
Copy link
Contributor

@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 6350fce.

krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
…ce_variant. (pytorch#55771)

Summary:
Fixes pytorch#55595

* Add `broadcasts_input` attribute to SampleInput
* Update test_variant_consistency_eager to verify that sample with `broadcasts_input==True` and inplace variant raises an error.

Pull Request resolved: pytorch#55771

Reviewed By: jbschlosser, ngimel

Differential Revision: D27760530

Pulled By: mruberry

fbshipit-source-id: feb0658730d4cff483848a5ade9512837a65c24c
facebook-github-bot pushed a commit that referenced this pull request Jul 16, 2021
…xed before (#61579)

Summary:
This PR:

1. Removes `test_out` skip: it's not needed anymore after it was fixed in #55746. This should also close #55589.
2. Removes `test_variant_consistency_eager` skip, it was added by mistake in #55771.
3. Refines `sample_inputs_addmv` function, the updated function should now be cleaner and easy to read.

cc: mruberry

Pull Request resolved: #61579

Reviewed By: gchanan

Differential Revision: D29709674

Pulled By: mruberry

fbshipit-source-id: 9b975c024777efdd33c6b9444b0b36e0eab85c03
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.

Verify that attempting to resize a tensor with an inplace operation throws a runtime error

4 participants