kempnerforge.config.job¶
Top-level job configuration aggregating all sub-configs.
Classes
Top-level configuration aggregating all sub-configs. |
- class kempnerforge.config.job.JobConfig[source]¶
Bases:
objectTop-level configuration aggregating all sub-configs.
The VLM stack lives as three sibling top-level sections,
[vision_encoder]/[adapter]/[vlm]. A pure text run leaves all three atNoneand writes only[model](plus the other operational sections). A VLM run sets[vlm]and is required to provide[vision_encoder];[adapter]defaults to the registered 2-layer MLP and may be omitted.- model: ModelConfig¶
- train: TrainConfig¶
- optimizer: OptimizerConfig¶
- scheduler: SchedulerConfig¶
- data: DataConfig¶
- eval: EvalConfig¶
- distributed: DistributedConfig¶
- checkpoint: CheckpointConfig¶
- metrics: MetricsConfig¶
- profiling: ProfilingConfig¶
- vision_encoder: VisionEncoderConfig | None = None¶
- adapter: AdapterConfig | None = None¶
- video: VideoConfig | None = None¶
- property images_per_document: int¶
the image cap, or one clip on a video run.
- Type:
Images one document may hold
- property views_per_sample: int¶
a clip’s frames, a tiled image’s views, or one.
- Type:
Images the encoder sees per sample
- masks_frames_in_backend_attention()[source]¶
Whether a frame mask reaches self-attention that runs under
model.sdpa_backend.The modality strategy, which the vlm section’s
archpicks, masks padded frames in self-attention under Joint-Decoder, MoT and MoMa; Cross-Attention masks them in its cross-attention layers only. The model’s attention, which the section’s class picks, runs SDPA under the configured backend except under MoT. A section whosearchan override changed is judged by both.- Return type:
- check_flash_attention_masks()[source]¶
Refuse
sdpa_backend="flash"for a training run whose batches carry a mask.PyTorch’s CUDA FlashAttention kernel takes no attention mask. Packed rows mask their documents from each other under
attention_backend="sdpa", where a run reads them from a dataset (flex turns them into a block mask), and the padded frames of a video run are masked under either backend wheremasks_frames_in_backend_attentionsays so: Joint-Decoder and MoMa. The training setup calls this on CUDA, after the CLI overrides and before the process group starts. Evaluation and generation are not checked at setup: on CUDA, a forward there that passes a dense mask toAttention, such as video evaluation’s frame mask under Joint-Decoder or MoMa, raises theValueErrorfromAttention.forward.- Raises:
ValueError – The run would train with
sdpa_backend="flash"and a mask.- Return type:
None
- validate(world_size=1, *, training=True)[source]¶
Run cross-config validations that depend on the world size.
training=Falseskips the checks that concern only a training run, such as a bf16 gradient reduce without a data-parallel mesh, for a job that computes no gradient (scripts/eval.py).
- __init__(model=<factory>, train=<factory>, optimizer=<factory>, scheduler=<factory>, data=<factory>, eval=<factory>, distributed=<factory>, checkpoint=<factory>, metrics=<factory>, profiling=<factory>, vision_encoder=None, adapter=None, vlm=None, video=None, plugins=<factory>)¶
- Parameters:
model (ModelConfig)
train (TrainConfig)
optimizer (OptimizerConfig)
scheduler (SchedulerConfig)
data (DataConfig)
eval (EvalConfig)
distributed (DistributedConfig)
checkpoint (CheckpointConfig)
metrics (MetricsConfig)
profiling (ProfilingConfig)
vision_encoder (VisionEncoderConfig | None)
adapter (AdapterConfig | None)
vlm (VLMConfig | None)
video (VideoConfig | None)
- Return type:
None