QuestionQ50

Core Machine Learning and AI Knowledge

Suppose you are training an LLM with billions of parameters, and the training dataset is considerably larger than the RAM available on your system. Which of the following is an alternative?

  • A Using the GPU memory to extend the RAM capacity for storing the dataset and move the dataset in and out of the GPU, using the PCI bandwidth possibly.
  • B Using a memory-mapped file that allows the library to access and operate on elements of the dataset without needing to fully load it into memory.
  • C Discarding the excess of data and pruning the dataset to the capacity of the RAM, resulting in reduced latency during inference.
  • D Eliminating sentences that are syntactically different by semantically equivalent, possibly reducing the risk of the model hallucinating as it is trained to get to the point.
Explanation

A memory-mapped file enables file-backed dataset access without fully loading the dataset into RAM. Required portions can be accessed as needed while the operating system manages paging. Python’s official mmap documentation describes mapped files as objects that support file-like access and seeking through the file.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!