RankZeroCallback

class composer.core.callback.RankZeroCallback[source]

Bases: composer.core.callback.Callback, abc.ABC

Base class for callbacks that should only run on the rank 0 process.

This ensures that after a DDP fork, callback methods will execute only once per rank. Note that init() and load_state_dict() are executed before the DDP fork and will be called on all ranks.