code: def get_msg_size_from_args(func, *args, **kwargs):
      # 3 cases:
      #   - tensor arg is in args
      #   - tensor arg is in kwargs
      #   - tensor arg is not present (e.g. barrier)
      tensor_arg_position = -1
      tensor_arg = None
      # check if tensor arg is in args
      if len(args) > 0:
          tensor_arg_position = get_tensor_position(func)
          if tensor_arg_position > -1:
              tensor_arg = args[get_tensor_position(func)]
      # check if tensor arg is in kwargs
      if tensor_arg is None and len(kwargs) > 0:
          tensor_arg = get_tensor_kwarg(func, kwargs)
      # if tensor arg is not present, no data is being transmitted
      if tensor_arg is None:
          return 0
      else:
          # Sum of tensor sizes for list colls such as torch's all_to_all
          # NOTE: msg_size for list colls will not be the actual size transmitted by a given MPI/NCCL call within the coll op. Instead, it's the total amount of data transmitted.
          if type(tensor_arg) is list:
              return sum(
                  x.element_size() * x.nelement() for x in tensor_arg
              )
          else:
              return tensor_arg.element_size() * tensor_arg.nelement()
  
file_path: DeepSpeed/deepspeed/comm/utils.py
imports: import os
  import inspect
  from deepspeed.utils import get_caller_func
label_desc: Use image node_id 7 for calling a global function with example usage: get_msg_size_from_args(func) and returns: int, sum, unknown