Skip to content

Custom callback to stop training in DDP. #13834

Discussion options

You must be logged in to vote

Hi @m-lyon,

Use trainer.strategy.barrier() to ensure all processes are at the same line. It is strategy-agnostic, so when you're using a single device, for example, it will be just no-op.
https://pytorch-lightning.readthedocs.io/en/latest/api/pytorch_lightning.strategies.Strategy.html#pytorch_lightning.strategies.Strategy.barrier

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@m-lyon
Comment options

@akihironitta
Comment options

@DanTremonti
Comment options

Answer selected by m-lyon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Generic distributed-related topic
4 participants