tvm
tvm copied to clipboard
[Bugfix][Runtime] Fix sched_setaffinity in Android
sched_setaffinity should use pid_t instread of pthread_t https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
cc @areusch
@areusch
i think @huajsj might have context around this. @sunjiweiswift could you update the PR title and body as well similar to the other PR?
It feels a little weird doing something different on regular Linux vs. Android. Can we get rid of the pthread_setaffinity_np call and just use sched_setaffinity on Linux? I think we could get rid of the duplicate thread argument that way. The only reason to keep it is if we supported SetThreadAffinity on platforms other than Linux (and had to use std::thread::native_handle_type) but we don't.
@supersat Can we get rid of the pthread_setaffinity_np call and just use sched_setaffinity on Linux? I think we can just use seched_setaffinity on Linux and Android
looks like some of the hexagon tests are segfaulting now, e.g.:
tests/python/contrib/test_hexagon/topi/test_avg_pool2d_slice.py::TestAvgPool2dSlice::test_avg_pool2d_slice[nhwc-8h2w32c2w-2d-stride6-kernel6-float16-dilation6-padding6-True-nhwc-8h2w32c2w-2d-output_shape6-False]
anyone able to look?