Logging
Logging with Accelerate
Accelerate has its own logging utility to handle logging while in a distributed system. To utilize this replace cases of logging
with accelerate.logging
:
Copied
Setting the log level
The log level can be set with the ACCELERATE_LOG_LEVEL
environment variable or by passing log_level
to get_logger
:
Copied
accelerate.logging.get_logger
( name: strlog_level: str = None )
Parameters
name (
str
) โ The name for the logger, such as__file__
log_level (
str
, optional) โ The log level to use. If not passed, will default to theLOG_LEVEL
environment variable, orINFO
if not
Returns a logging.Logger
for name
that can handle multiprocessing.
If a log should be called on all processes, pass main_process_only=False
If a log should be called on all processes and in order, also pass in_order=True
Example:
Copied
Last updated