kempnerforge.training.data_pipeline¶
Training/eval data pipeline construction and phase (annealing) scheduling.
The builders here own every [data] / [eval] branch that used to sit
inline in the training entry point: pre-tokenized mmap, HuggingFace (eager or
streaming), multi-dataset mixtures, and the VLM image/video paths.
Functions
|
Activate every phase whose |
|
Build the training data pipeline for whichever |
|
Build the eval dataloader, or None when eval is off or unsupported. |
|
Resolve data-annealing phases and re-derive the active one on resume. |
Classes
The training dataset/loader plus the mixture state phases need. |
|
Data-annealing phases and the currently active scaling. |
- class kempnerforge.training.data_pipeline.DataPipeline[source]¶
Bases:
objectThe training dataset/loader plus the mixture state phases need.
dataloader is Nonemeans no data source was configured; the text and PP step bodies then fall back to random tokens.dp_rank/dp_sizerecord the data-parallel partition the samplers were built for.- mixture_dataset: MixtureDataset | None = None¶
- mixture_sampler: MixtureSampler | None = None¶
- __init__(dataloader=None, dp_rank=0, dp_size=1, mixture_dataset=None, mixture_sampler=None, mixture_weights=<factory>)¶
- Parameters:
dataloader (Any | None)
dp_rank (int)
dp_size (int)
mixture_dataset (MixtureDataset | None)
mixture_sampler (MixtureSampler | None)
- Return type:
None
- class kempnerforge.training.data_pipeline.PhaseState[source]¶
Bases:
objectData-annealing phases and the currently active scaling.
- phases: list[TrainingPhase]¶
- kempnerforge.training.data_pipeline.build_data_pipeline(config, runtime)[source]¶
Build the training data pipeline for whichever
[data]source is set.Returns an empty pipeline when no source is configured — the text and PP step bodies then run on random tokens.
- Parameters:
config (JobConfig)
runtime (RuntimeContext)
- Return type:
- kempnerforge.training.data_pipeline.build_eval_dataloader(config, runtime)[source]¶
Build the eval dataloader, or None when eval is off or unsupported.
VLM + eval is out of scope on this branch:
run_evalcallsmodel(input_ids), which does not matchVLMWrapper.forward.- Parameters:
config (JobConfig)
runtime (RuntimeContext)
- Return type:
Any | None
- kempnerforge.training.data_pipeline.build_phase_state(config, data, step)[source]¶
Resolve data-annealing phases and re-derive the active one on resume.
- Parameters:
config (JobConfig)
data (DataPipeline)
step (int)
- Return type:
- kempnerforge.training.data_pipeline.advance_phases(state, data, step)[source]¶
Activate every phase whose
start_stephas been reached.Returns True when at least one phase fired, so the caller can drop the materialized data iterator and pick up the new sampler weights.
- Parameters:
state (PhaseState)
data (DataPipeline)
step (int)
- Return type: