# How to early stop bad runs in sweeps to save time

**URL:** <https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563>\
**Category:** W&B Help\
**Tags:** sweeps, wandb\
**Created:** [June 7, 2022, 6:44am UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563 "2022-06-07T06:44:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markuskarner](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/markuskarner/32/862_2.png) [@markuskarner](https://community.wandb.ai/u/markuskarner)\
**Post date:** [June 7, 2022, 6:44am UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/1 "2022-06-07T06:44:10Z")

</div>

Hello,  
that’s my first topic in the community, so I hope I am posting that in the correct category 😉

I started exploring sweeps last week for a university project, and it is incredible! As we also got a new PyTorch version with support for the new apple silicon, I wanted to try that on my M1 Pro. As this is not as powerful as, for example, using GoogleColab for a fraction of the time, I wanted to ask if it is somehow possible to stop bad runs after a few epochs.

As you can see in the report linked below, the run hopeful-sweep-2 does not look promising. It would be nice to cancel that run and start a new one instead.

Thanks,  
Markus

> **[Weights & Biases](https://wandb.ai/markuskarner/AILS-Challenge%203%20Microscopic%20Images/reports/Sweep-on-some-image-data--VmlldzoyMTI2MDA3?accessToken=9h1rd20e7e6smpxm2cvtm3plk3rrauhkbb39w2rs46fv0htwvf0tx9r4ixjhkolk)**
>
> Weights & Biases, developer tools for machine learning

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [June 7, 2022, 6:41pm UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/2 "2022-06-07T18:41:53Z")

</div>

Hi @markuskarner ,

Thank you for writing in with your question. We do support early termination of sweeps, this reference [doc](https://docs.wandb.ai/guides/sweeps/configuration#early_terminate) covers this. When the early stopping is triggered, the agent stops the current run and gets the next set of hyperparameters to try. Here is a [link](https://github.com/wandb/examples/blob/master/examples/keras/keras-cnn-fashion/sweep-bayes-hyperband.yaml) to an example sweep configuration for reference. If after setting up your configuration and your require review / feedback. Please do write back in this thread and we can review your work more closely.

Regards,

Mohammad

---

<div class="post-metadata">

**Author:** ![markuskarner](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/markuskarner/32/862_2.png) [@markuskarner](https://community.wandb.ai/u/markuskarner)\
**Post date:** [June 8, 2022, 5:11am UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/3 "2022-06-08T05:11:46Z")

</div>

Thanks a lot 😃  
That was exactly what I was looking for, just searched for early stopping and not terminating and somehow didn’t find it 🙂

Is there also a way to change the configuration of a running sweep? Or stop it and continue it with a new configuration?

Thanks & Regards,  
Markus

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [June 8, 2022, 7:54pm UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/4 "2022-06-08T19:54:18Z")

</div>

@markuskarner,

You’re welcome, glad that helped.

Currently we do not allow the modification of a running sweep. A sweep is inherently tied to its config, so once it is set there is no way to change it. You can however, create a new sweep and seed it with existing runs, see [here](https://docs.wandb.ai/guides/sweeps/existing-project#seed-a-new-sweep-with-existing-runs). Hope this helps.

Regards,

Mohammad

---

<div class="post-metadata">

**Author:** ![markuskarner](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/markuskarner/32/862_2.png) [@markuskarner](https://community.wandb.ai/u/markuskarner)\
**Post date:** [June 9, 2022, 8:13am UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/5 "2022-06-09T08:13:38Z")

</div>

Thanks for your kind reply 🙂

---

<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:** [August 8, 2022, 8:14am UTC](https://community.wandb.ai/t/how-to-early-stop-bad-runs-in-sweeps-to-save-time/2563/6 "2022-08-08T08:14:38Z")

</div>

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