git clone https://gitee.com/ascend/AscendSpeed cd AscendSpeed mkdir logs mkdir ckpt
conda create -n (conda环境名称) python=3.7 conda activate (conda环境名称)
# 安装torch: pip install torch==1.11 -i https://pypi.tuna.tsinghua.edu.cn/simple # 安装torch_npu: wget https://gitee.com/ascend/pytorch/releases/download/v5.0.rc2-pytorch1.11.0/torch_npu-1.11.0.post1-cp37-cp37m-linux_aarch64.whl (ARM) wget https://gitee.com/ascend/pytorch/releases/download/v5.0.rc2-pytorch1.11.0/torch_npu-1.11.0.post1-cp37-cp37m-linux_x86_64.whl (X86) pip install torch_npu-1.11.0.post1-cp37-cp37m-linux_XXXXXX.whl
pip install deepspeed==0.9.2 git clone https://gitee.com/ascend/DeepSpeed.git -b v0.9.2 deepspeed_npu cd deepspeed_npu pip3 install -e .
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
wget http://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json
mkdir dataset
# 执行preprocess_data.py
python tools/preprocess_data.py \
--input alpaca_data.json \
--output-prefix dataset/alpaca \
--tokenizer-type PretrainedFromHF \
--tokenizer-name-or-path llama-7b-hf \
--tokenizer-not-use-fast \
--handler-name GeneralInstructionHandler
sh examples/llama2/pretrain_llama_ptd_7B.sh