Skip to content

Commit 5b25e73

Browse files
HuiyingLiakoumpa
andauthored
feat: add support for kimi K2.5 VL (#1132)
Signed-off-by: HuiyingLi <willwin.lee@gmail.com> Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com> Co-authored-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
1 parent 46e6253 commit 5b25e73

File tree

11 files changed

+5436
-7
lines changed

11 files changed

+5436
-7
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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: 512
17+
local_batch_size: 8
18+
ckpt_every_steps: 100
19+
val_every_steps: 100
20+
max_steps: 200
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: 8
36+
dp_replicate_size: 1
37+
ep_size: 32
38+
sequence_parallel: false
39+
40+
autopipeline:
41+
_target_: nemo_automodel.components.distributed.pipelining.AutoPipeline
42+
pp_schedule: interleaved1f1b
43+
pp_microbatch_size: 1
44+
round_virtual_stages_to_pp_multiple: down
45+
scale_grads_in_schedule: false
46+
layers_per_stage: 2
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: /your/path/to/kimi-K25-VL-weights
57+
torch_dtype: bfloat16
58+
backend:
59+
_target_: nemo_automodel.components.models.common.BackendConfig
60+
attn: te
61+
linear: torch
62+
rms_norm: torch
63+
rope_fusion: false
64+
enable_deepep: true
65+
fake_balanced_gate: false
66+
enable_hf_state_dict_adapter: true
67+
enable_fsdp_optimizations: true
68+
69+
processor:
70+
_target_: transformers.AutoProcessor.from_pretrained
71+
pretrained_model_name_or_path: /your/path/to/kimi-K25-VL-weights
72+
trust_remote_code: true
73+
74+
checkpoint:
75+
enabled: false
76+
checkpoint_dir: vlm_checkpoints/kimi_k25_2layer/
77+
model_save_format: safetensors
78+
save_consolidated: true
79+
80+
loss_fn:
81+
_target_: nemo_automodel.components.loss.masked_ce.MaskedCrossEntropy
82+
fp32_upcast: false
83+
84+
85+
dataset:
86+
_target_: nemo_automodel.components.datasets.vlm.datasets.make_medpix_dataset
87+
path_or_dataset: mmoukouba/MedPix-VQA
88+
split: train
89+
90+
dataloader:
91+
_target_: torchdata.stateful_dataloader.StatefulDataLoader
92+
num_workers: 1
93+
pin_memory: true
94+
collate_fn:
95+
_target_: nemo_automodel.components.datasets.vlm.collate_fns.kimi_k25_vl_collate_fn
96+
max_length: 1024
97+
98+
validation_dataset:
99+
_target_: nemo_automodel.components.datasets.vlm.datasets.make_medpix_dataset
100+
path_or_dataset: mmoukouba/MedPix-VQA
101+
split: validation
102+
103+
validation_dataloader:
104+
_target_: torchdata.stateful_dataloader.StatefulDataLoader
105+
106+
107+
optimizer:
108+
_target_: torch.optim.AdamW
109+
lr: 1.0e-05
110+
weight_decay: 0.01
111+
betas:
112+
- 0.9
113+
- 0.95
114+
115+
freeze_config:
116+
freeze_embeddings: true
117+
freeze_vision_tower: true
118+
freeze_language_model: false
119+
120+
# wandb:
121+
# project: <your_project_name>
122+
# entity: <your_entity_name>
123+
# name: <your_exp_name>

0 commit comments

Comments
 (0)