code: def _validate_global_rank_world_size(
      world_size: int, rank: int
  ) -> None:
      if world_size < 1:
          raise ValueError(
              f"Invalid world_size value provided: {world_size}. Value must be greater than 0."
          )
      if rank < 0:
          raise ValueError(
              f"Invalid rank value provided: {rank}. Value must be greater than non-negative."
          )
      if rank >= world_size:
          raise ValueError(
              f"Invalid rank and world_size values provided: rank={rank}, world_size={world_size}. Rank must be less than world_size."
          )
  
imports: import os
  import tempfile
  from functools import wraps
  from typing import Any, Callable, cast, List, Optional, TypeVar, Union
  import torch
  import torch.distributed
  import torch.nn.functional
  from torch import Tensor
  from torch.distributed.elastic.utils.distributed import get_free_port
  from typing_extensions import Literal
label_desc: Use image node_id 8 for calling a global function with example usage: _validate_global_rank_world_size(world_size, rank) without return types