code: def run_test_model_parallel_cuda_manual_seed(
      rank, model_parallel_size, filename, filename_rpc
  ):
      dist_init(rank, model_parallel_size, filename, filename_rpc)
  
      if torch.distributed.get_rank() == 0:
          print(
              "> testing model parallel cuda manual seed with size {} ...".format(
                  model_parallel_size
              )
          )
  
      mpu.initialize_model_parallel(model_parallel_size)
      model_parallel_size = mpu.get_model_parallel_world_size()
  
      model_parallel_cuda_manual_seed(12345)
      assert torch.cuda.initial_seed() == 12345
      with get_cuda_rng_tracker().fork():
          assert torch.cuda.initial_seed() == (
              12345 + 2718 + mpu.get_model_parallel_rank()
          )
  
      # Reset the tracker
      get_cuda_rng_tracker().reset()
  
      # Reset groups
      mpu.destroy_model_parallel()
  
      torch.distributed.barrier()
      if torch.distributed.get_rank() == 0:
          print(">> passed the test :-)")
  
file_path: fairscale/tests/nn/model_parallel/test_random.py
imports: import torch
  from fairscale.fair_dev.testing.testing import dist_init, spawn_for_all_world_sizes
  from fairscale.nn.model_parallel import initialize
  from fairscale.nn.model_parallel import random
  from fairscale.nn.model_parallel.random import get_cuda_rng_tracker, model_parallel_cuda_manual_seed
label_desc: Use image node_id 3 for calling a global function with example usage: run_test_model_parallel_cuda_manual_seed(rank, model_parallel_size, filename, filename_rpc) without return types