perf-sequence-packing

Configure PackedSequenceSpecs for sequence packing in model training.

852|445|Updated May 21, 2025
One-click install
npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill perf-sequence-packing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-sequence-packing
Source: https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/skills/perf-sequence-packing
Command: npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill perf-sequence-packing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill enables the validation and application of sequence packing techniques to improve training efficiency and long-context handling in large language models.

Core Features & Use Cases

  • Enables offline packed SFT for LLM fine-tuning by configuring packed sequence specifications for stable training with extended context lengths.
  • Supports in-batch packing for vision-language model fine-tuning, facilitating improved training throughput.
  • Use Case: Adjust sequence lengths and packing parameters to enable longer context training or optimize memory usage during model finetuning for production environments.

Quick Start

Configure your training setup to use PackedSequenceSpecs for sequence length and packing specifications, then run the training process with these parameters to improve efficiency and handle long context sequences.

Frequently Asked Questions about perf-sequence-packing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use sequence packing to improve large language model training efficiency?

Sequence packing improves large language model training efficiency by configuring PackedSequenceSpecs to consolidate sequences, optimizing memory usage and extending context length during fine-tuning.

What is offline packed SFT and when do I need it for LLM fine-tuning?

Offline packed SFT is a large language model fine-tuning technique that packs sequences offline to ensure stable training with extended context lengths. You need it when adjusting sequence lengths for longer context training.

Can I apply in-batch packing for vision-language model fine-tuning?

Yes, in-batch packing is supported for vision-language model fine-tuning to facilitate improved training throughput. It adjusts packing parameters to optimize memory usage during production environment training.

How do I configure PackedSequenceSpecs for long-context training?

To configure PackedSequenceSpecs for long-context training, set sequence length and packing specifications in the training setup, then run the training process with these parameters to handle long context sequences efficiently.

Does sequence packing work for both large language models and vision-language models?

Yes, sequence packing works for both large language models and vision-language models. It facilitates offline packed SFT for LLMs and in-batch packing for vision-language models to improve training throughput and memory efficiency.