code: def calculate_runtime(f, *args) -> float:
      """
      Assumes all inputs are fp32
      """
      metrics.reset()
      torch._dynamo.optimize(count_bytes_inductor)(f)(*args)
      print(metrics.node_runtimes)
  
      ret = 0.0
      for pair in metrics.node_runtimes:
          ret += pair[1]
  
      return ret
  
imports: import torch
  from torch._inductor import metrics
  from torch._inductor.compile_fx import compile_fx, count_bytes_inner
  from torch.testing._internal.common_utils import TestCase
  from torch.testing._internal.inductor_utils import HAS_CUDA
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_runtime(f) and returns: ret