The easiest way would be to just iterate over subepochs and break after the number of iterations you want.
for e in range(num_epochs):
  it = 0
  while it < num_it:
    for batch in data_loader:
      it += 1
      if it >= num_it:
        break
      ....

It’s a tad verbose, but in the end at 5 additional lines of code, you might pretend it’s an enlightenment of the “explicit is better than implicit” variety.
As you note, the proper abstraction to tie into would be the DataLoader. Thus, the perhaps more sophisticated technique is to write your own variation of RandomSampler to pass to the dataloader. This should be simple enough, too, you just need to return an iter over a few distinct randperms in __iter__, similar to what RandomSampler does.
Best regards
Thomas