I could reproduce this issue on my system with CUDA9.0.
I also debugged a little bit and found that the GPU outputs a constant value after 2097152 input values, which is exactly 2**21.
print(gpu_results[2**21:].shape)
> torch.Size([1777991, 1])
print(gpu_results[2**21:].unique())
> tensor([0.5127], device='cuda:0', grad_fn=<NotImplemented>)

I’m not sure, what’s going on, but maybe @ngimel might know some limitation regarding this magic number and CUDA9.