There is no option to do this natively in the Trainer, you can either make a source install and change the line that creates the training dataloader, or subclass Trainer and override the get_train_dataloader method.
For the reference, the way to go was to switch train sampler. E.g. this worked for me for SFTTrainer, should be the same for vanilla Trainer. You inherit from initial class and then use your new redefined one.
from torch.utils.data import SequentialSampler
from trl import SFTTrainer
class SFTTrainer2(SFTTrainer):
def _get_train_sampler(self):
return SequentialSampler(self.train_dataset)