Papers
arxiv:2410.19313

COAT: Compressing Optimizer states and Activation for Memory-Efficient FP8 Training

Published on Oct 25
· Submitted by Xihc20 on Oct 29
Authors:
,
,
,
,
,

Abstract

FP8 training has emerged as a promising method for improving training efficiency. Existing frameworks accelerate training by applying FP8 computation to linear layers while leaving optimizer states and activations in higher precision, which fails to fully optimize memory usage. This paper introduces COAT (Compressing Optimizer States and Activations for FP8 Training), a novel FP8 training framework designed to significantly reduce memory footprint when training large models. COAT addresses current limitations through two key innovations: (1) Dynamic Range Expansion, which aligns optimizer state distributions more closely with the FP8 representation range, thereby reducing quantization error, and (2) Mixed-Granularity Activation Quantization, which optimizes activation memory using a combination of per-tensor and per-group quantization strategies. Experiments demonstrate that COAT effectively reduces end-to-end training memory footprint by 1.54x compared to BF16 while achieving nearly lossless performance across various tasks, such as Large Language Model pretraining and fine-tuning and Vision Language Model training. COAT also achieves a 1.43x end-to-end training speedup compared to BF16, performing on par with or surpassing TransformerEngine's speedup. COAT enables efficient full-parameter training of large models on fewer GPUs, and facilitates doubling the batch size in distributed training settings, providing a practical solution for scaling large-scale model training. The code is available at https://github.com/NVlabs/COAT.

Community

Paper submitter

COAT (Compressing Optimizer States and Activations for FP8 Training) is a novel FP8 training framework designed to significantly reduce memory footprint when training large models. It effectively reduces end-to-end training memory footprint by 1.54x compared to BF16 while achieving nearly lossless performance. It also achieves a 1.43x end-to-end training speedup compared to BF16, performing on par with or surpassing TransformerEngine's speedup. COAT enables efficient full-parameter training of large models on fewer GPUs, and facilitates doubling the batch size in distributed training settings, providing a practical solution for scaling large-scale model training.

This is an automated message from the Librarian Bot. I found the following papers similar to this paper.

The following papers were recommended by the Semantic Scholar API

Please give a thumbs up to this comment if you found it helpful!

If you want recommendations for any Paper on Hugging Face checkout this Space

You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend

Wonderful work!
Curiosity about a detail in Table.2:

U is a unit to measure memory usage, where 1U = Batch Size × Sequence Length × Hidden Size × 2 bytes (for BF16)...RMSNorm is upcast to float32 in transformers implementation, so the memory usage of LayerNorm in BF16 is 4U.

Backward in RMSNorm relies on the input only, so only 2U activation is cached in float32 implementation?

·

Thank you for your question! You're correct about the memory usage calculation. Since the input is in float32 precision, it will also save the float32 tensor for backward pass. (https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py#L73)

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2410.19313 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2410.19313 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2410.19313 in a Space README.md to link it from this page.

Collections including this paper 3