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] tvm.rpc.server.start is not called #8603

Closed
minils opened this issue Jul 30, 2021 · 6 comments
Closed

[VTA] tvm.rpc.server.start is not called #8603

minils opened this issue Jul 30, 2021 · 6 comments
Labels

Comments

@minils
Copy link

minils commented Jul 30, 2021

When running the script python vta/tests/python/pynq/test_program_rpc.py, the function tvm.rpc.server.startis never called on the target (PYNQ in my case) which leads to an AttributeError: Module has no function 'tvm.contrib.vta.init' because the function is not registered (see vta/python/vta/exec/rpc_server.py:65).

The function should be called at src/runtime/rpc/rpc_endpoint.cc:728

void RPCEndpoint::ServerLoop() {                                                                                    
  if (const auto* f = Registry::Get("tvm.rpc.server.start")) {                                                      
    (*f)();                                                                                                         
  }                                                                                                                 
  TVMRetValue rv;                                                                                                   
  ICHECK(HandleUntilReturnEvent(false, [](TVMArgs) {}) == RPCCode::kShutdown);                                      
  if (const auto* f = Registry::Get("tvm.rpc.server.shutdown")) {                                                   
    (*f)();                                                                                                         
  }                                                                                                                 
  channel_.reset(nullptr);                                                                                          
}

But the ServerLoop is also not called. Not sure why...

@minils
Copy link
Author

minils commented Jul 30, 2021

Also see this thread

@tqchen
Copy link
Member

tqchen commented Jul 30, 2021

THanks @minils for reporting. This is likely due to our recent update to rpc server and results the requirement of the function to be registered within the rpc server launch.

@tqchen
Copy link
Member

tqchen commented Jul 30, 2021

Please see if #8604 fixes the problem

@minils
Copy link
Author

minils commented Aug 2, 2021

Thanks @tqchen for looking into this.
Running the rpc server now gives another error:

xilinx@pynq:~/tvm$ sudo ./apps/vta_rpc/start_rpc_server.sh
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/xilinx/tvm/vta/python/vta/__init__.py", line 25, in <module>
    from .autotvm import module_loader
  File "/home/xilinx/tvm/vta/python/vta/autotvm.py", line 21, in <module>
    from . import rpc_client
  File "/home/xilinx/tvm/vta/python/vta/rpc_client.py", line 22, in <module>
    from .environment import get_env
  File "/home/xilinx/tvm/vta/python/vta/environment.py", line 296, in <module>
    @register_intrin_lowering("tir.vta.coproc_sync", "default")
  File "/home/xilinx/tvm/python/tvm/ir/op.py", line 223, in _register
    _ffi_api.RegisterOpLowerIntrinsic(op_name, f, target, level)
AttributeError: module 'tvm.ir._ffi_api' has no attribute 'RegisterOpLowerIntrinsic'

I could previously fix this error by moving some functions from vta/python/vta/environment.py to vta/python/vta/build_module.py (see fix.patch). But with the latest commits from main it doesn't work any more.

@tqchen
Copy link
Member

tqchen commented Aug 5, 2021

Thanks for the note, please see if #8671 fixes the problem

@areusch areusch added the needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it label Oct 19, 2022
@Lunderberg Lunderberg added vta and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Oct 28, 2022
@Lunderberg
Copy link
Contributor

Closing, can be re-opened if issue is still occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants