Accelerate documentation
Logging with Accelerate
Getting started
Tutorials
OverviewAdd Accelerate to your codeExecution processTPU trainingLaunching distributed codeLaunching distributed training from Jupyter Notebooks
How to guides
Accelerate
Start Here!Model memory estimatorModel quantizationExperiment trackersSave and load training statesTroubleshootExample Zoo
Training
Gradient accumulationLocal SGDLow precision (FP8) trainingDeepSpeedFully Sharded Data ParallelismMegatron-LMAmazon SageMakerApple M1 GPUsIPEX training with CPU
Inference
Concepts and fundamentals
🤗 Accelerate's internal mechanismLoading big models into memoryComparing performance across distributed setupsExecuting and deferring jobsGradient synchronizationHow training in low-precision environments is possible (FP8)TPU best practices
Reference
AcceleratorStateful configuration classesThe Command LineTorch wrapper classesExperiment trackersDistributed launchersDeepSpeed utilitiesLoggingWorking with large modelsDistributed inference with big modelsKwargs handlersUtility functions and classesMegatron-LM UtilitiesFully Sharded Data Parallelism Utilities
You are viewing v0.29.3 version. A newer version v1.13.0 is available.
Logging with Accelerate
Refer to the Troubleshooting guide or to the example below to learn how to use 🤗 Accelerate’s logger.
accelerate.logging.get_logger
< source >( name: str log_level: str = None )
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:
>>> from accelerate.logging import get_logger
>>> from accelerate import Accelerator
>>> logger = get_logger(__name__)
>>> accelerator = Accelerator()
>>> logger.info("My log", main_process_only=False)
>>> logger.debug("My log", main_process_only=True)
>>> logger = get_logger(__name__, log_level="DEBUG")
>>> logger.info("My log")
>>> logger.debug("My second log")
>>> array = ["a", "b", "c", "d"]
>>> letter_at_rank = array[accelerator.process_index]
>>> logger.info(letter_at_rank, in_order=True)