device_reduce working