运行GPT-3模型(PyTorch)时,出现Megatron requires CUDA的报错提示。
CUDA是GPU的驱动,在NPU环境上跑GPT-3模型,出现Megatron requires CUDA的错误提示,有以下原因:
可执行pip list | grep -i megatron_npu命令,查看当前环境是否有安装megatron_npu包。
git clone https://gitee.com/ascend/Megatron-LM.git megatron_npu
cd megatron_npu pip install -e .
export PYTHONPATH=megatron_npu包绝对路径:$PYTHONPATH
ENV PYTHONPATH=megatron_npu包绝对路径:$PYTHONPATH