MCPcopy Index your code
hub / github.com/pytorch/examples / rank_log

Function rank_log

distributed/tensor_parallelism/log_utils.py:12–15  ·  view source on GitHub ↗

helper function to log only on global rank 0

(_rank, logger, msg)

Source from the content-addressed store, hash-verified

10
11
12def rank_log(_rank, logger, msg):
13 """helper function to log only on global rank 0"""
14 if _rank == 0:
15 logger.info(f" {msg}")
16
17
18def verify_min_gpu_count(min_gpus: int = 2) -> bool:

Calls

no outgoing calls

Tested by

no test coverage detected