How do you get the rank in a callback in distributed pytorch lightning

I’m using a callback and want to get the rank in that callback when running with torch elastic, what’s the best way to do that?