Skip to content

Commit

Permalink
Log every 1000 invocations (#2975)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2975

X-link: facebookresearch/FBGEMM#72

Change the logging to every 1000 invocations to reduce verbosity.

Reviewed By: sryap

Differential Revision: D61156253
  • Loading branch information
jma99fb authored and facebook-github-bot committed Aug 12, 2024
1 parent 6a3ff16 commit 6d3a246
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ void EmbeddingKVDB::set(
} else { // no l2 cache
folly::coro::blockingWait(set_kv_db_async(indices, weights, count));
}
XLOG(INFO) << "set_cuda: finished set embeddings in "
<< timer.elapsed().count() << "microseconds.";
XLOG_EVERY_N(INFO, 1000) << "set_cuda: finished set embeddings in "
<< timer.elapsed().count() << " us.";
}

void EmbeddingKVDB::get(
Expand Down Expand Up @@ -113,15 +113,15 @@ void EmbeddingKVDB::get(
set_cache(missed_indices, missed_weights, missed_count);
lookup_memcpy(missed_weights, weights, cacheContext->missed_indices_map);
} else {
XLOG(INFO) << "cache hit 100%";
XLOG_EVERY_N(INFO, 1000) << "cache hit 100%";
folly::coro::blockingWait(
cache_memcpy(weights, cacheContext->cached_address_pairs));
}
} else { // no l2 cache
folly::coro::blockingWait(get_kv_db_async(indices, weights, count));
}
XLOG(INFO) << "get_cuda: finished get embeddings in "
<< timer.elapsed().count() << "microseconds.";
XLOG_EVERY_N(INFO, 1000) << "get_cuda: finished get embeddings in "
<< timer.elapsed().count() << " us.";
}

std::shared_ptr<EmbeddingKVDB::CacheContext> EmbeddingKVDB::get_cache(
Expand Down

0 comments on commit 6d3a246

Please sign in to comment.