code: def initialize_rpc_workers(local_rank, world_size, ctx):
      # Get RPC configuration options from model YAML config
      rpc_timeout = ctx.model_yaml_config["pippy"]["rpc_timeout"]
      num_worker_threads = ctx.model_yaml_config["pippy"][
          "num_worker_threads"
      ]
      options = rpc.TensorPipeRpcBackendOptions(
          num_worker_threads=num_worker_threads, rpc_timeout=rpc_timeout
      )
  
      # Set up device mapping for RPC workers
      n_devs = torch.cuda.device_count()
      dev_id = local_rank % n_devs
      for i in range(world_size):
          options.set_device_map(f"worker{i}", {dev_id: i % n_devs})
  
      # Initialize RPC worker
      logger.info(
          f"rank = {local_rank} pid/device = " f"{os.getpid()}/{dev_id}"
      )
      rpc.init_rpc(
          f"worker{local_rank}",
          rank=local_rank,
          world_size=world_size,
          rpc_backend_options=options,
      )
  
file_path: serve/ts/handler_utils/distributed/pt_pippy.py
imports: import importlib
  import inspect
  import logging
  import os
  import pippy
  import torch
  import torch.distributed.rpc
label_desc: Use image node_id 1 for calling a global function with example usage: initialize_rpc_workers(local_rank, world_size, ctx) without return types