How to load a huge single train data file efficiently in pytorch

I have a huge single data file, maybe 70G and each row in it is a sample. What should i do to load them in batch and using dataloader.
I do not have enough Mem to load all the data

Assuming you have enough RAM to load the dataset at once you can either load it with what library you would do it usually or you can load it once and save it as huge torch tensor (which might be faster for loading) and then load it via torch.load. Once you have the dataset loaded to your RAM you can simply index it.

but i do not have enough RAM to load all the file

Then you could create a dataloader. In which format is your data?

all the samples are in a single file, just like a txt file
each row in txt file is a training sample, totally one hundred million samples

You could do the things mentioned in this post inside your dataloader and then convert the loaded data to tensors. This should be quite straightforward and efficient.