Skip to content

Conversation

@ailzhang
Copy link
Contributor

Fixes #21406

@ailzhang ailzhang requested a review from wanchaol July 26, 2019 16:03
@pytorchbot pytorchbot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jul 26, 2019
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.

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

grad_other = AD_matmul_special_fold(grad_output, self, self_size)
grad_other = grad_other.squeeze(-1)
elif dim1 >= 3 and dim2 == 2:
grad_other = AD_matmul_special_fold(grad_output, self, self_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we put those two cases into AD_matmul_size? That way the grad_self part might benefit from the optimization too. Also, can you please describe why would this decrease memory usage?

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.

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

Copy link
Collaborator

@wanchaol wanchaol left a comment

Choose a reason for hiding this comment

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

Looks good, can you add AD checks to common_method_invocations to check if the nodes in the if-else branches is there?

@ailzhang
Copy link
Contributor Author

FYI https://github.com/pytorch/pytorch/blob/master/test/common_methods_invocations.py#L477-L478 already covers tests for these if-else branches. We should be good as long as that passes.

@wanchaol
Copy link
Collaborator

FYI https://github.com/pytorch/pytorch/blob/master/test/common_methods_invocations.py#L477-L478 already covers tests for these if-else branches. We should be good as long as that passes.

What I mean is that you can add node names to the (True, ) bucket to ensure the triggering of that if condition? Although I think it's fine as long as the result is consistent. BTW the CI failure seems legit to this PR

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.

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

@facebook-github-bot
Copy link
Contributor

@ailzhang merged this pull request in 4e59055.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

matmul in a ScriptModule requires much memory

6 participants