Enhancing Training Efficiency Using Packing with Flash Attention

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Kundu, Achintya, Lee, Rhui Dih, Wynter, Laura, Ganti, Raghu Kiran, Mishra, Mayank
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916376766054400
author Kundu, Achintya
Lee, Rhui Dih
Wynter, Laura
Ganti, Raghu Kiran
Mishra, Mayank
author_facet Kundu, Achintya
Lee, Rhui Dih
Wynter, Laura
Ganti, Raghu Kiran
Mishra, Mayank
contents Padding is often used in tuning LLM models by adding special tokens to shorter training examples to match the length of the longest sequence in each batch. While this ensures uniformity for batch processing, it introduces inefficiencies by including irrelevant padding tokens in the computation and wastes GPU resources. Hugging Face SFT trainer has always offered the option to use packing to combine multiple training examples, allowing for maximal utilization of GPU resources. However, up till now, it did not offer proper masking of each packed training example. This capability has been added to Hugging Face Transformers 4.44. We analyse this new feature and show the benefits across different variations of packing.
format Preprint
id arxiv_https___arxiv_org_abs_2407_09105
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Enhancing Training Efficiency Using Packing with Flash Attention
Kundu, Achintya
Lee, Rhui Dih
Wynter, Laura
Ganti, Raghu Kiran
Mishra, Mayank
Machine Learning
Artificial Intelligence
Padding is often used in tuning LLM models by adding special tokens to shorter training examples to match the length of the longest sequence in each batch. While this ensures uniformity for batch processing, it introduces inefficiencies by including irrelevant padding tokens in the computation and wastes GPU resources. Hugging Face SFT trainer has always offered the option to use packing to combine multiple training examples, allowing for maximal utilization of GPU resources. However, up till now, it did not offer proper masking of each packed training example. This capability has been added to Hugging Face Transformers 4.44. We analyse this new feature and show the benefits across different variations of packing.
title Enhancing Training Efficiency Using Packing with Flash Attention
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2407.09105