code: def print_roofline_performance(dims: MatmulSize, time_ms: float):
      """Print theoretical roofline model performance."""
      gbps: float = triton.testing.get_dram_gbps()
      tflops: float = triton.testing.get_max_tensorcore_tflops(
          torch.bfloat16
      )
      lhs_size_bytes = dims.M * dims.K
      rhs_size_bytes = dims.K * dims.N * 2
      out_size_bytes = dims.M * dims.N * 2
  
      size_gb = (lhs_size_bytes + rhs_size_bytes + out_size_bytes) / 1e9
      roofline_time_ms_bw = (size_gb / gbps) * 1e3
      roofline_time_ms_flops = (
          2 * (dims.M * dims.N * dims.K) / (tflops * 1e9)
      )
  
      best_time_ms = max(roofline_time_ms_bw, roofline_time_ms_flops)
      bound = (
          "bandwidth"
          if roofline_time_ms_bw > roofline_time_ms_flops
          else "flops"
      )
  
      print(
          f"Percentage of roofline: {(best_time_ms * 100 / time_ms):0.4f}%"
          f" ({bound} bound)"
      )
  
      print(
          f"Roofline time if bandwidth bound: {roofline_time_ms_bw:0.4f}ms"
      )
      print(
          f"Roofline time if flops bound: {roofline_time_ms_flops:0.4f}ms"
      )
  
imports: import enum
  import itertools
  import logging
  import math
  import typing
  import torch
  import tqdm
  import triton
  import triton.language
label_desc: Use image node_id 14 for calling a global function with example usage: print_roofline_performance(dims, time_ms) without return types