# Multithreading support for Sweeps

**URL:** <https://community.wandb.ai/t/multithreading-support-for-sweeps/5212>\
**Category:** W&B Help\
**Tags:** sweeps, wandb\
**Created:** [October 16, 2023, 3:50pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212 "2023-10-16T15:50:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikrant17](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vikrant17](https://community.wandb.ai/u/vikrant17)\
**Post date:** [October 16, 2023, 3:50pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/1 "2023-10-16T15:50:55Z")

</div>

Is there a way to support multithreading with sweeps for hyper parameter tuning. (like sklearn GridSearchCV ‘n\_jobs’ parameter).

---

<div class="post-metadata">

**Author:** ![jcnumeus](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jcnumeus](https://community.wandb.ai/u/jcnumeus)\
**Post date:** [October 16, 2023, 4:00pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/2 "2023-10-16T16:00:56Z")

</div>

can you just launch multiple wandb.agents with the same sweep id (passed from outside) in different threads? the sweep controller, i guess, will orchestrate that they get different parameter sets

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [October 17, 2023, 6:12am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/3 "2023-10-17T06:12:53Z")

</div>

Hello @vikrant17 ,

We’ll look into this if W&B can support this one, let us check things on our end first and will get back to you.

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [October 18, 2023, 4:32am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/4 "2023-10-18T04:32:36Z")

</div>

Hello @vikrant17 ,

We would like to know your specific use case, what exactly you are trying to do and what is the expected result so we can understand it better.

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [October 19, 2023, 11:58pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/5 "2023-10-19T23:58:15Z")

</div>

Hi @vikrant17 ,

Good Day!

I would like to follow up on our inquiry for this reported concern please.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![vikrant17](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vikrant17](https://community.wandb.ai/u/vikrant17)\
**Post date:** [October 21, 2023, 6:21am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/6 "2023-10-21T06:21:22Z")

</div>

Hi @joana-marie , I wanted to do a random search for the hyperparameters quickly. I wanted to know if there is way to use all the cores of the system to do the hyperparameter sweeping (like the sklearn CV methods allow).  
The only solution I have come across is to run the sweep via multiple processes using the same sweep id.

---

<div class="post-metadata">

**Author:** ![vikrant17](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vikrant17](https://community.wandb.ai/u/vikrant17)\
**Post date:** [October 23, 2023, 10:26am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/7 "2023-10-23T10:26:16Z")

</div>

Any solution to this?

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [October 25, 2023, 3:49am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/8 "2023-10-25T03:49:20Z")

</div>

Hi @vikrant17 ,

You will need to use parallelized agents [Parallelize agents](https://docs.wandb.ai/guides/sweeps/parallelize-agents) and you can’t run multithreading to parse through the different hyperparameter combinations.

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [October 31, 2023, 4:29am UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/9 "2023-10-31T04:29:27Z")

</div>

Hi @vikrant17 , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![vikrant17](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vikrant17](https://community.wandb.ai/u/vikrant17)\
**Post date:** [November 2, 2023, 2:33pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/10 "2023-11-02T14:33:39Z")

</div>

Hi @joana-marie

I was able to run the sweep in parallel using the joblib package as multiple process. Although this could be done using the sweep id as mentioned by you, I wanted something that could automatically use separate cores automatically to perform each run for the sweep in parallel. That way I don’t have to open new terminals and manually run the agent.

Anyways, thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [January 1, 2024, 2:34pm UTC](https://community.wandb.ai/t/multithreading-support-for-sweeps/5212/11 "2024-01-01T14:34:16Z")

</div>

Closed on January 1, 2024, 2:34pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
