tag v0.14.dev0
[RPC] Report RPC Session Timeout to Client Instead of "kShutdown" (#15187)

By using RPC server in NPU board, at some time a compiled model will hang the NPU, because of the buggy operator libraries of NPU toolchain, so we must to use the session_timeout to ensure the board resource can be released by the hang jobs.

Currently the handling of session timeout error in RPC server is not good, it just kill the server loop sub process, then in the destructor of  class `RPCEndpoint` will send the code of `kShutdown` to the RPC client, but the RPC client expect receive the code of `kReturn` or `kException`, so users will see the error message that like the one reported in  https://github.com/apache/tvm/issues/15151, this error report will make users very confused and don't know what's happened.

When using tuning to search a good schedule for operators, we only want to ignore the RPC session timeout error that indicate the schedule generated is an illegal one, but other error reported by the RPC server may help us find the potential bug of our tool chain built on top of TVM, so the RPC session timeout error should be split to a standalone TVM error class.

This PR implemented these requirements by sending the RPC session timeout error message as a PRC server exception to the RPC client before kill the server loop sub process.
5 files changed
tree: 2655b28fea66b1213857f6589e536017d11142e8
  1. .github/
  2. 3rdparty/
  3. apps/
  4. ci/
  5. cmake/
  6. conda/
  7. configs/
  8. docker/
  9. docs/
  10. gallery/
  11. golang/
  12. include/
  13. jvm/
  14. licenses/
  15. python/
  16. rust/
  17. src/
  18. tests/
  19. vta/
  20. web/
  21. .asf.yaml
  22. .clang-format
  23. .gitattributes
  24. .gitignore
  25. .gitmodules
  26. .pre-commit-config.yaml
  27. CMakeLists.txt
  28. conftest.py
  29. CONTRIBUTORS.md
  30. KEYS
  31. LICENSE
  32. Makefile
  33. mypy.ini
  34. NEWS.md
  35. NOTICE
  36. pyproject.toml
  37. README.md
  38. version.py
README.md

Open Deep Learning Compiler Stack

Documentation | Contributors | Community | Release Notes

Build Status WinMacBuild

Apache TVM is a compiler stack for deep learning systems. It is designed to close the gap between the productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends. TVM works with deep learning frameworks to provide end to end compilation to different backends.

License

TVM is licensed under the Apache-2.0 license.

Getting Started

Check out the TVM Documentation site for installation instructions, tutorials, examples, and more. The Getting Started with TVM tutorial is a great place to start.

Contribute to TVM

TVM adopts apache committer model, we aim to create an open source project that is maintained and owned by the community. Check out the Contributor Guide.

Acknowledgement

We learned a lot from the following projects when building TVM.

  • Halide: Part of TVM's TIR and arithmetic simplification module originates from Halide. We also learned and adapted some part of lowering pipeline from Halide.
  • Loopy: use of integer set analysis and its loop transformation primitives.
  • Theano: the design inspiration of symbolic scan operator for recurrence.