Skip to content

Commit

Permalink
add fc hit rate log (PaddlePaddle#46)
Browse files Browse the repository at this point in the history
* add fc hit rate log

---------

Co-authored-by: Yeeland <[email protected]>
  • Loading branch information
YeelandX and Yeeland authored Jan 24, 2024
1 parent ecefd72 commit 4e3c83d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions paddle/fluid/framework/fleet/box_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,13 @@ void BoxWrapper::PrintSyncTimer(int device, double train_span) {
<< ", dense nccl:" << dev.dense_nccl_timer.ElapsedSec()
<< ", sync stream:" << dev.dense_sync_timer.ElapsedSec()
<< ", wrapper xpu memory:" << dev.GpuMemUsed() << "MB";

auto env_str = std::getenv("ENABLE_FC_HIT_RATE");
if (env_str != nullptr && (strcmp(env_str, "true") == 0 || strcmp(env_str, "1") == 0)) {
auto place = platform::XPUPlace(device);
auto xpu_context = static_cast<platform::XPUDeviceContext*>(platform::DeviceContextPool::Instance().Get(place))->x_context();
LOG(INFO) << "xpu: " << device << ", fc_hit_rate: " << xpu_context->get_fc_hit_rate();
}
#else
LOG(WARNING) << "cpu: " << device << ", phase: " << phase_
<< ", train dnn: " << train_span
Expand Down

0 comments on commit 4e3c83d

Please sign in to comment.