Hello @Chame_call.
At the moment pytorch android thread count is fixed by device and equal “number of big cores of cpu”(N) on device.
As you also have bg thread for image decoding + UI thread - at the moment of inference you have at least (N + 2) competing threads for N big cores (+other applications threads). I think that is the reason why you see UI thread slow downs.
We are thinking to expose control of number of threads to java api, in that case you can set for example singleThread mode, that should not affect too much UI thread responsiveness.
For more details I would recommend to use android systrace.
If you are building pytorch android from the source you can do deeper investigation with systrace if you build it with environment variable TRACE_ENABLED=1
(https://github.com/pytorch/pytorch/blob/master/android/pytorch_android/CMakeLists.txt#L7)
It controls logging of additional sections for systrace, in that case you will see operators sections.
If you need all debug symbols for tracing - you may check example of test_app in our repo, that has a script how to build it with all c++ debug symbols:
TRACE_ENABLED=1 sh android/build_test_app.sh