|
| 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 | +# Configuration for fine-tuning ministral 3 14b |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +step_scheduler: |
| 20 | + global_batch_size: 8 |
| 21 | + local_batch_size: 1 |
| 22 | + ckpt_every_steps: 100 |
| 23 | + val_every_steps: 100 # will run every x number of gradient steps |
| 24 | + num_epochs: 1 |
| 25 | + |
| 26 | +dist_env: |
| 27 | + backend: nccl |
| 28 | + timeout_minutes: 10 |
| 29 | + |
| 30 | +rng: |
| 31 | + _target_: nemo_automodel.components.training.rng.StatefulRNG |
| 32 | + seed: 42 |
| 33 | + ranked: true |
| 34 | + |
| 35 | +model: |
| 36 | + _target_: nemo_automodel.NeMoAutoModelForImageTextToText.from_pretrained |
| 37 | + pretrained_model_name_or_path: mistralai/Ministral-3-14B-Reasoning-2512 |
| 38 | + torch_dtype: torch.bfloat16 |
| 39 | + attn_implementation: eager |
| 40 | + |
| 41 | +checkpoint: |
| 42 | + enabled: true |
| 43 | + checkpoint_dir: vlm_checkpoints/ |
| 44 | + model_save_format: safetensors |
| 45 | + save_consolidated: True |
| 46 | + |
| 47 | +distributed: |
| 48 | + _target_: nemo_automodel.components.distributed.fsdp2.FSDP2Manager |
| 49 | + dp_size: none |
| 50 | + tp_size: 1 |
| 51 | + cp_size: 1 |
| 52 | + sequence_parallel: false |
| 53 | + |
| 54 | +loss_fn: |
| 55 | + _target_: nemo_automodel.components.loss.masked_ce.MaskedCrossEntropy |
| 56 | + |
| 57 | +dataset: |
| 58 | + _target_: nemo_automodel.components.datasets.vlm.datasets.make_medpix_dataset |
| 59 | + path_or_dataset: mmoukouba/MedPix-VQA |
| 60 | + split: train[:1000] |
| 61 | + |
| 62 | +dataloader: |
| 63 | + _target_: torchdata.stateful_dataloader.StatefulDataLoader |
| 64 | + num_workers: 0 |
| 65 | + collate_fn: |
| 66 | + _target_: nemo_automodel.components.datasets.vlm.collate_fns.default_collate_fn |
| 67 | + |
| 68 | +validation_dataset: |
| 69 | + _target_: nemo_automodel.components.datasets.vlm.datasets.make_medpix_dataset |
| 70 | + path_or_dataset: mmoukouba/MedPix-VQA |
| 71 | + split: validation[:500] |
| 72 | + |
| 73 | +validation_dataloader: |
| 74 | + _target_: torchdata.stateful_dataloader.StatefulDataLoader |
| 75 | + num_workers: 0 |
| 76 | + collate_fn: |
| 77 | + _target_: nemo_automodel.components.datasets.vlm.collate_fns.default_collate_fn |
| 78 | + |
| 79 | +optimizer: |
| 80 | + _target_: torch.optim.AdamW |
| 81 | + lr: 1e-5 |
| 82 | + weight_decay: 0.01 |
| 83 | + betas: [0.9, 0.95] |
| 84 | + |
| 85 | +freeze_config: |
| 86 | + freeze_embeddings: true |
| 87 | + freeze_vision_tower: true |
| 88 | + freeze_language_model: false |
| 89 | + |
| 90 | +# Uncomment and configure for W&B logging |
| 91 | +# wandb: |
| 92 | +# project: |
| 93 | +# entity: |
| 94 | +# name: |
| 95 | +# save_dir: |
0 commit comments