Skip to content

Commit 7ccbb34

Browse files
committed
opt trans debug log
1 parent e6d725f commit 7ccbb34

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

ucm/store/cache/cc/dump_queue.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ void DumpQueue::DispatchOneTask(Trans::Stream* stream, size_t tensorSize, TaskPa
8282
{
8383
auto& task = pair.first;
8484
auto& waiter = pair.second;
85+
auto wait = NowTime::Now() - waiter->startTp;
86+
UC_DEBUG("Cache task({}) start running, wait {:06f}s.", task->id, wait);
8587
if (!failureSet_->Contains(task->id)) {
8688
auto s = DumpOneTask(stream, tensorSize, task);
8789
if (s.Failure()) [[unlikely]] { failureSet_->Insert(task->id); }

ucm/store/cache/cc/load_queue.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ void LoadQueue::DispatchOneTask(TaskPair&& pair)
6565
{
6666
auto& task = pair.first;
6767
auto& waiter = pair.second;
68+
auto wait = NowTime::Now() - waiter->startTp;
69+
UC_DEBUG("Cache task({}) start running, wait {:06f}s.", task->id, wait);
6870
if (failureSet_->Contains(task->id)) {
6971
waiter->Done();
7072
return;

ucm/store/cache/cc/trans_manager.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ class TransManager : public Detail::TaskWrapper<TransTask, Detail::TaskHandle> {
5858
const auto num = t->desc.size();
5959
const auto size = shardSize_ * num;
6060
const auto tp = w->startTp;
61-
UC_DEBUG("Dispatch one cache task({},{},{},{}).", id, brief, num, size);
61+
UC_DEBUG("Cache task({},{},{},{}) dispatching.", id, brief, num, size);
6262
w->SetEpilog([id, brief = std::move(brief), num, size, tp] {
6363
auto cost = NowTime::Now() - tp;
64-
UC_DEBUG("Cache task({},{},{},{}) finished, cost {:06f}s, bw={:06f}GB/s.", id, brief,
65-
num, size, cost, size / cost / 1e9);
64+
UC_DEBUG("Cache task({},{},{},{}) finished, cost {:06f}s.", id, brief, num, size, cost);
6665
});
6766
if (t->type == TransTask::Type::LOAD) {
6867
loadQ_.Submit(t, w);

ucm/store/posix/cc/trans_manager.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ class TransManager : public Detail::TaskWrapper<TransTask, Detail::TaskHandle> {
5050
const auto num = t->desc.size();
5151
const auto size = shardSize_ * num;
5252
const auto tp = w->startTp;
53-
UC_DEBUG("Dispatch one posix task({},{},{},{}).", id, brief, num, size);
53+
UC_DEBUG("Posix task({},{},{},{}) dispatching.", id, brief, num, size);
5454
w->SetEpilog([id, brief = std::move(brief), num, size, tp] {
5555
auto cost = NowTime::Now() - tp;
56-
UC_DEBUG("Posix task({},{},{},{}) finished, cost {:06f}s, bw={:06f}GB/s.", id, brief,
57-
num, size, cost, size / cost / 1e9);
56+
UC_DEBUG("Posix task({},{},{},{}) finished, cost {:06f}s.", id, brief, num, size, cost);
5857
});
5958
queue_.Push(t, w);
6059
}

ucm/store/posix/cc/trans_queue.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,16 @@ void TransQueue::Push(TaskPtr task, WaiterPtr waiter)
5151
for (auto&& shard : task->desc) {
5252
ios.emplace_back<IoUnit>({task->id, task->type, std::move(shard), waiter});
5353
}
54+
ios.front().firstIo = true;
5455
pool_.Push(ios);
5556
}
5657

5758
void TransQueue::Worker(IoUnit& ios)
5859
{
60+
if (ios.firstIo) {
61+
auto wait = NowTime::Now() - ios.waiter->startTp;
62+
UC_DEBUG("Posix task({}) start running, wait {:06f}s.", ios.owner, wait);
63+
}
5964
if (failureSet_->Contains(ios.owner)) {
6065
ios.waiter->Done();
6166
return;

ucm/store/posix/cc/trans_queue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class TransQueue {
4444
TransTask::Type type;
4545
Detail::Shard shard;
4646
std::shared_ptr<Latch> waiter;
47+
bool firstIo{false};
4748
};
4849
TaskIdSet* failureSet_;
4950
const SpaceLayout* layout_;

0 commit comments

Comments
 (0)