seed: 0
output_dir: './output'
load_checkpoint: ''
src_strategy_path_or_dir: ''
auto_trans_ckpt: False
only_save_strategy: False
transform_process_num: 16
resume_training: False
ignore_data_skip: False
run_mode: 'train'
load_ckpt_format: 'ckpt'
trainer:
type: CausalLanguageModelingTrainer
model_name: 'telechat_7b_moe'
runner_config:
epochs: 10
batch_size: 1
sink_mode: True
sink_size: 2
gradient_accumulation_steps: 1
optimizer:
type: AdamW
betas: [0.9,0.95]
eps: 1.e-8
weight_decay: 0.1
moe_config:
expert_num: 16
capacity_factor: 1.2
aux_loss_factors: [0.01]
aux_loss_types: ["expert"]
num_experts_chosen: 4
routing_policy: "TopkRouterV2"
enable_sdrop: False
use_fused_ops_topkrouter: True
router_dense_type: "float32"
group_wise_a2a: False
shared_expert_num: 0
comp_comm_parallel: False
comp_comm_parallel_degree: 2
balance_via_topk_bias: False
topk_bias_update_rate: 0
ep_extend_tp: True
lr_schedule:
type: CosineWithWarmUpLR
learning_rate: 3.0e-4
lr_end: 1.5e-5
warmup_steps: 2000
total_steps: 1000000
train_dataset: &train_dataset
data_loader:
type: MindDataset
dataset_dir: ""
shuffle: True
input_columns: ["input_ids", "labels"]
num_parallel_workers: 8
python_multiprocessing: False
drop_remainder: True
numa_enable: False
prefetch_size: 1
train_dataset_task:
type: CausalLanguageModelDataset
dataset_config: *train_dataset
use_parallel: True
parallel:
parallel_mode: 1
gradients_mean: False
enable_alltoall: True
full_batch: True
search_mode: "sharding_propagation"
enable_parallel_optimizer: True
strategy_ckpt_save_file: "./ckpt_strategy.ckpt"
parallel_optimizer_config:
gradient_accumulation_shard: False
optimizer_weight_shard_size: 2
parallel_optimizer_threshold: 64
parallel_config:
data_parallel: 128
expert_parallel: 2
model_parallel: 4
pipeline_stage: 2
use_seq_parallel: True
micro_batch_num: 4
vocab_emb_dp: False
gradient_aggregation_group: 4
micro_batch_interleave_num: 1
recompute_config:
recompute: [3,0]
select_recompute: False
parallel_optimizer_comm_recompute: False
mp_comm_recompute: True
recompute_slice_activation: True
callbacks:
- type: MFLossMonitor
- type: CheckpointMonitor
prefix: "telechat_7b_moe"
checkpoint_format: "ckpt"
save_checkpoint_steps: 1600
keep_checkpoint_max: 4
integrated_save: False
context:
mode: 0
device_target: "Ascend"
max_call_depth: 10000
memory_optimize_level: "O1"
max_device_memory: "53GB"
save_graphs: False
save_graphs_path: "./graph"
jit_config:
jit_level: O1
mempool_block_size: "53GB"
device_id: 0
ascend_config:
parallel_speed_up_json_path: "./parallel_speed_up.json"
model:
model_config:
type: TelechatConfig
auto_register: telechat_config.TelechatConfig
batch_size: 1
seq_length: 8192
hidden_size: 4096
intermediate_size: 6144
num_layers: 30
num_heads: 32
n_kv_heads: 32
vocab_size: 131072
rms_norm_eps: 1.0e-5
bos_token_id: 1
eos_token_id: 2
pad_token_id: 3
ignore_token_id: -100
sigma: 0.0048
mean: 0.0
hidden_dropout_prob: 0.0
attention_dropout_prob: 0.0
embed_dropout_prob: 0.0
res_dtype: "float32"
compute_dtype: "bfloat16"
layernorm_compute_type: "float32"
softmax_compute_type: "float32"
rotary_dtype: "float32"
param_init_type: "float32"
use_past: False
pretrain_seqlen: 8192
extend_method: "None"
use_flash_attention: True
offset: 0
use_past_shard: False
checkpoint_name_or_path: "telechat_7b_moe"
repetition_penalty: 1
max_decode_length: 512
top_k: 3
top_p: 1
do_sample: False
arch:
type: TelechatForCausalLM
auto_register: telechat.TelechatForCausalLM
runner_wrapper:
type: MFTrainOneStepCell
scale_sense: 1.0
use_clip_grad: True
profile: False
profile_start_step: 200
profile_stop_step: 202
init_start_profile: False
profile_communication: True
profile_memory: False
layer_scale: False
layer_decay: 0.65
lr_scale_factor: 256