Your current code cannot be build using a recent source build and fails with:
/workspace/src/nativefunctions/native.cpp:39:66: error: could not convert ‘mean’ from ‘const at::Tensor’ to ‘c10::IntArrayRef’ {aka ‘c10::ArrayRef<long int>’}
   39 |     return at::native::layer_norm_backward_cuda(grad_out, input, mean, rstd, weight, M, N, output_mask);
      |                                                                  ^~~~
      |                                                                  |
      |                                                                  const at::Tensor

EDIT: it seems the IntArrayRef normalized_shape input is missing as seen here 2.