文档首页> AI开发平台ModelArts> 最佳实践> 昇腾业务迁移> LLM训练业务昇腾迁移指导> 常见问题> 训练运行报错AttributeError: 'torch_npu._C._NPUDeviceProperties' object has no attribute 'multi_processor_count'
更新时间:2024-06-07 GMT+08:00
分享

训练运行报错AttributeError: 'torch_npu._C._NPUDeviceProperties' object has no attribute 'multi_processor_count'

问题现象

训练运行报错“AttributeError: 'torch_npu._C._NPUDeviceProperties' object has no attribute 'multi_processor_count'”。

图1 报错信息

原因分析

这是因为torch_npu当前不支持DataParallel(DP)并行模式。

处理方法

如果是运行单卡模式,在训练脚本中加入export ASCEND_RT_VISIBLE_DEVICES=0(指定 0 号卡对当前进程可见)。多卡环境模式需要运行DDP并行模式。

分享:

    相关文档

    相关产品