code: def test_model_parallel_cuda_manual_seed(tensor_model_parallel_size):
      if torch.distributed.get_rank() == 0:
          print(
              "> testing model parallel cuda manual seed with size {} ...".format(
                  tensor_model_parallel_size
              )
          )
  
      mpu.initialize_model_parallel(tensor_model_parallel_size)
      tensor_model_parallel_size = (
          mpu.get_tensor_model_parallel_world_size()
      )
  
      mpu.model_parallel_cuda_manual_seed(12345)
      assert torch.cuda.initial_seed() == 12345
      with mpu.get_cuda_rng_tracker().fork():
          assert torch.cuda.initial_seed() == (
              12345 + 2718 + mpu.get_tensor_model_parallel_rank()
          )
  
      # Reset the tracker
      mpu.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: megatron-lm/megatron/mpu/tests/test_random.py
imports: from commons import print_separator
  from commons import initialize_distributed
  import mpu
  import torch
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: test_model_parallel_cuda_manual_seed(tensor_model_parallel_size) without return types