code: def benchmark(N, provider):
      group_size = 4
      group_A = []
      group_B = []
      A_addrs = []
      B_addrs = []
      C_addrs = []
      g_sizes = []
      g_lds = []
      group_C = []
      for i in range(group_size):
          A = torch.rand((N, N), device="cuda", dtype=torch.float16)
          B = torch.rand((N, N), device="cuda", dtype=torch.float16)
          C = torch.empty((N, N), device="cuda", dtype=torch.float16)
          group_A.append(A)
          group_B.append(B)
          group_C.append(C)
          A_addrs.append(A.data_ptr())
          B_addrs.append(B.data_ptr())
          C_addrs.append(C.data_ptr())
          g_sizes += [N, N, N]
          g_lds += [N, N, N]
  
      d_a_ptrs = torch.tensor(A_addrs, device="cuda")
      d_b_ptrs = torch.tensor(B_addrs, device="cuda")
      d_c_ptrs = torch.tensor(C_addrs, device="cuda")
      d_g_sizes = torch.tensor(
          g_sizes, dtype=torch.int32, device="cuda"
      )
      d_g_lds = torch.tensor(g_lds, dtype=torch.int32, device="cuda")
  
      quantiles = [0.5, 0.2, 0.8]
      if provider == "cublas":
          ms, min_ms, max_ms = triton.testing.do_bench(
              lambda: torch_perf_fn(group_A, group_B),
              quantiles=quantiles,
          )
      if provider == "triton":
          ms, min_ms, max_ms = triton.testing.do_bench(
              lambda: triton_perf_fn(
                  d_a_ptrs,
                  d_b_ptrs,
                  d_c_ptrs,
                  d_g_sizes,
                  d_g_lds,
                  group_size,
              ),
              quantiles=quantiles,
          )
      return ms, max_ms, min_ms
  
imports: import torch
  import triton
  import triton.language
label_desc: Use image node_id 5 for calling a global function with example usage: benchmark(N, provider) and returns: ms,  max_ms,  min_ms