Hey @Kanishk_Jain
Sorry about the late response.
    os.environ['MASTER_ADDR'] = 'localhost'
    os.environ['MASTER_PORT'] = '8888'

If you are trying to use the distributed package across multiple machines, the MASTER_ADDR needs to be a routable IP, and localhost is not a routable one. One way to test if the specified IP works is to try if torch.distributed.init_process_group 10 can successfully run.
BTW, could you please post followup questions under the “distributed-rpc” tag? The PT Distributed team subscribes to updates with “distributed” and “distributed-rpc” tags to make sure to join the discussions promptly.