merrymercy / tvm-mali

Optimizing Mobile Deep Learning on ARM GPU with TVM
http://tvmlang.org/2018/01/16/opt-mali-gpu.html
MIT License
179 stars 28 forks source link

Does TVM support RK3288? #5

Open wjtan99 opened 6 years ago

wjtan99 commented 6 years ago

Hi, I saw you do the benchmark test on RK3399. RK3288 has a Mali-T764 GPU. We tried it but the opencl has some problem recognizing the GPU. Do you have idea if TVM supports RK3288?

merrymercy commented 6 years ago

rk3288 is similar to rk3399, so tvm supports it. There maybe some problems in your environment configuration, like opencl driver, tvm build option.

Could you post your error message?

wjtan99 commented 6 years ago

Here is the error message

python -m tvm.exec.rpc_server --host 0.0.0.0 --port=9090 INFO:root:RPCServer: bind to 0.0.0.0:9090 INFO:root:RPCServer: connection from ('192.168.7.48', 33508) INFO:root:Connection from ('192.168.7.48', 33508) [01:12:39] src/runtime/rpc/rpc_server_env.cc:23: Upload /tmp/tmpSITYtx/net.tar... nbytes=421284 [01:12:54] src/runtime/opencl/opencl_device_api.cc:197: Initialize OpenCL platform 'ARM Platform' ERROR: The DDK is not compatible with any of the Mali GPUs on the system. The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched: /dev/mali0 detected as 0x750 r1p0 status 0 [01:12:54] src/runtime/opencl/opencl_device_api.cc:202: No OpenCL device any device matched given the options: gpu mode [01:12:54] src/runtime/opencl/opencl_device_api.cc:203: Now try OpenCL cpu mode ERROR: The DDK is not compatible with any of the Mali GPUs on the system. The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched: /dev/mali0 detected as 0x750 r1p0 status 0 [01:12:54] src/runtime/opencl/opencl_device_api.cc:206: No OpenCL device any device matched given the options: cpu mode [01:12:54] src/runtime/rpc/rpc_session.cc:751: Shutdown... INFO:root:Finish serving ('192.168.7.48', 33508)****

wjtan99 commented 6 years ago

“make USE_OPENCL=1 LLVM_CONFIG=llvm-config-4.0 -j4”

merrymercy commented 6 years ago

It seems the problem is your opencl driver, not the tvm runtime.

liurs1990 commented 6 years ago

When I run the test on RK3288, I get the error message:

Traceback (most recent call last): File "mali_imagenet_bench.py", line 109, in run_case(args.model, args.dtype) File "mali_imagenet_bench.py", line 55, in run_case module = runtime.create(graph, rlib, ctx) File "/work/python-tvm/local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-x86_64.egg/tvm/contrib/graph_runtime.py", line 42, in create return GraphModule(fcreate(graph_json_str, hmod, device_type, device_id), ctx) File "/work/python-tvm/local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-x86_64.egg/tvm/_ffi/_ctypes/function.py", line 183, in call ctypes.byref(ret_val), ctypes.byref(ret_tcode))) File "/work/python-tvm/local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-x86_64.egg/tvm/_ffi/base.py", line 66, in check_call raise TVMError(py_str(_LIB.TVMGetLastError())) tvm._ffi.base.TVMError: Except caught from RPC call: [02:02:46] src/runtime/graph/graph_runtime.cc:485: Check failed: storage_id >= 0 (-1 vs. 0) Do not support runtime shape op

Stack trace returned 10 entries: [bt] (0) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(dmlc::StackTrace[abi:cxx11]()+0x37) [0xb5c9fa4c] [bt] (1) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x21) [0xb5ca011a] [bt] (2) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::GraphRuntime::SetupStorage()+0x50f) [0xb5f601c0] [bt] (3) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::GraphRuntimeCreate(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, tvm::runtime::Module, int, int)+0x1c1) [0xb5f60c92] [bt] (4) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(+0x4321bc) [0xb5f611bc] [bt] (5) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x3d3) [0xb5f4ad5c] [bt] (6) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x1a7) [0xb5f4e7f8] [bt] (7) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x20d) [0xb5f4efce] [bt] (8) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue, bool, tvm::runtime::PackedFunc const)+0x1d7) [0xb5f4f474] [bt] (9) /home/firefly/.local/lib/python2.7/site-packages/tvm-0.2.0-py2.7-linux-armv7l.egg/tvm/libtvm.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue, bool, tvm::runtime::PackedFunc const)+0xf7) [0xb5f4bf18]

@merrymercy Could you give some help ?

merrymercy commented 6 years ago

cc @tqchen

tqchen commented 6 years ago

Please use the latest nnvm along with latest tvm