The default for DDP is to use allreduce and average the gradients using the world size. You can choose to allreduce the gradients yourself as specify the reduction op yourself, but in this case you lose out on the better perf of DDP and allreduce will still not accept a custom UDF for the reduction op (though you can use the SUM op and average gradients however you want).
On a slightly different note, the DDP join 2 API can help you better handle uneven inputs across ranks.