Move sum to the GPU more frequently, and fix crashes

The crashes are:
1) recently added about compilation of shape_i on the new and old gpu back-end
2) in the new gpu back-end with GpuSplit optimization.
3) fix crash of rebroadcast compilation on the new back-end.
4) fix crash in new back-end opt for careduce.