Returns a local VM for the given mod and the device
(mod, exec_mode, temp)
| 1116 | |
| 1117 | |
| 1118 | def make_vm(mod, exec_mode, temp) -> tuple[relax.VirtualMachine, tvm.runtime.Device]: |
| 1119 | """Returns a local VM for the given mod and the device""" |
| 1120 | target = tvm.target.Target("llvm", host="llvm") |
| 1121 | exec = relax.build(mod, target, exec_mode=exec_mode) |
| 1122 | libname = temp.relpath("exec.so") |
| 1123 | exec.export_library(libname) |
| 1124 | exec_loaded = tvm.runtime.load_module(libname) |
| 1125 | device = tvm.cpu() |
| 1126 | return relax.VirtualMachine(exec_loaded, device), device |
| 1127 | |
| 1128 | |
| 1129 | def run_on_rpc( |
no test coverage detected
searching dependent graphs…