only sum sample_weight once