code: def schedule_unrollable_gemm(cfg, s, A, B, C, R):
      """Schedule a GEMM that can be unrolled by a constant factor
      along its inner dimension
  
      Parameters
      ----------
      cfg : Config
          Schedule configuration
  
      s : tvm.te.schedule.Schedule
          Operator schedule
  
      A : tvm.te.Tensor
          2D/3D Tensor, shape [n, k]/[b, n, k]
  
      B : tvm.te.Tensor
          2D/3D Tensor, shape [k, m]/[b, k, m]
  
      C : tvm.te.Tensor
          2D/3D Tensor, shape [n, m]/[b, n, m]
  
      R : tvm.te.Tensor
          2D Tensor, shape [n, m]
  
      """
      # If the GEMM is 2D, no unrolling has taken place
      # Use non-batched GEMM schedule and inline identity matrices A, B and R
      if len(C.op.axis) == 2:
          s[A].compute_inline()
          s[B].compute_inline()
          schedule_gemm(cfg, s, A, B, C)
          s[R].compute_inline()
  
      # GEMM is 3D, use batched GEMM schedule, inline A and B and schedule R
      else:
          s[A].compute_inline()
          s[B].compute_inline()
          schedule_gemm(cfg, s, A, B, C, batched=True)
  
          CR_C = s.cache_read(C, "local", [R])
  
          y, x = s[R].op.axis
          xo, xi = s[R].split(x, 4)
          k = s[R].op.reduce_axis[0]
          s[R].reorder(k, xi)
          ko, ki = s[R].split(k, 4)
          s[R].unroll(xi)
          s[R].unroll(ki)
          tile_and_bind(s, R, y, xo, 1, 2)
  
          s[CR_C].compute_at(s[R], ko)
          _, y, x = s[CR_C].op.axis
          s[CR_C].unroll(y)
          s[CR_C].vectorize(x)
  
file_path: tvm/python/tvm/topi/bifrost/gemm.py
imports: from tvm import te
  from .transforms import tile_and_bind, tile_and_bind3d, interleave_transpose, transpose_interleave
  from ..None import utils
label_desc: Use image node_id 5 for calling a global function with example usage: schedule_unrollable_gemm(cfg, s, A, B, C, R) without return types