seed: 0
output_dir: './output'
load_checkpoint: ''
load_ckpt_format: 'safetensors'
src_strategy_path_or_dir: ''
auto_trans_ckpt: False
only_save_strategy: False
resume_training: False
use_parallel: True
run_mode: 'train'
train_precision_sync: True
use_legacy: False
trainer:
type: CausalLanguageModelingTrainer
model_name: 'telechat3'
runner_config:
epochs: 10
batch_size: 1
sink_mode: True
sink_size: 1
gradient_accumulation_steps: 1
optimizer:
type: AdamW
betas: [0.9, 0.95]
eps: 1.e-8
weight_decay: 0.1
lr_schedule:
type: ConstantWarmUpLR
learning_rate: 2.e-4
lr_end: 2.e-5
warmup_steps: 2000
total_steps: 1908000
train_dataset: &train_dataset
data_loader:
type: BlendedMegatronDatasetDataLoader
datasets_type: "GPTDataset"
sizes:
- 8000
- 0
- 0
config:
seed: 1234
split: "1, 0, 0"
seq_length: 8192
eod_mask_loss: False
reset_position_ids: False
create_attention_mask: False
reset_attention_mask: False
create_compressed_eod_mask: False
eod_pad_length: 128
eod: 1
pad: -1
data_path:
- '1'
- "/dataset_path"
input_columns: ["input_ids", "labels", "loss_mask", "position_ids"]
construct_args_key: ["input_ids", "labels"]
num_parallel_workers: 8
python_multiprocessing: False
drop_remainder: True
numa_enable: False
prefetch_size: 1
seed: 1234
train_dataset_task:
type: CausalLanguageModelDataset
dataset_config: *train_dataset
context:
mode: 0
device_target: "Ascend"
max_device_memory: "58GB"
memory_optimize_level: "O0"
jit_config:
jit_level: "O0"
parallel_config:
data_parallel: &dp 1
model_parallel: 8
pipeline_stage: 2
micro_batch_num: 4
use_seq_parallel: True
gradient_aggregation_group: 4
micro_batch_interleave_num: 1
parallel:
parallel_mode: 1
gradients_mean: False
enable_alltoall: False
full_batch: False
dataset_strategy: [[*dp, 1], [*dp, 1], [*dp, 1], [*dp, 1]]
enable_parallel_optimizer: True
pipeline_config:
pipeline_interleave: True
pipeline_scheduler: 'seqpipe'
strategy_ckpt_config:
save_file: "./ckpt_strategy.ckpt"
only_trainable_params: False
parallel_optimizer_config:
gradient_accumulation_shard: False
parallel_optimizer_threshold: 64
recompute_config:
recompute: [[14, 14], [14, 14]]
select_comm_recompute: False
select_recompute: False
parallel_optimizer_comm_recompute: False
mp_comm_recompute: False
recompute_slice_activation: False
model:
model_config:
vocab_size: 131072
hidden_size: 6144
intermediate_size: 24576
num_hidden_layers: 64
num_attention_heads: 48
num_key_value_heads: 8
hidden_act: 'swiglu'
max_position_embeddings: 8192
seq_length: 8192
rms_norm_eps: 1.e-5
tie_word_embeddings: False
rope_theta: 10000
attention_bias: False
use_flash_attention: True
add_bias_linear: False
eos_token_id: 2
pad_token_id: 3
bos_token_id: 1
pp_interleave_num: 2
attention_dropout: 0.0
hidden_dropout: 0.0
input_sliced_sig: True
untie_embeddings_and_output_weights: True
position_embedding_type: "rope"
use_contiguous_weight_layout_attention: False
offset: 0
params_dtype: "float32"
compute_dtype: "bfloat16"
layernorm_compute_dtype: "float32"
softmax_compute_dtype: "float32"
rotary_dtype: "float32"
fp32_residual_connection: True
model_type: "telechat3"
architectures: ["TeleChat3ForCausalLM"]
callbacks:
- type: MFLossMonitor
- type: CheckpointMonitor
prefix: "telechat3"
save_checkpoint_steps: 300
keep_checkpoint_max: 10
integrated_save: False
remove_redundancy: True
async_save: False
checkpoint_format: "safetensors"
runner_wrapper:
type: MFTrainOneStepCell
scale_sense: 1.0
use_clip_grad: True
profile: False
profile_start_step: 1000
profile_stop_step: 1000
init_start_profile: False
profile_communication: False
profile_memory: True
layer_scale: False
layer_decay: 0.65
lr_scale_factor: 256