I’m trying below sample on multiple machines:

  
      github.com
  
  
    pytorch/examples/blob/master/distributed/rpc/parameter_server/rpc_parameter_server.py 2
import argparse
import os
import time
from threading import Lock

import torch
import torch.distributed.autograd as dist_autograd
import torch.distributed.rpc as rpc
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
from torch.distributed.optim import DistributedOptimizer
from torchvision import datasets, transforms

# --------- MNIST Network to train, from pytorch/examples -----


class Net(nn.Module):
    def __init__(self, num_gpus=0):


  This file has been truncated. show original

  
  
    
    
  
  


When I tried on 2 linux machine in same domain, this sample works fine. But when I try on 2 WSL machine, I can’t make these 2 WSL machine connect with each other, both machines blocking waiting on rpc init.
Tried the " WSL 2 TPC NETWORK FORWARDING" workaround from below post, rpc still can’t connect with each other:

  
      github.com/microsoft/WSL
  
  
    
  
	  
  

  
    
      [WSL 2] NIC Bridge mode 🖧 (Has TCP Workaround🔨) 1
    

    
      
        opened 
        
          
        
        Jun 16, 2019
      
      


      
        
          
          jkasten2
        
      
    
  



  Issue
WSL 2 seems to NAT it's virtual network, instead of making it bridged to the host NIC. My goal is for...



    network


  
  
    
    
  
  


So I’m wondering if there is any working sample/setting for WSL? Any suggestions on how to trouble the issue is also highly appreciated, thanks.