|
| 1 | +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +step_scheduler: |
| 16 | + global_batch_size: 16 |
| 17 | + local_batch_size: 2 |
| 18 | + ckpt_every_steps: 100 |
| 19 | + val_every_steps: 100 |
| 20 | + max_steps: 50 |
| 21 | + |
| 22 | +dist_env: |
| 23 | + backend: nccl |
| 24 | + timeout_minutes: 10 |
| 25 | + |
| 26 | +rng: |
| 27 | + _target_: nemo_automodel.components.training.rng.StatefulRNG |
| 28 | + seed: 42 |
| 29 | + ranked: true |
| 30 | + |
| 31 | +distributed: |
| 32 | + _target_: nemo_automodel.components.distributed.fsdp2.FSDP2Manager |
| 33 | + tp_size: 1 |
| 34 | + cp_size: 1 |
| 35 | + pp_size: 1 |
| 36 | + dp_replicate_size: 1 |
| 37 | + ep_size: 8 |
| 38 | + sequence_parallel: false |
| 39 | + |
| 40 | +autopipeline: |
| 41 | + _target_: nemo_automodel.components.distributed.pipelining.AutoPipeline |
| 42 | + pp_schedule: interleaved1f1b |
| 43 | + pp_microbatch_size: 2 |
| 44 | + round_virtual_stages_to_pp_multiple: down |
| 45 | + scale_grads_in_schedule: false |
| 46 | + layers_per_stage: 7 |
| 47 | + patch_inner_model: false |
| 48 | + patch_causal_lm_model: false |
| 49 | + |
| 50 | +parallelizer: |
| 51 | + _target_: nemo_automodel.components.moe.parallelizer.parallelize_model |
| 52 | + activation_checkpointing: false |
| 53 | + |
| 54 | +model: |
| 55 | + _target_: nemo_automodel.NeMoAutoModelForImageTextToText.from_pretrained |
| 56 | + pretrained_model_name_or_path: moonshotai/Kimi-VL-A3B-Instruct |
| 57 | + backend: |
| 58 | + _target_: nemo_automodel.components.models.common.BackendConfig |
| 59 | + attn: te |
| 60 | + linear: te |
| 61 | + rms_norm: te |
| 62 | + rope_fusion: true |
| 63 | + enable_deepep: true |
| 64 | + fake_balanced_gate: false |
| 65 | + enable_hf_state_dict_adapter: true |
| 66 | + enable_fsdp_optimizations: true |
| 67 | + |
| 68 | +processor: |
| 69 | + _target_: transformers.AutoProcessor.from_pretrained |
| 70 | + pretrained_model_name_or_path: moonshotai/Kimi-VL-A3B-Instruct |
| 71 | + trust_remote_code: true |
| 72 | + |
| 73 | +checkpoint: |
| 74 | + enabled: true |
| 75 | + checkpoint_dir: vlm_checkpoints/kimi2vl/ |
| 76 | + model_save_format: safetensors |
| 77 | + save_consolidated: true |
| 78 | + |
| 79 | +loss_fn: |
| 80 | + _target_: nemo_automodel.components.loss.masked_ce.MaskedCrossEntropy |
| 81 | + fp32_upcast: false |
| 82 | + |
| 83 | +dataset: |
| 84 | + _target_: nemo_automodel.components.datasets.vlm.datasets.make_cord_v2_dataset |
| 85 | + path_or_dataset: naver-clova-ix/cord-v2 |
| 86 | + split: train |
| 87 | + |
| 88 | +dataloader: |
| 89 | + _target_: torchdata.stateful_dataloader.StatefulDataLoader |
| 90 | + num_workers: 0 |
| 91 | + pin_memory: true |
| 92 | + collate_fn: |
| 93 | + _target_: nemo_automodel.components.datasets.vlm.collate_fns.kimi_vl_collate_fn |
| 94 | + max_length: 2048 |
| 95 | + |
| 96 | +validation_dataset: |
| 97 | + _target_: nemo_automodel.components.datasets.vlm.datasets.make_cord_v2_dataset |
| 98 | + path_or_dataset: naver-clova-ix/cord-v2 |
| 99 | + split: validation |
| 100 | + |
| 101 | +validation_dataloader: |
| 102 | + _target_: torchdata.stateful_dataloader.StatefulDataLoader |
| 103 | + |
| 104 | +optimizer: |
| 105 | + _target_: torch.optim.AdamW |
| 106 | + lr: 1.0e-05 |
| 107 | + weight_decay: 0.01 |
| 108 | + betas: |
| 109 | + - 0.9 |
| 110 | + - 0.95 |
| 111 | + |
| 112 | +freeze_config: |
| 113 | + freeze_embeddings: true |
| 114 | + freeze_vision_tower: true |
| 115 | + freeze_language_model: false |
| 116 | + |
| 117 | +# wandb: |
| 118 | +# project: <your_project_name> |
| 119 | +# entity: <your_entity_name> |
| 120 | +# name: kimi2vl_finetune |
0 commit comments