Skip to content
IJK

The Meta Device: Creating Large Tensors Without RAM

By IJK ·

What a Hugging Face post says very large models cannot do on most consumer hardware, what PyTorch 1.9 introduced and what the meta device allows.

The problem

Meta AI and BigScience recently open-sourced very large language models which won't fit into memory (RAM or GPU) of most consumer hardware. [1]

What PyTorch 1.9 introduced

PyTorch 1.9 introduced a new kind of device called the meta device. [2]

addressed byallowsVery large models won't fit into memoryRAM or GPU of most consumer hardwareThe meta deviceintroduced by PyTorch 1.9Arbitrarily large tensorscreated without worrying about CPU or GPU RAM
What does the meta device change?

What it allows

As long as you are on the meta device, you can thus create arbitrarily large tensors without having to worry about CPU (or GPU) RAM. [3]

Sources

  1. The Hugging Face source says: Meta AI and BigScience recently open-sourced very large language models which won't fit into memory (RAM or GPU) of most consumer hardware. How Accelerate runs very large models thanks to PyTorch
  2. The Hugging Face source says: PyTorch 1.9 introduced a new kind of device called the meta device. How Accelerate runs very large models thanks to PyTorch
  3. The Hugging Face source says: As long as you are on the meta device, you can thus create arbitrarily large tensors without having to worry about CPU (or GPU) RAM. How Accelerate runs very large models thanks to PyTorch

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • pytorch
  • accelerate
  • large models
  • hugging face