Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PYTORCH]LayerNorm support added #5249

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

siju-samuel
Copy link
Member

@masahi please help to review this PR. TIA

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

@masahi masahi merged commit 0cc2661 into apache:master Apr 6, 2020
@masahi
Copy link
Member

masahi commented Apr 6, 2020

Thanks @siju-samuel. I've just met a model with layer norm yesterday, this is immediately useful to me :)

return _op.nn.layer_norm(data,
gamma=inputs[1],
beta=inputs[2],
axis=-1,
Copy link
Member

Choose a reason for hiding this comment

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

it seems gamma is inputs[2] and beta is inputs[3]. @siju-samuel Can you confirm?
I get an error using this new conversion in my test. Above change fixed it.

Copy link
Member Author

@siju-samuel siju-samuel Apr 7, 2020

Choose a reason for hiding this comment

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

@masahi Thanks a lot for pointing it out. Along with changing the inputs, need to update the center and scale flags to True. My testcase i was not initializing weights and thus it couldnt capure this mistake. #5257 will fix.

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Apr 17, 2020
dpankratz pushed a commit to dpankratz/incubator-tvm that referenced this pull request Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants