-
Notifications
You must be signed in to change notification settings - Fork 104
Add decomposition for aten.native_layer_norm_backward op. #525
Add decomposition for aten.native_layer_norm_backward op. #525
Conversation
|
Hi @gprateek93! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
7d52c15 to
3c9af2a
Compare
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good to me! A couple minor notes, and I'd like to wait for the CI to pass first.
|
Tests look good, just fix the flake8 issues (and the other comments and we're good to go!) |
|
Oh actually, I realized our decomposition tests are currently skipped due to an issue with upstream, I'll test it out locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it doesn't seem like it passes testing.
To test your decompositions, comment out https://github.com/pytorch/functorch/blob/main/test/test_ops.py#L973 and run
pytest test/test_ops.py::TestDecompositionOpInfoCPU -k layer_norm
I will check and make necessary changes. Thanks! |
|
@Chillee Even after removing my commit, the test is failing. I am assuming the error is due to the decomposition of |
|
@gprateek93 What's the error you see? There was a minor precision issue I just fixed. The error I ran into with the decomposition though seemed more like a logical error |
3c9af2a to
f490792
Compare
Hi @Chillee, On commenting the line you mentioned, I am not getting any error in the code. But I may have got the logical bug. I am not able to verify with test. Can you check once? |
8186ee0 to
49e5889
Compare
|
@gprateek93 Why are you unable to run the tests? Like, what happens when you try running them? If the decomposition passes you should see something like When I run the decompositions with the newest commit in the PR there are still some test failures |
So I am able to run the test, but I am getting all passed. The command I am running is : |
|
@gprateek93 Are you sure the decompositions are being run? Can you try changing it to something obviously wrong and see if it fails? I'm not sure how you installed functorch, but perhaps if you installed it with pip you might need to reinstall it before your python changes will get picked up. Otherwise, to install it in "development" mode, you can do |
|
@Chillee I am able to get the failures now, But I am not sure why they are failing. I have tried to create one of the test cases below in google colab and ran it with both torch op and my decomposition, and the results are fairly equal. Could it be some kind of precision issue? |
|
@gprateek93 For the original PR, no, since the absolute value diff on that is > 2. For the updated version in your gist, one of the errors might be an unavoidable precision issue. The other one seems to be an actual failure though. I updated the main branch to output the failing arguments in an error. |
Thank you for the updated test support. I can now view which argument is failing, I am working on this. |
fb5480c to
dc1e517
Compare
|
@Chillee apart from the precision issue, other test cases get passed in this current revision. |
dc1e517 to
32b7fc6
Compare
a4f6585 to
4514786
Compare
2b33998 to
01ac08a
Compare
Signed-Off-By: Prateek Gupta <prateek@nod-labs.com>
01ac08a to
ff0ae21
Compare
…pytorch/functorch#525) Signed-Off-By: Prateek Gupta <prateek@nod-labs.com>
…pytorch/functorch#525) Signed-Off-By: Prateek Gupta <prateek@nod-labs.com>
Signed-Off-By: Prateek Gupta prateek@nod-labs.com