Skip to content

Commit

Permalink
support KL2
Browse files Browse the repository at this point in the history
  • Loading branch information
QingshuChen committed Jul 29, 2021
1 parent 288e247 commit 05725ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmake/external/xpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ELSE ()
ENDIF()

SET(XPU_BASE_URL_WITHOUT_DATE "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20210701")
SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20210729")
SET(XPU_XRE_URL "${XPU_BASE_URL}/${XPU_XRE_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
SET(XPU_XDNN_URL "${XPU_BASE_URL}/${XPU_XDNN_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
SET(XPU_XCCL_URL "${XPU_BASE_URL_WITHOUT_DATE}/20210623/${XPU_XCCL_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
Expand Down
18 changes: 7 additions & 11 deletions paddle/fluid/platform/xpu/xpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,19 @@ void SetXPUDeviceId(int id) {
}

XPUVersion get_xpu_version(int dev_id) {
// uint64_t v = 0;
/*
uint64_t v = 0;
int ret = xpu_device_get_attr(&v, XPUATTR_MODEL, dev_id);
PADDLE_ENFORCE_EQ(ret, XPU_SUCCESS,
platform::errors::External(
"xpu_device_get_attr return wrong value[%d]",
ret));
platform::errors::External(
"xpu_device_get_attr return wrong value[%d]", ret));

if (v == K100 || v == K200) {
VLOG(1) << "KUNLUN device " << dev_id << " is XPU1\n";
return XPU1;
VLOG(1) << "KUNLUN device " << dev_id << " is XPU1\n";
return XPU1;
} else {
VLOG(1) << "KUNLUN device " << dev_id << " is XPU2\n";
return XPU2;
VLOG(1) << "KUNLUN device " << dev_id << " is XPU2\n";
return XPU2;
}
*/
return XPU1;
}

} // namespace platform
Expand Down

1 comment on commit 05725ea

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.