MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / print_rank0

Function print_rank0

SwissArmyTransformer/sat/helpers.py:127–137  ·  view source on GitHub ↗
(msg, level=logging.INFO, flush=True)

Source from the content-addressed store, hash-verified

125logger = configure_logging()
126
127def print_rank0(msg, level=logging.INFO, flush=True):
128 if isinstance(level, str):
129 level = getattr(logging, level.upper())
130 if torch.distributed.is_initialized():
131 msg = f"[RANK {torch.distributed.get_rank()}] {msg}"
132 if torch.distributed.get_rank() == 0:
133 logger.log(level=level, msg=msg)
134 if flush:
135 logger.handlers[0].flush()
136 else:
137 logger.log(level=level, msg=msg)
138
139def print_all(msg, level=logging.INFO, flush=True):
140 if isinstance(level, str):

Callers 15

_adjust_vocab_sizeFunction · 0.90
_simple_initFunction · 0.90
get_argsFunction · 0.90
update_args_with_fileFunction · 0.90
initialize_distributedFunction · 0.90
__init__.pyFile · 0.90
layernorm.pyFile · 0.90
get_tokenizerFunction · 0.90
quantizeFunction · 0.90
filling_sequenceFunction · 0.90
stream_filling_sequenceFunction · 0.90

Calls 1

logMethod · 0.80

Tested by

no test coverage detected