File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
pytorch_lightning/utilities Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2525from pytorch_lightning .utilities .rank_zero import rank_zero_only # noqa: F401
2626from pytorch_lightning .utilities .rank_zero import rank_zero_deprecation
2727from pytorch_lightning .utilities .rank_zero import rank_zero_info as new_rank_zero_info
28+ from pytorch_lightning .utilities .rank_zero import rank_zero_warn as new_rank_zero_warn
2829
2930if _TPU_AVAILABLE :
3031 import torch_xla .core .xla_model as xm
@@ -281,23 +282,23 @@ def register_ddp_comm_hook(
281282 ... ddp_comm_wrapper=default.fp16_compress_wrapper,
282283 ... )
283284 """
284- from pytorch_lightning .utilities import rank_zero_warn
285-
286285 if ddp_comm_hook is None :
287286 return
288287 # inform mypy that ddp_comm_hook is callable
289288 ddp_comm_hook : Callable = ddp_comm_hook
290289
291290 if ddp_comm_wrapper is not None :
292291 if not _TORCH_GREATER_EQUAL_1_9 :
293- rank_zero_warn ("Not applying DDP comm wrapper. To use communication wrapper, please use pytorch>=1.9.0." )
292+ new_rank_zero_warn (
293+ "Not applying DDP comm wrapper. To use communication wrapper, please use pytorch>=1.9.0."
294+ )
294295 else :
295296 new_rank_zero_info (
296297 f"DDP comm wrapper is provided, apply { ddp_comm_wrapper .__qualname__ } ({ ddp_comm_hook .__qualname__ } )."
297298 )
298299 ddp_comm_hook = ddp_comm_wrapper (ddp_comm_hook )
299300
300- rank_zero_debug (f"Registering DDP comm hook: { ddp_comm_hook .__qualname__ } ." )
301+ new_rank_zero_debug (f"Registering DDP comm hook: { ddp_comm_hook .__qualname__ } ." )
301302 model .register_comm_hook (state = ddp_comm_state , hook = ddp_comm_hook )
302303
303304
You can’t perform that action at this time.
0 commit comments