Accelerate has its own logging utility to handle logging while in a distributed system.
To utilize this replace cases of
- import logging + from accelerate.logging import get_logger - logger = logging.getLogger(__name__) + logger = get_logger(__name__)
The log level can be set with the
ACCELERATE_LOG_LEVEL environment variable or by passing
from accelerate.logging import get_logger logger = get_logger(__name__, log_level="INFO")
accelerate.logging.get_logger< source >
( name: str log_level: str = None )
name that can handle multiprocessing.
If a log should be called on all processes, pass