模型或库版本问题:使用的transformers库、PyTorch或torch-npu版本可能存在bug或不兼容的问题。 5. 提供解决方案或建议 尝试手动配置device_map:根据模型的层名或组件大小,手动将模型的不同部分分配到特定的GPU上。这可以避免自动分配可能导致的数据传输问题。例如: python device = {"transformer.h.0": "cuda:0",...
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: Function MatmulBackward0 returned an invalid gradient at index 0 - expected device npu:7 but got npu:0 EI0009: Transport init error. Reason: [Create][DestLink]Create Dest error! cre...
: 1.12.1 (True) - PyTorch XPU available: False - PyTorch NPU available: False - System RAM: 94.30 GB - GPU type: Quadro RTX 5000 - `Accelerate` default config: - compute_environment: LOCAL_MACHINE - distributed_type: MULTI_GPU - mixed_precision: fp16 - use_cpu: False - debug: ...
2.在训练脚本中输入import torch_npu和from torch_npu.contrib import transfer_to_npu 3.运行训练脚本 4.出现NotlmplementedError: Could not run 'aten::empty strided' with arguments from the 'CUDA" backend 5.修改训练脚本中的pretrained dict = torch.jit.load('./viT-B-32.pt', map location="...
A method and device for map switching