nemo_automodel.components.datasets.vlm.loader
nemo_automodel.components.datasets.vlm.loader
Typed construction for VLM processors, datasets, packing, and dataloaders.
Module Contents
Classes
Data
API
Dataset config whose build requires the runtime data-parallel rank.
Build the per-rank dataset shard.
Declarative VLM collator factory.
Function that accepts examples and the runtime processor.
Declarative keyword arguments bound once while building the dataloader.
Bind the runtime processor to the configured collator.
Materialized VLM dataloader and its processor.
Typed construction config for the complete VLM input pipeline.
Whether this loader emits packed multimodal inputs.
Worker processes per dataloader; zero selects available CPUs, capped at 4 * visible GPUs when present.
Selected native batch representation, independent of the packing algorithm.
Build the processor and raw dataset under the caller-owned ordering context.
Build the processor, dataset wrappers, sampler, collator, and dataloader.
Parameters:
Runtime model identifier used to build the processor.
Rank within the data-parallel group.
Size of the data-parallel group.
Runtime local training batch size.
Optional rank-ordering context used only for processor and source-dataset build.
Optional model callback used to create packed multimodal position IDs.
Deprecated attention-backend name retained for Python-call compatibility.
Structural model contract used for packed-mask construction. Native mask/Flash collation requires a model-derived contract supplying
Optional pipeline microbatch count used to pre-chunk media tensors.
Runtime context-parallel world size. Neat-packed CP uses compact document IDs instead of a dense quadratic attention mask; THD packing also accounts for per-document CP alignment.
Stream-backend label exclusion value. Native collators retain their existing configured supervision policy.
Returns: VlmDataloaderBuild
Named result containing the stateful dataloader and runtime processor.
Declarative processor factory and keyword arguments.
Configured processor factory; None selects AutoProcessor.from_pretrained.
Declarative keyword arguments for the configured processor factory.
Optional independently configured video processor.
Load the processor from the configured factory or AutoProcessor.
Build the configured processor.
Parameters:
Runtime model identifier used by the default AutoProcessor factory.
Returns: ProcessorMixin | None
Processor instance, or None when the model has no compatible AutoProcessor.
Declarative video-processor factory and keyword arguments.
Configured video-processor factory.
Declarative keyword arguments for the configured factory.
Build the configured video processor.
Parameters:
Runtime model identifier used when the nested config does not override it.
Returns: BaseVideoProcessor
Video-processor instance accepted by the parent processor factory.
Bases: StatefulDataLoader
Restore VLM checkpoints across synchronous and worker-based loaders.
Restore parent state only when it originated from synchronous loading.
Give each worker an independently owned copy of common map-style state.
Restore native worker state or migrate legacy map-style synchronous state.
Worker-count changes require stateless map-style worker snapshots. Legacy synchronous snapshots carry sampler/dataset state at the top level; give each worker that state and continue the sampler. Worker-side random transforms cannot reproduce the old main-process RNG.
Return native worker snapshots and any migrated synchronous parent state.