I did some searches and, following this comment
https://github.com/pytorch/pytorch/issues/7680#issuecomment-390729076 17
I added __launch_bounds__(1024) before each custom kernel functions (those with __global__).
This solves the issue for my case.