reduction='mean' will also average over lengths, so by using reduction='sum' or reduction='none' and taking the mean only over the batch dimension, you’ll get a higher gradient.
That said, for Adam, it should cancel with the implied gradient weighting, and for SGD you could use a higher learning rate, too.
Best regards
Thomas