Skip to content

Commit ae9af20

Browse files
committed
add functional tests
1 parent 446a31e commit ae9af20

3 files changed

Lines changed: 139 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
defaults:
2+
- _self_
3+
- train: 8b
4+
5+
experiment:
6+
exp_name: 8b
7+
exp_dir: tests/functional_tests/train/qwen3_vl/test_results/8b
8+
task:
9+
type: train
10+
backend: megatron
11+
entrypoint: flagscale/train/megatron/train_qwen3_vl.py
12+
runner:
13+
ssh_port: null
14+
shell_cmds: null
15+
envs:
16+
HYDRA_FULL_ERROR: 1
17+
CUDA_VISIBLE_DEVICES: "0,1,2,3"
18+
CUDA_DEVICE_MAX_CONNECTIONS: 1
19+
CUBLAS_WORKSPACE_CONFIG: ":4096:8"
20+
NCCL_ALGO: "Ring"
21+
NVTE_APPLY_QK_LAYER_SCALING: 0
22+
NVTE_ALLOW_NONDETERMINISTIC_ALGO: 0
23+
NVTE_FLASH_ATTN: 1
24+
NVTE_FUSED_ATTN: 0
25+
CUDNN_BENCHMARK: "false"
26+
CUDNN_DETERMINISTIC: "true"
27+
cmds:
28+
before_start: source /root/miniconda3/bin/activate flagscale-train && pip install git+https://github.com/NVIDIA/Megatron-Energon.git@ab40226100830f41de38d1f1204d7848b54b1f3e && pip install transformers==4.57
29+
action: run
30+
31+
hydra:
32+
run:
33+
dir: ${experiment.exp_dir}/hydra
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
system:
2+
vision_ration: 0.1
3+
num_workers: 1
4+
calculate_per_token_loss: true
5+
tensor_model_parallel_size: 1
6+
pipeline_model_parallel_size: 2
7+
context_parallel_size: 1
8+
use_flash_attn: True
9+
use_distributed_optimizer: True
10+
sequence_parallel: True
11+
tp_comm_overlap: False
12+
overlap_grad_reduce: False # if has text-only must be false
13+
overlap_param_gather: False # if has text-only must be false
14+
use_mcore_models: True
15+
transformer_impl: transformer_engine
16+
use_te: True
17+
precision:
18+
bf16: True
19+
attention_softmax_in_fp32: True
20+
logging:
21+
log_interval: 1
22+
tensorboard_log_interval: 1
23+
log_throughput: True
24+
wandb_project: ${experiment.exp_name}
25+
wandb_exp_name: ${experiment.exp_name}
26+
log_params_norm: True
27+
log_num_zeros_in_grad: True
28+
checkpoint:
29+
save_interval: 1000
30+
# pretrained_checkpoint: /nfs/lizhiyu/embody/data/Qwen3-VL-8B-Instruct-tp2/
31+
dataloader_save: ${experiment.exp_dir}/checkpoints/dataloader
32+
ckpt_format: torch
33+
async_save: False
34+
35+
model:
36+
kv_channels: 128 # the weight out_size of prepare qkv
37+
qk_layernorm: True
38+
attention_backend: flash # don't use "auto(nvte_flash_attn)"
39+
disable_bias_linear: True
40+
num_layers: 36
41+
hidden_size: 4096
42+
ffn_hidden_size: 12288
43+
num_attention_heads: 32
44+
num_query_groups: 8
45+
seq_length: 2048
46+
max_padding_length: 2048 # (cutoff_len)max 262144, change according the dataset
47+
# especial for qwen3-vl
48+
enable_variable_seq_lengths: True
49+
max_position_embeddings: 262144 # only useful for additional position embedding
50+
swiglu: True
51+
normalization: RMSNorm
52+
norm_epsilon: 1e-6
53+
init_method_std: 0.02
54+
attention_dropout: 0.0
55+
hidden_dropout: 0.0
56+
clip_grad: 1.0
57+
train_iters: 10
58+
eval_iters: 0 # no valid
59+
eval_interval: 1000
60+
micro_batch_size: 1
61+
global_batch_size: 4
62+
allow_missing_vision_projection_checkpoint: False
63+
apply_layernorm_1p: False
64+
group_query_attention: True
65+
no_masked_softmax_fusion: True
66+
untie_embeddings_and_output_weights: True
67+
68+
# position embedding
69+
position_embedding_type: mrope
70+
rotary_percent: 1.0
71+
rotary_base: 5000000
72+
rotary_seq_len_interpolation_factor: 1
73+
no_rope_fusion: False
74+
mrope_section: [24, 20, 20]
75+
eod_mask_loss: False
76+
77+
# vision model
78+
patch_size: 16
79+
freeze_LM: False
80+
freeze_ViT: False
81+
disable_vision_class_token: True
82+
seed: 42
83+
84+
optimizer:
85+
weight_decay: 0.1
86+
adam_beta1: 0.9
87+
adam_beta2: 0.999
88+
lr_scheduler:
89+
lr: 1.0e-5
90+
min_lr: 1.0e-6
91+
lr_warmup_fraction: .03
92+
lr_decay_style: cosine
93+
94+
data:
95+
no_use_system_prompt: True
96+
data_path: /nfs/lizhiyu/embody/data/blip_laion_cc_sbu_558k_first_5k/wds-2/
97+
vision_root: /nfs/lizhiyu/embody/data/blip_laion_cc_sbu_558k_first_5k/
98+
dataloader_type: external
99+
split: 100,0,0
100+
tokenizer:
101+
tokenizer_type: Qwen2VLTokenizer
102+
tokenizer_path: /nfs/lizhiyu/embody/data/Qwen3-VL-8B-Instruct-tp2/
103+
# vocab_size: 151936 #
104+
extra_vocab_size: 293 # Qwen3-VL specific. total vocab size = 151643 + extra_vocab_size
105+
make_vocab_size_divisible_by: 64
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"lm loss:": {"values": [12.70535, 12.76372, 11.01310, 12.65629, 13.28216, 13.88037, 11.55830, 11.04979, 11.11519, 9.531566], "rtol": 0.1, "atol": 0.2}}

0 commit comments

Comments
 (0)