# Setting the CPU affinity and number of cores locally without RPC Remote

**URL:** <https://discuss.tvm.apache.org/t/setting-the-cpu-affinity-and-number-of-cores-locally-without-rpc-remote/11306>\
**Category:** Questions\
**Created:** [October 23, 2021, 10:08pm UTC](https://discuss.tvm.apache.org/t/setting-the-cpu-affinity-and-number-of-cores-locally-without-rpc-remote/11306 "2021-10-23T22:08:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![popojames](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/p/9dc877/32.png) [@popojames](https://discuss.tvm.apache.org/u/popojames)\
**Post date:** [October 27, 2021, 4:02pm UTC](https://discuss.tvm.apache.org/t/setting-the-cpu-affinity-and-number-of-cores-locally-without-rpc-remote/11306/4 "2021-10-27T16:02:19Z")

</div>

This problem is fixed by myslef. I was able to set it locally without RPC Remote.

 ![image](https://discuss.tvm.apache.org/uploads/default/original/2X/3/35b67892f2774835db0e729e7aaad6b53b8d4273.png)

What I did is very similar with the aforementioned setting: hooks c++ into python

> [@popojames](#):
>
> 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’)

In my **python/runtime/module.py** , I add “conf\_set” function inside,

 ![image](https://discuss.tvm.apache.org/uploads/default/original/2X/2/296069a293ce6bf82ea7e4987d58012c613ed083.png)

to set the configuration, I can direct use this command just like we did in remote.get\_function

> ```
> config_threadpool = module.module.config_set(remote.get_function('runtime.config_threadpool')
> 
> ```

---

_[View the full topic](https://discuss.tvm.apache.org/t/setting-the-cpu-affinity-and-number-of-cores-locally-without-rpc-remote/11306)._
