Skip to content

Add complex autograd support and OpInfo based test for torch.addr#50667

Closed
anjali411 wants to merge 6 commits intogh/anjali411/85/basefrom
gh/anjali411/85/head
Closed

Add complex autograd support and OpInfo based test for torch.addr#50667
anjali411 wants to merge 6 commits intogh/anjali411/85/basefrom
gh/anjali411/85/head

Conversation

@anjali411
Copy link
Copy Markdown
Contributor

@anjali411 anjali411 commented Jan 17, 2021

Stack from ghstack:

Differential Revision: D25957584

anjali411 added a commit that referenced this pull request Jan 17, 2021
@anjali411 anjali411 requested a review from mruberry January 17, 2021 19:26
@mruberry
Copy link
Copy Markdown
Collaborator

mruberry commented Jan 18, 2021

Two builds are failing because of test_variant_consistency_jit_addr_cuda_bfloat16 with

RuntimeError: at::cuda::blas::gemv: not implemented for N3c108BFloat16E

@zasdfgbnm @ngimel we have a sip to recommend for this, right? Maybe we should think about giving that skip a clearer name so it's easier to read and discover.

Update: actually, nevermind. We should fix this in that test and not bother with a more precise skip. @anjali411, would you just add this dtype to the skip list?

OpInfo('addr',
dtypes=all_types_and_complex_and(torch.bool, torch.bfloat16, torch.float16),
skips=(
SkipInfo('TestCommon', 'test_variant_consistency_jit',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bfloat16 CUDA skip just needs to be added

Copy link
Copy Markdown
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.

Just need to skip the one failing test.

Edit: oops, one other thing. The existing method_test entries should be incorporated into addr's sample inputs and removed from method_tests:

('addr', (S, M), ((S,), (M,)),),

@mruberry mruberry self-requested a review January 18, 2021 05:10
@anjali411 anjali411 changed the title Add complex autograd support and OfInfo based test for torch.addr Add complex autograd support and OpInfo based test for torch.addr Jan 18, 2021
@anjali411
Copy link
Copy Markdown
Contributor Author

anjali411 commented Jan 18, 2021

Just need to skip the one failing test.

Edit: oops, one other thing. The existing method_test entries should be incorporated into addr's sample inputs and removed from method_tests:

('addr', (S, M), ((S,), (M,)),),

are you suggesting to add the sample inputs to test broadcasting in the torch.addr OpInfo based test and skip est_inplace_grad and test_variant_consistency_eager for all dtypes?

I didn't delete the method_test entry because I didn't add broadcasting tests in the new OpInfo based test. I also saw that torch.addmm method_tests haven't been removed yet even though a new OpInfo based test (which does not test broadcasting, as tested in method_tests) has been added for it.

@mruberry
Copy link
Copy Markdown
Collaborator

are you suggesting to add the sample inputs to test broadcasting in the torch.addr OpInfo based test and skip test_inplace_grad and test_variant_consistency_eager for all dtypes?

Yes.

I didn't delete the method_test entry because I didn't add broadcasting tests in the new OpInfo based test. I also saw that torch.addmm method_tests haven't been removed yet even though a new OpInfo based test (which does not test broadcasting, as tested in method_tests) has been added for it.

That makes sense, but I think it's OK to move and skip in this case. We don't need to update addmm here.

anjali411 added a commit that referenced this pull request Jan 19, 2021
anjali411 added a commit that referenced this pull request Jan 19, 2021
anjali411 added a commit that referenced this pull request Jan 20, 2021
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@anjali411 merged this pull request in 1cc8f8a.

@facebook-github-bot facebook-github-bot deleted the gh/anjali411/85/head branch January 24, 2021 15:21
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…torch#50667)

Summary: Pull Request resolved: pytorch#50667

Test Plan: Imported from OSS

Reviewed By: pbelevich

Differential Revision: D25957584

Pulled By: anjali411

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

3 participants