Skip to content

Commit 4e79040

Browse files
committed
update
1 parent e39fe05 commit 4e79040

27 files changed

+9554
-213
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"architectures": [
3+
"DeepseekV3ForCausalLM"
4+
],
5+
"attention_bias": false,
6+
"attention_dropout": 0.0,
7+
"auto_map": {
8+
"AutoConfig": "configuration_deepseek.DeepseekV3Config",
9+
"AutoModel": "modeling_deepseek.DeepseekV3Model",
10+
"AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
11+
},
12+
"aux_loss_alpha": 0.001,
13+
"bos_token_id": 0,
14+
"eos_token_id": 1,
15+
"ep_size": 1,
16+
"first_k_dense_replace": 3,
17+
"hidden_act": "silu",
18+
"hidden_size": 7168,
19+
"initializer_range": 0.02,
20+
"intermediate_size": 18432,
21+
"kv_lora_rank": 512,
22+
"max_position_embeddings": 163840,
23+
"model_type": "deepseek_v3",
24+
"moe_intermediate_size": 2048,
25+
"moe_layer_freq": 1,
26+
"n_group": 8,
27+
"n_routed_experts": 8,
28+
"n_shared_experts": 1,
29+
"norm_topk_prob": true,
30+
"num_attention_heads": 128,
31+
"num_experts_per_tok": 8,
32+
"num_hidden_layers": 15,
33+
"num_key_value_heads": 128,
34+
"num_nextn_predict_layers": 1,
35+
"pretraining_tp": 1,
36+
"q_lora_rank": 1536,
37+
"qk_nope_head_dim": 128,
38+
"qk_rope_head_dim": 64,
39+
"rms_norm_eps": 1e-06,
40+
"rope_scaling": {
41+
"beta_fast": 32,
42+
"beta_slow": 1,
43+
"factor": 40,
44+
"mscale": 1.0,
45+
"mscale_all_dim": 1.0,
46+
"original_max_position_embeddings": 4096,
47+
"type": "yarn"
48+
},
49+
"rope_theta": 10000,
50+
"routed_scaling_factor": 2.5,
51+
"scoring_func": "sigmoid",
52+
"seq_aux": true,
53+
"tie_word_embeddings": false,
54+
"topk_group": 4,
55+
"topk_method": "noaux_tc",
56+
"dtype": "bfloat16",
57+
"transformers_version": "4.33.1",
58+
"use_cache": true,
59+
"v_head_dim": 128,
60+
"vocab_size": 129280,
61+
"using_flex_token": true,
62+
"using_fake_gate": true,
63+
"use_fused_rms_norm": true,
64+
"fuse_attention_ffn": true,
65+
"use_fused_rope": true,
66+
"token_drop_steps": 0,
67+
"recompute_fwd_gate_up": true,
68+
"adaptive_remained_O1_recompute_ratio": 0.3,
69+
"using_post_norm_recompute": true,
70+
"is_split_group_gemm": false,
71+
"use_dualpipev": true,
72+
"send_mtp_embed": true,
73+
"offline_quant_expert_weight": false,
74+
"clear_origin_weight_when_offline_quant": false
75+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"model_name_or_path": "./config/",
3+
"tokenizer_name_or_path": "deepseek-ai/DeepSeek-V3",
4+
"input_dir": "./data",
5+
"output_dir": "./checkpoints/pretrain_ckpts",
6+
"per_device_train_batch_size": 1,
7+
"gradient_accumulation_steps": 24,
8+
"per_device_eval_batch_size": 1,
9+
"tensor_parallel_degree": 1,
10+
"pipeline_parallel_degree": 4,
11+
"pipeline_parallel_config": "use_dualpipev",
12+
"sharding_parallel_degree": 2,
13+
"sharding_parallel_config": "split_param",
14+
"sharding_comm_buffer_size_MB": 2048,
15+
"expert_parallel_degree": 2,
16+
"sharding": "stage1",
17+
"virtual_pp_degree": 1,
18+
"sequence_parallel": 0,
19+
"use_flash_attention": true,
20+
"max_seq_length": 4097,
21+
"learning_rate": 3e-05,
22+
"min_learning_rate": 3e-06,
23+
"warmup_steps": 30,
24+
"logging_steps": 1,
25+
"max_steps": 200,
26+
"save_steps": 5000,
27+
"eval_steps": 1000,
28+
"weight_decay": 0.01,
29+
"bf16": true,
30+
"fp16_opt_level": "O2",
31+
"warmup_ratio": 0.01,
32+
"max_grad_norm": 1.0,
33+
"amp_master_grad": 1,
34+
"dataloader_num_workers": 8,
35+
"continue_training": 0,
36+
"do_train": true,
37+
"do_eval": true,
38+
"do_predict": false,
39+
"disable_tqdm": true,
40+
"recompute": false,
41+
"distributed_dataloader": 1,
42+
"unified_checkpoint": true,
43+
"save_total_limit": 2,
44+
"skip_profile_timer": false,
45+
"use_fused_rms_norm": true,
46+
"fuse_attention_ffn": true,
47+
"use_fused_rope": true,
48+
"save_sharded_model": false,
49+
"load_sharded_model": false,
50+
"use_expert_parallel": true,
51+
"unified_checkpoint_config": "skip_save_model_weight",
52+
"offload_optim": true
53+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. 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+
# llama 模型数据下载
16+
# mkdir -p data
17+
# wget https://bj.bcebos.com/paddlenlp/models/transformers/llama/data/llama_openwebtext_100k.bin
18+
# wget https://bj.bcebos.com/paddlenlp/models/transformers/llama/data/llama_openwebtext_100k.idx
19+
20+
# mpirun sh script/kill_process.sh
21+
# mpirun rm -rf output
22+
nohup bash script/train_gpu.sh config/pretrain_argument.json > run.log 2>&1 &
23+

0 commit comments

Comments
 (0)