DeepSpeed is an open-source deep learning optimization library for reducing compute and memory use during distributed training and inference. It supports PyTorch and integrates with Transformers and Accelerate, helping larger Transformer models fit on one GPU or a cluster. section 4.3.4
Its main optimization mechanisms include:
- ZeRO, mixed-precision training, custom model parallelism, and inference-specific kernels. section 4.3.4
- Automatic model partitioning, kernel injection, and inter-GPU communication management in inference mode. section 4.3.4
- An 18% reduction in GPT-Neo inference latency compared with a baseline implementation. section 4.4
GPT-Neo inference
A notebook initializes distributed settings, loads GPT-Neo 2.7B in float16, wraps it with deepspeed.init_inference, and generates text on a CUDA device. The example reports lower average and P95 latency than the vanilla model. section 4.3.4

