@@ -32,6 +32,8 @@ Plugin is an important component that manages parallel configuration (eg: The ge
More details about usages of each plugin can be found in chapter [Booster Plugins](./booster_plugins.md).
Some plugins support lazy initialization, which can be used to save memory when initializating large models. For more details, please see [Lazy Initialization](../features/lazy_init.md).
Lazy initialization defers model initialization. It saves memory when initializing large models.
If your model has `N` billion parameters and your memory (or GPU memory) is `M` GB, we recommend you use lazy initialization when `4N >= M`. Otherwise, it is optional.
> ⚠️ Lazy initialization from pretrained is supported for colossalai>0.3.3 or main branch.
## Limitations
As we claimed, lazy initialization must be used with booster. And only several plugins support it.
| Plugin | Supported | Remarks |
|-----------------|-----------|--------------|
| Gemini | Yes | |
| Hybrid Parallel | Yes | |
| Low Level Zero | No | No need |
| Torch DDP | No | Incompatible |
| Torch FSDP | No | Incompatible |
Not all models can be lazily initialized. In some cases, a part of parameters/buffers may be early initialized. But don't worry, this part usually takes a small proportion of the whole model.
And some models are not supported at all which will raise an error. We tested models in torchvision, diffusers, timm, transformers, torchaudio and torchrec. Below models are not supported: