Add API usage logging for several other RPC APIs. (#67722)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67722

ghstack-source-id: 142259452

Test Plan: waitforbuildbot

Reviewed By: jaceyca, fduwjj

Differential Revision: D32118872

fbshipit-source-id: 041ab5601221b1846c56ce4bb63364bec9ad28b0
This commit is contained in:
Pritam Damania
2021-11-03 14:00:23 -07:00
committed by Facebook GitHub Bot
parent 5fd93fb5f8
commit 05e17e7ff6
5 changed files with 7 additions and 1 deletions

View File

@ -121,6 +121,7 @@ TypePtr tryInferTypeWithTypeHint(
PyRRef::PyRRef(c10::intrusive_ptr<RRef> rref)
: rref_(std::move(rref)), profilingFuture_(c10::nullopt) {
TORCH_CHECK(rref_, "PyRRef must not wrap nullptr");
C10_LOG_API_USAGE_ONCE("torch.distributed.rref");
}
PyRRef::PyRRef(const py::object& value, const py::object& type_hint)
@ -181,6 +182,7 @@ std::string PyRRef::ownerName() const {
}
py::object PyRRef::toHere(const float timeoutSeconds) const {
C10_LOG_API_USAGE_ONCE("torch.distributed.rref.to_here");
if (rref_->isOwner()) {
return localValue();
} else {