Port math kernel for layer_norm from pytorch/xla. (#47882)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47882
Test Plan: Imported from OSS
Reviewed By: ezyang
Differential Revision: D24958691
Pulled By: ailzhang
fbshipit-source-id: 694e22c20a365730fbacf94efa1bdf7fdd7aec20