mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix RPC get_worker_info for rank=0 (#52804)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/52804 `rpc.get_worker_info` used to only take string in v1.6. We recently allow it to accept `int` and `WorkerInfo`, but the previous check on `worker_name` is no longer correct. This commit adds explicit `not None` check. Test Plan: Imported from OSS Reviewed By: rohan-varma Differential Revision: D26655089 Pulled By: mrshenli fbshipit-source-id: fa1545bd6dd2b33bc1e919de46b94e799ab9719c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f71d9e28f9
commit
1ac59d9db3
@ -347,7 +347,7 @@ def get_worker_info(worker_name=None):
|
||||
``worker_name`` or :class:`~torch.distributed.rpc.WorkerInfo` of the
|
||||
current worker if ``worker_name`` is ``None``.
|
||||
"""
|
||||
if worker_name:
|
||||
if worker_name is not None:
|
||||
return _get_current_rpc_agent().get_worker_info(worker_name)
|
||||
else:
|
||||
return _get_current_rpc_agent().get_worker_info()
|
||||
|
Reference in New Issue
Block a user