code: def extract(outputs):
      best_gemm_algos = []
      col32_algo_info = GemmAlgoInfo()
      col_algo_info = GemmAlgoInfo()
  
      def fill_algo_info(algo_info, line):
          algo_info.data_order = line.split()[2]
          algo_info.algo_id = int(line.split("Id=")[1].split(",")[0])
          algo_info.tile = int(line.split("tileIdx=")[1].split("(")[0])
          algo_info.splitk = int(line.split("splitK=")[1].split()[0])
          algo_info.reduc = int(line.split("reduc=")[1].split()[0])
          algo_info.swizzle = int(line.split("swizzle=")[1].split()[0])
          algo_info.custom = int(line.split("custom=")[1].split()[0])
          algo_info.stages = int(line.split("stages=")[1].split("}")[0])
          algo_info.workspace = int(
              line.split("workspace=")[1].split()[0]
          )
  
      for line in outputs:
          if line.startswith(">>>"):
              col32_algo_info.speedup = (
                  col32_algo_info.fp16_time / col32_algo_info.int8_time
              )
              col_algo_info.speedup = (
                  col_algo_info.fp16_time / col_algo_info.int8_time
              )
              best_gemm_algos.append(deepcopy(col32_algo_info))
              best_gemm_algos.append(deepcopy(col_algo_info))
          elif line.startswith("m "):
              shape = tuple(
                  [int(s.split()[1]) for s in line.split(";")]
              )
              col32_algo_info.shape = shape
              col_algo_info.shape = shape
          elif line.startswith("Device"):
              sm = int(line.split("SM")[1].strip()[:-1])
              col32_algo_info.sm = sm
              col_algo_info.sm = sm
          elif line.startswith("FP16 NN-gemm"):
              fp16_time = float(line.split("exec_time")[1].strip()[:-4])
              col32_algo_info.fp16_time = fp16_time
              col_algo_info.fp16_time = fp16_time
          elif line.startswith("INT8 NT-gemm with"):
              col32_time = float(
                  line.split("exec_time")[1].strip()[:-4]
              )
              col32_algo_info.int8_time = col32_time
          elif line.startswith("INT8 TN-gemm with"):
              col_time = float(line.split("exec_time")[1].strip()[:-4])
              col_algo_info.int8_time = col_time
          elif line.startswith("INT8 NT-gemm"):
              fill_algo_info(col32_algo_info, line)
          elif line.startswith("INT8 TN-gemm"):
              fill_algo_info(col_algo_info, line)
  
      return best_gemm_algos
  
file_path: lightseq/lightseq/training/ops/pytorch/gemm_test.py
imports: import os
  import functools
  from dataclasses import dataclass
  from copy import deepcopy
  from tqdm import tqdm
  from lightseq.training.ops.pytorch.builder import KernelBuilder
label_desc: Use image node_id 5 for calling a global function with example usage: extract(outputs) and returns: best_gemm_algos