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

apache-tvm pip package doesn't support Hexagon Launcher #134

Open
mehrdadh opened this issue Aug 11, 2022 · 4 comments
Open

apache-tvm pip package doesn't support Hexagon Launcher #134

mehrdadh opened this issue Aug 11, 2022 · 4 comments

Comments

@mehrdadh
Copy link
Member

I was trying to use hexagon launcher from the apache-tvm pip package and I got this error:

  File "/home/mhessar/.cache/pypoetry/virtualenvs/hexagon-ci-3FznOw5Q-py3.8/lib/python3.8/site-packages/tvm/contrib/hexagon/build.py", line 491, in start_server
    self._copy_binaries()
  File "/home/mhessar/.cache/pypoetry/virtualenvs/hexagon-ci-3FznOw5Q-py3.8/lib/python3.8/site-packages/tvm/contrib/hexagon/build.py", line 372, in _copy_binaries
    with open(_get_hexagon_rpc_lib_dir() / f"{ANDROID_BASH_FILE_NAME}.template", "r") as src_f:
  File "/home/mhessar/.cache/pypoetry/virtualenvs/hexagon-ci-3FznOw5Q-py3.8/lib/python3.8/site-packages/tvm/contrib/hexagon/build.py", line 59, in _get_hexagon_rpc_lib_dir
    raise RuntimeError("hexagon_api binaries not found, please define HEXAGON_RPC_LIB_DIR")
RuntimeError: hexagon_api binaries not found, please define HEXAGON_RPC_LIB_DIR

I think the reason is that for hexagon we are building hexaong_api which generates some files in HEXAGON_RPC_LIB_DIR direcotory, but they are not included in this build.

cc @areusch

@mehrdadh mehrdadh changed the title apache-tvm pip package doesn't support Hexagon apache-tvm pip package doesn't support Hexagon Launcher Aug 11, 2022
@leandron
Copy link
Contributor

I guess the fix for this is in TVM, similar to what we do with other support files directories?

https://github.com/apache/tvm/blob/a1c371f46cf77dcdffa6f0ab55f5036bff1c5624/python/setup.py#L73-L78

@mehrdadh
Copy link
Member Author

@leandron that's one aspect of the problem, the other thing is that Hexagon is not enabled by default. I don't know how we are going to release package with support for other hardware. The same question exists for microTVM but I think enabling microTVM by default is not that hard

@leandron
Copy link
Contributor

@leandron that's one aspect of the problem, the other thing is that Hexagon is not enabled by default. I don't know how we are going to release package with support for other hardware. The same question exists for microTVM but I think enabling microTVM by default is not that hard

I see. Just to clarify, this is what is currently enabled in the apache-tvm packaging.

# config the cmake
cd /workspace/tvm
echo set\(USE_LLVM \"llvm-config --ignore-libllvm --link-static\"\) >> config.cmake
echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_SORT ON\) >> config.cmake
echo set\(USE_GRAPH_RUNTIME ON\) >> config.cmake
echo set\(USE_ETHOSN /opt/arm/ethosn-driver\) >> config.cmake
echo set\(USE_ARM_COMPUTE_LIB /opt/arm/acl\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(USE_ETHOSU ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
if [[ ${CUDA} != "none" ]]; then
echo set\(USE_CUDA ON\) >> config.cmake
echo set\(USE_CUBLAS ON\) >> config.cmake
echo set\(USE_CUDNN ON\) >> config.cmake
fi

@mehrdadh
Copy link
Member Author

@leandron that's good to know!
So I tried to make microtvm to be ON by default and that turns out to be an issue with building the hexagon_api: apache/tvm#12227
You don't see the error on the CI because I disabled MICROTVM in this file: https://github.com/apache/tvm/pull/12227/files#diff-725711af3d7d48c0b3b970e966fc424796739f3714e1a63f8f40968de5cddd6aR91

If we can fix this issue then we can enable hexagon in the pip package.

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

No branches or pull requests

2 participants