preprocess_minimax_h3_overfit ¶
Encode one Crush-Smol audio-video-caption record for MiniMax H3 supervised fine-tuning (SFT).
The Parquet row keeps the synchronized video target, audio target, and caption conditioning together for the text-to-video-and-audio (T2VA) dataloader.
Classes¶
Functions:¶
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.build_parquet_record ¶
build_parquet_record(*, file_name: str, caption: str, video_latents: Tensor, audio_latents: Tensor, text_embedding: Tensor) -> dict[str, Any]
Serialize one synchronized H3 sample for the Parquet schema collator.
collate_rows_from_parquet_schema reconstructs every tensor from a bytes/shape/dtype triplet and reads the byte payload as float32, so this boundary stores contiguous float32 tensors for lossless reconstruction.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.encode_audio_latents ¶
encode_audio_latents(waveform: Tensor, model_path: Path, model_index: dict[str, Any], fastvideo_args: FastVideoArgs) -> Tensor
Encode normalized [2, 32, T] stereo targets with the mono audio VAE.
Treating the stereo axis as the VAE batch axis applies the same mono encoder to both synchronized channels while preserving channel identity.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.encode_text_embedding ¶
encode_text_embedding(caption: str, model_path: Path, model_index: dict[str, Any], fastvideo_args: FastVideoArgs) -> Tensor
Encode the caption through the H3 Qwen3-VL layer-50 inference path.
Reusing MiniMaxH3ConditioningStage keeps training tokenization and the selected hidden-state layer identical to validation conditioning.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.encode_video_latents ¶
encode_video_latents(frames: ndarray, model_path: Path, model_index: dict[str, Any], fastvideo_args: FastVideoArgs) -> Tensor
Encode normalized [24, T, H, W] causal video VAE targets.
The video variational autoencoder (VAE) produces a channel-first latent layout that feeds H3's checkpoint-compatible token packing order (C, patch_t, patch_h, patch_w) without reordering latent channels into patch-major features.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.load_crush_smol_training_sample ¶
Resolve the selected Crush-Smol video and its sole dataset caption.
The pinned dataset manifest owns the caption. Selecting the sample by file name keeps the training input stable if the manifest order changes.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.load_training_media ¶
Decode paired targets at the geometry and rates consumed by H3.
The video uses exactly 124 frames, and the audio is capped at the duration of those frames before variational autoencoder (VAE) encoding.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.main ¶
Encode the selected Crush-Smol record with each H3 component in sequence.
Releasing each component before loading the next component keeps video, audio, and text preprocessing within one GPU's memory.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.validate_preprocessed_training_data ¶
validate_preprocessed_training_data(output_dir: Path = OUTPUT_DIR, manifest_path: Path = DATA_DIR / 'videos2caption.json', video_dir: Path = DATA_DIR / 'videos') -> None
Verify that the H3 dataset contains only the selected Crush-Smol record.
The launch path calls this function before Slurm submission so that stale Parquet shards or mismatched captions cannot enter the overfit run.
Source code in fastvideo/pipelines/preprocess/preprocess_minimax_h3_overfit.py
fastvideo.pipelines.preprocess.preprocess_minimax_h3_overfit.write_parquet ¶
Write the sole overfit row after removing other Parquet shards.
The training dataloader scans every Parquet shard in output_dir; replacing those shards preserves the one-sample overfit contract.