Data Tutorials

July 15, 2026 · View on GitHub

Choose the tutorial that matches how your examples should reach the training loop:

WorkflowStatus and starting dataTutorialRuntime path
Pretraining from Megatron .bin/.idxRecommended; prepared token IDsDCLM preprocessingGPTDatasetConfig → Megatron Core dataset builder
Text SFT or PEFT directly from Hugging FaceRecommended for hosted chat/prompt-completion rows or local JSON/JSONL loaded through Hugging Face datasetsHugging Face text-onlyHFDatasetSourceConfigDirectHFSFTDatasetConfigDirectHFSFTDatasetBuilder
Text SFT or PEFT from current prepared dataTransitional; materialized JSONL and optional packed ParquetPrepared text-onlyGPTSFTDatasetConfigGPTSFTDatasetBuilder
Text SFT or PEFT from prepared .bin/.idxPlanned Issue #4664 workflow; not available yetFollow Issue #4664Future prepared-SFT builder
Multimodal SFT or PEFT from Hugging FaceRecommended for hosted vision, video, audio, and omni data or local JSON/JSONL loaded through Hugging Face datasetsHugging Face multimodalHFDatasetSourceConfigDirectHFSFTDatasetConfigDirectHFSFTDatasetBuilder
Large sharded multimodal trainingRecommended for WebDataset/Energon dataMultimodal EnergonEnergonDatasetConfigEnergonDatasetBuilder

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 json loader use the same HFDatasetSourceConfig; 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/.idx SFT 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.