seed: 42
output_dir: './output'
load_checkpoint: ''
load_ckpt_format: 'safetensors'
src_strategy_path_or_dir: ''
auto_trans_ckpt: True
only_save_strategy: False
resume_training: False
use_parallel: True
run_mode: 'finetune'
use_legacy: False
pretrained_model_dir: "/path/to/Qwen3-32B"
trainer:
type: CausalLanguageModelingTrainer
model_name: 'Qwen3'
runner_config:
epochs: 1
batch_size: 1
gradient_accumulation_steps: 1
optimizer:
type: AdamW
betas: [0.9, 0.95]
eps: 1.e-8
weight_decay: 0.0
lr_schedule:
type: ConstantWarmUpLR
learning_rate: 1.e-6
warmup_ratio: 0
total_steps: -1
train_dataset: &train_dataset
input_columns: ["input_ids", "labels", "loss_mask", "position_ids"]
construct_args_key: ["input_ids", "labels", "loss_mask", "position_ids"]
data_loader:
type: HFDataLoader
load_func: 'load_dataset'
path: "llm-wizard/alpaca-gpt4-data-zh"
split: "train"
create_attention_mask: False
create_compressed_eod_mask: False
compressed_eod_mask_length: 128
use_broadcast_data: True
shuffle: False
handler:
- type: take
n: 2000
- type: AlpacaInstructDataHandler
seq_length: 4096
padding: False
tokenizer:
trust_remote_code: True
padding_side: 'right'
- type: PackingHandler
seq_length: 4096
pack_strategy: 'pack'
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"
ascend_config:
precision_mode: "must_keep_origin_dtype"
parallel_speed_up_json_path: "./configs/qwen3/parallel_speed_up.json"
parallel_config:
data_parallel: &dp 1
model_parallel: 4
pipeline_stage: 4
micro_batch_num: 4
use_seq_parallel: True
gradient_aggregation_group: 1
micro_batch_interleave_num: 1
parallel:
parallel_mode: 1
enable_alltoall: True
full_batch: False
dataset_strategy: [
[*dp, 1],
[*dp, 1],
[*dp, 1],
[*dp, 1]
]
search_mode: "sharding_propagation"
strategy_ckpt_config:
save_file: "./ckpt_strategy.ckpt"
only_trainable_params: False
enable_parallel_optimizer: False
recompute_config:
recompute: True
select_recompute: False
parallel_optimizer_comm_recompute: True
mp_comm_recompute: True
model:
model_config:
qkv_concat: True
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
callbacks:
- type: MFLossMonitor
- type: CheckpointMonitor
prefix: "qwen3"
save_checkpoint_steps: 5000
keep_checkpoint_max: 1
integrated_save: False
async_save: False
checkpoint_format: "safetensors"
runner_wrapper:
type: MFTrainOneStepCell
scale_sense: 1.0
use_clip_grad: True
profile: False
profile_start_step: 1
profile_stop_step: 10
init_start_profile: False
profile_communication: False
profile_memory: True
layer_scale: False
layer_decay: 0.65
lr_scale_factor: 256