Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VTA] Improved RPC for VTA #2043

Merged
merged 10 commits into from
Nov 12, 2018
12 changes: 6 additions & 6 deletions vta/python/vta/exec/rpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def server_start():
os.path.abspath(os.path.expanduser(__file__)))
proj_root = os.path.abspath(os.path.join(curr_path, "../../../../"))
dll_path = find_libvta()[0]
cfg_path = os.path.abspath(os.path.join(proj_root, "build/vta_config.json"))
cfg_path = os.path.abspath(os.path.join(curr_path, "../../../config/vta_config.json"))
tmoreau89 marked this conversation as resolved.
Show resolved Hide resolved
tmoreau89 marked this conversation as resolved.
Show resolved Hide resolved
runtime_dll = []
_load_module = tvm.get_global_func("tvm.rpc.server.load_module")

Expand Down Expand Up @@ -87,8 +87,8 @@ def reconfig_runtime(cfg_json):
ldflags = pkg.ldflags
lib_name = dll_path
source = pkg.lib_source
logging.info("Rebuild runtime: output=%s, cflags=%s, source=%s, ldflags=%s",
dll_path, str(cflags), str(source), str(ldflags))
logging.info("Rebuild runtime:\n output=%s,\n cflags=%s,\n source=%s,\n ldflags=%s",
dll_path, '\n\t'.join(cflags), '\n\t'.join(source), '\n\t'.join(ldflags))
cc.create_shared(lib_name, source, cflags + ldflags)
with open(cfg_path, "w") as outputfile:
outputfile.write(pkg.cfg_json)
Expand All @@ -99,10 +99,10 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--host', type=str, default="0.0.0.0",
help='the hostname of the server')
parser.add_argument('--port', type=int, default=9090,
help='The port of the PRC')
parser.add_argument('--port', type=int, default=9091,
help='The port of the RPC')
parser.add_argument('--port-end', type=int, default=9199,
help='The end search port of the PRC')
help='The end search port of the RPC')
parser.add_argument('--key', type=str, default="",
help="RPC key used to identify the connection type.")
parser.add_argument('--tracker', type=str, default="",
Expand Down
4 changes: 3 additions & 1 deletion vta/python/vta/libinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ def find_libvta(optional=False):
"""Find VTA library"""
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
lib_search = [curr_path]
lib_search += [os.path.join(curr_path, "..", "..", "..", "lib",)]
tmoreau89 marked this conversation as resolved.
Show resolved Hide resolved
lib_search += [os.path.join(curr_path, "..", "..", "..", "build",)]
lib_search += [os.path.join(curr_path, "..", "..", "..", "build", "Release")]
lib_name = _get_lib_name()
lib_path = [os.path.join(x, lib_name) for x in lib_search]
lib_found = [x for x in lib_path if os.path.exists(x)]
if not lib_found and not optional:
raise RuntimeError("Cannot find libvta: candidates are: " % str(lib_path))
raise RuntimeError('Cannot find the files.\n' +
'List of candidates:\n' + str('\n'.join(lib_path)))
return lib_found