Data Tutorials
July 15, 2026 · View on GitHub
Choose the tutorial that matches how your examples should reach the training loop:
| Workflow | Status and starting data | Tutorial | Runtime path |
|---|---|---|---|
Pretraining from Megatron .bin/.idx | Recommended; prepared token IDs | DCLM preprocessing | GPTDatasetConfig → Megatron Core dataset builder |
| Text SFT or PEFT directly from Hugging Face | Recommended for hosted chat/prompt-completion rows or local JSON/JSONL loaded through Hugging Face datasets | Hugging Face text-only | HFDatasetSourceConfig → DirectHFSFTDatasetConfig → DirectHFSFTDatasetBuilder |
| Text SFT or PEFT from current prepared data | Transitional; materialized JSONL and optional packed Parquet | Prepared text-only | GPTSFTDatasetConfig → GPTSFTDatasetBuilder |
Text SFT or PEFT from prepared .bin/.idx | Planned Issue #4664 workflow; not available yet | Follow Issue #4664 | Future prepared-SFT builder |
| Multimodal SFT or PEFT from Hugging Face | Recommended for hosted vision, video, audio, and omni data or local JSON/JSONL loaded through Hugging Face datasets | Hugging Face multimodal | HFDatasetSourceConfig → DirectHFSFTDatasetConfig → DirectHFSFTDatasetBuilder |
| Large sharded multimodal training | Recommended for WebDataset/Energon data | Multimodal Energon | EnergonDatasetConfig → EnergonDatasetBuilder |
Which SFT path should I use?
- Choose Hugging Face text-only for new on-the-fly text SFT, including hosted chat datasets, local conversation JSON/JSONL, and prompt-completion rows.
- Choose Hugging Face multimodal for processor-native image, video, audio, or omni conversations. Hosted datasets and local JSON/JSONL accepted by the Hugging Face
jsonloader use the sameHFDatasetSourceConfig; there is no separate preloaded/local VLM provider. - Choose the current text-only SFT path when you specifically need reusable local JSONL, finite
num_epochs, or offline packed-Parquet behavior. This is a transitional prepared-data path until the planned.bin/.idxSFT replacement is available. - Choose the Energon tutorial for large sharded multimodal datasets; VALOR32K-AVQA is the production audio-video example.
All current SFT paths use serializable, declarative configuration and runtime builders. GPTSFTDatasetBuilder materializes Hugging Face text rows before constructing GPTSFTDataset; DirectHFSFTDatasetBuilder loads rows from Hugging Face datasets directly into DirectSFTDataset without intermediate JSONL materialization; EnergonDatasetBuilder constructs the configured task encoder and WebDataset loaders. The builders own runtime objects such as tokenizers, processors, task encoders, collators, and datasets.