Skip to content

Commit

Permalink
add support for xpu/KunLunXin device
Browse files Browse the repository at this point in the history
  • Loading branch information
fpzh2011 committed Jul 3, 2024
1 parent 850b4ad commit cce5d8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions oneflow/core/common/device_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ enum DeviceType {
kMeta = 4;
kMLU = 5; // Cambricon MLU
kNPU = 6; // Ascend NPU
kXPU = 7; // KunLunXin
}
2 changes: 2 additions & 0 deletions oneflow/ir/lib/OneFlow/UserOpConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cce5d8c

Please sign in to comment.