According to this post:
[quote="FrozenGene, post:5, topic:8474"]
I assume you have got ‘remote’ handle correctly. Then we could get the func:

```
config_threadpool = remote.get_function('runtime.config_threadpool')
# affinity_mode: kBig = 1, kLittle = -1. kDefault = 0. pass 1 or -1 to control 
the cores
config_threadpool(affinity_mode, num_threads)
```
[/quote]

I tried to create a function in "module" (python/runtime/module.py) that hooks 
c++ into python so that I can directly use 

> module.module.get_global_function('runtime.config_threadpool')

, which is very similar to what we did in 
remote.get_function('runtime.config_threadpool')


remote is "RPsession(object)" with "get_function" which use 
"get_global_function" that can get global function. Therefore, I put 
**get_global_function** into **python/runtime/module.py**

![image|478x339](upload://3lskz0fuRFAnJtRJIDLyis945Pi.png) 

And  **python/runtime/module.py** will use ""get_global_func"" from 
**tvm/_ffi/_ctypes/packed_func.py**
![image|570x217](upload://zw9SsYYuidP85MDlz1HJlM2Tc4n.png)


May I ask are the above steps the correct way to follow to enable such setting?





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/setting-the-cpu-affinity-and-number-of-cores-locally-without-rpc-remote/11306/3)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/1317f6dfdd441a78946027e612cfc6c1b1397d19c7c4b8648e30f2df0c84ede5).

Reply via email to