code: def test_dense_rocm_sdot4():
      data_shape = (32, 96)
      weight_shape = (128, 96)
  
      data_dtype = "int8"
      data = relay.var("data", shape=data_shape, dtype=data_dtype)
      weight = relay.var("weight", shape=weight_shape, dtype="int8")
      bias = relay.var("bias", shape=(weight_shape[0],), dtype="int32")
      dense = relay.nn.dense(data, weight, out_dtype="int32")
      out = relay.nn.bias_add(dense, bias)
      mod = tvm.IRModule.from_expr(out)
  
      target = "rocm -mattr=+dotprod"
      with tvm.transform.PassContext(opt_level=3):
          lib = relay.build(mod, target=target)
  
      asm = lib.lib.imported_modules[0].get_source("asm")
      assert "v_dot4_i32_i8" in asm
  
      dev = tvm.device(target, 0)
      runtime = tvm.contrib.graph_executor.GraphModule(
          lib["default"](dev)
      )
  
      a = np.random.uniform(1, 10, size=data_shape).astype(data_dtype)
      b = np.random.uniform(1, 10, size=weight_shape).astype("int8")
      c = np.random.uniform(1, 10, size=(weight_shape[0],)).astype(
          "int32"
      )
  
      runtime.set_input("data", a)
      runtime.set_input("weight", b)
      runtime.set_input("bias", c)
      runtime.run()
  
      out = runtime.get_output(0).numpy()
      ref = np.dot(a.astype("int32"), b.transpose().astype("int32")) + c
  
      np.testing.assert_equal(out, ref)
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  import scipy
  from tvm import relay
  import pytest
  from tvm.relay.testing import run_infer_type
  import tvm.topi.testing
  from tvm.contrib.nvcc import have_fp16
  import tvm.testing
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 31 for calling a global function with example usage: test_dense_rocm_sdot4() without return types