diff --git a/oneflow/core/common/device_type.proto b/oneflow/core/common/device_type.proto index 08e702b3232..2d39fdd18ed 100644 --- a/oneflow/core/common/device_type.proto +++ b/oneflow/core/common/device_type.proto @@ -9,4 +9,5 @@ enum DeviceType { kMeta = 4; kMLU = 5; // Cambricon MLU kNPU = 6; // Ascend NPU + kXPU = 7; // KunLunXin } diff --git a/oneflow/ir/lib/OneFlow/UserOpConversion.cpp b/oneflow/ir/lib/OneFlow/UserOpConversion.cpp index da289cdc6fa..0b040420268 100644 --- a/oneflow/ir/lib/OneFlow/UserOpConversion.cpp +++ b/oneflow/ir/lib/OneFlow/UserOpConversion.cpp @@ -488,6 +488,8 @@ ::oneflow::DeviceType getDeviceTypeFromAttrDictionary(DictionaryAttr attributes) return ::oneflow::DeviceType::kMLU; } else if (device_tag.str() == "npu") { return ::oneflow::DeviceType::kNPU; + } else if (device_tag.str() == "xpu") { + return ::oneflow::DeviceType::kXPU; } else { LOG(FATAL) << "unsupported device tag: " << device_tag.str(); return ::oneflow::DeviceType::kInvalidDevice;