code: def test_byoc_microtvm(merge_compiler_regions):
      """
      This is a simple test to check BYOC capabilities of AOT
      with and without merging compiler regions to test for https://github.com/apache/tvm/issues/9036
      """
      use_unpacked_api = False
      interface_api = "packed"
      test_runner = AOTTestRunner(pass_config={"tir.usmp.enable": True})
  
      input_x = relay.var("x", shape=(10, 10))
      input_w0 = relay.var("w0", shape=(10, 10))
      input_w1 = relay.var("w1", shape=(10, 10))
  
      # z0 = x + w0
      marked_input_x = compiler_begin(input_x, "ccompiler")
      marked_input_w0 = compiler_begin(input_w0, "ccompiler")
      add_x_and_w0 = relay.add(marked_input_x, marked_input_w0)
      end_inner_add = compiler_end(add_x_and_w0, "ccompiler")
  
      # z1 = z0 + w1
      marked_inner_add = compiler_begin(end_inner_add, "ccompiler")
      marked_w1 = compiler_begin(input_w1, "ccompiler")
      add_nested_and_w1 = relay.add(marked_inner_add, marked_w1)
      end_outer_add = compiler_end(add_nested_and_w1, "ccompiler")
  
      # z2 = z0 + z1
      final_add = relay.add(end_inner_add, end_outer_add)
  
      relay_func = relay.Function(
          [input_x, input_w0, input_w1], final_add
      )
      mod = tvm.IRModule()
      mod["main"] = relay_func
  
      if merge_compiler_regions:
          mod = transform.MergeCompilerRegions()(mod)
  
      mod = transform.PartitionGraph("mod_name")(mod)
      mod = transform.InferType()(mod)
  
      x_data = [("x", np.random.rand(10, 10).astype("float32"))]
      w_data = [
          ("w{}".format(i), np.random.rand(10, 10).astype("float32"))
          for i in range(2)
      ]
  
      map_inputs = OrderedDict(x_data + w_data)
      output_list = generate_ref_data(mod, map_inputs)
  
      compiled_test_mods = compile_models(
          AOTTestModel(
              name="my_mod",
              module=mod,
              inputs=map_inputs,
              outputs=output_list,
          ),
          interface_api=interface_api,
          use_unpacked_api=use_unpacked_api,
          pass_config=test_runner.pass_config,
      )
  
      for compiled_model in compiled_test_mods:
          _check_for_no_tvm_backendallocworkspace_calls(
              compiled_model.executor_factory.lib
          )
  
      run_and_check(
          models=compiled_test_mods,
          runner=test_runner,
          interface_api=interface_api,
      )
  
imports: from collections import OrderedDict
  import re
  import random
  import numpy
  import pytest
  import tvm
  from tvm import relay
  from tvm.relay import testing
  from tvm.relay import transform
  from tvm.relay.op.annotation import compiler_begin, compiler_end
  from tvm.relay.backend import Executor, Runtime
  from tvm import WorkspaceMemoryPools, ConstantMemoryPools, WorkspacePoolInfo, ConstantPoolInfo, PoolInfoProperties
  from tvm.micro import model_library_format
  from tvm.micro.testing.aot_test_utils import parametrize_aot_options
  from tvm.testing.aot import AOTTestModel, AOTTestRunner, generate_ref_data, compile_and_run, compile_models, run_and_check, create_relay_module_and_inputs_from_tflite_file
  from tvm.testing.usmp import is_tvm_backendallocworkspace_calls
label_desc: Use image node_id 5 for calling a global function with example usage: test_byoc_microtvm(merge_compiler_regions) without return types