Skip to content

Commit c075f0f

Browse files
H-Huangfacebook-github-bot
authored andcommitted
Update rpc testing to include USE_TENSORPIPE directive (pytorch#68080)
Summary: Pull Request resolved: pytorch#68080 Fixes pytorch#68002 After FaultyProcessGroupAgent was replaced with FaultyTensorpipeAgent there is now a dependency on Tensorpipe for rpc testing. However, if user does not have USE_TENSORPIPE enabled they will hit an issue such `undeclared identifier 'FaultyTensorPipeRpcBackendOptions'`. This is for testing the faulty agent method so it should not block compilation. Update to wrap the Tensorpipe specific code in a directive. cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse SciPioneer H-Huang Test Plan: Imported from OSS Reviewed By: mrshenli Differential Revision: D32292861 Pulled By: H-Huang fbshipit-source-id: 4ffb879860ced897674728200a1831f18fea0a4a
1 parent a3bb95c commit c075f0f

File tree

1 file changed

+2
-0
lines changed
  • torch/csrc/distributed/rpc/testing

1 file changed

+2
-0
lines changed

torch/csrc/distributed/rpc/testing/init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ PyObject* faulty_agent_init(PyObject* _unused, PyObject* noargs) {
3434
// Import the rpc_module so we can subclass TensorPipeAgent
3535
py::module rpc_module = py::module::import("torch.distributed.rpc");
3636

37+
#ifdef USE_TENSORPIPE
3738
shared_ptr_class_<FaultyTensorPipeRpcBackendOptions>(
3839
module,
3940
"FaultyTensorPipeRpcBackendOptions",
@@ -125,6 +126,7 @@ PyObject* faulty_agent_init(PyObject* _unused, PyObject* noargs) {
125126
(std::vector<WorkerInfo>(TensorPipeAgent::*)() const) &
126127
TensorPipeAgent::getWorkerInfos,
127128
py::call_guard<py::gil_scoped_release>());
129+
#endif // USE_TENSORPIPE
128130

129131
Py_RETURN_TRUE;
130132
}

0 commit comments

Comments
 (0)