Texonom
Texonom
/
Science
Science
/Mathematics/Math Field/Statistics/Statistical Model/Model Generalization/Model Training/Batching/
Sequence Packing
Loading views...
Search

Sequence Packing

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2026 Nov 5 10:45
Editor
Editor
Seonglae ChoSeonglae Cho
Edited
Edited
2026 Nov 5 12:40
Refs
Refs
길이가 다른 샘플 여러 개를 최대 길이 하나에 이어 붙여 padding 낭비를 없애는 방식
 
 
 
 
arxiv.org
https://arxiv.org/pdf/2107.02027
Enhancing Training Efficiency Using Packing with Flash Attention
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 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 now been added to Hugging Face Transformers 4.44. We analyse this new feature and show the benefits across different variations of packing.
Enhancing Training Efficiency Using Packing with Flash Attention
https://arxiv.org/html/2407.09105v6
 

Backlinks

Continuous Batching

Recommendations

Texonom
Texonom
/
Science
Science
/Mathematics/Math Field/Statistics/Statistical Model/Model Generalization/Model Training/Batching/
Sequence Packing
Copyright Seonglae Cho·Graph·