Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: 昇腾910b运行llama_npu_sft_N1C8.sh时报错 #9469

Open
feria-tu opened this issue Nov 21, 2024 · 0 comments
Open

[Question]: 昇腾910b运行llama_npu_sft_N1C8.sh时报错 #9469

feria-tu opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@feria-tu
Copy link

请提出你的问题

修改了llama_npu_sft_N1C8.sh中的卡数和模型,修改后文件具体如下,开始训练时报了这个错误:OSError: The mask tensor dtype must be bool , but got bfloat16
[/paddle/backends/npu/custom_op/fused_attention_npu.cc:214]

llama_npu_sft_N1C8.sh文件内容:
set -x

max_steps=${1:-100}

export GLOG_v=0
export FLAGS_npu_storage_format=1
export FLAGS_use_stride_kernel=0
export HCCL_OP_BASE_FFTS_MODE_ENABLE=TRUE
export MULTI_STREAM_MEMORY_REUSE=1
export HCCL_INTRA_PCIE_ENABLE=0
export HCCL_INTRA_ROCE_ENABLE=1
export FLAGS_allocator_strategy=naive_best_fit
export ASCEND_RT_VISIBLE_DEVICES="0,1,2,3"
export FLAGS_NPU_MC2=1
export MC2_Recompute=1

source /usr/local/Ascend/ascend-toolkit/set_env.sh
export PYTHONPATH=../../../:$PYTHONPATH
ps aux | grep run_finetune.py | grep -v grep | awk '{print $2}' | xargs kill -9

python -u -m paddle.distributed.launch
--devices "0,1,2,3"
--log_dir "./sft_bf16_qwen_N1C4"
../../run_finetune.py
--device "npu"
--model_name_or_path "Qwen/Qwen2.5-7B-Instruct"
--dataset_name_or_path "data/"
--output_dir "./output/sft_bf16_qwen_N1C4"
--per_device_train_batch_size 2
--gradient_accumulation_steps 64
--per_device_eval_batch_size 1
--eval_accumulation_steps 1
--max_steps ${max_steps}
--learning_rate 3e-06
--warmup_steps 20
--save_steps 1000
--logging_steps 1
--evaluation_strategy "epoch"
--src_length 1024
--max_length 4096
--bf16 true
--fp16_opt_level "O2"
--do_train true
--tensor_parallel_output true
--disable_tqdm true
--eval_with_do_generation false
--metric_for_best_model "accuracy"
--recompute false
--tensor_parallel_degree 4
--pipeline_parallel_degree 1
--zero_padding 0
--amp_master_grad true
--fuse_attention_qkv true
--fuse_attention_ffn true
--sequence_parallel 1
--use_flash_attention 1
--use_fused_rope 1
--use_fused_rms_norm 1
--sharding_parallel_degree 1
--pad_to_multiple_of 4096
--sharding "stage1"
--sharding_parallel_config "enable_stage1_tensor_fusion enable_stage1_overlap"

@feria-tu feria-tu added the question Further information is requested label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants