# Early Terminate Failing with Exit Code 1

**URL:** <https://community.wandb.ai/t/early-terminate-failing-with-exit-code-1/5086>\
**Category:** W&B Help\
**Tags:** sweeps\
**Created:** [September 17, 2023, 7:42pm UTC](https://community.wandb.ai/t/early-terminate-failing-with-exit-code-1/5086 "2023-09-17T19:42:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [September 25, 2023, 5:55pm UTC](https://community.wandb.ai/t/early-terminate-failing-with-exit-code-1/5086/3 "2023-09-25T17:55:59Z")

</div>

Hi @gurugecl , I ran through some tests and was unable to reproduce a situation where wandb bayes sweeps with hyperband sweep produces a failed/crashed run when early stopping occurs, see project [here](https://wandb.ai/mohammadbakir/hyper-band-test/table). Do you have a reproducible working example I could test against?

Some high level info on how bayes treats runs

When a Bayesian sweep run executes to completion, we always use the “best” metric value of last finished run for the next run . The default behavior can be modified by the user using an [impute strategy](https://github.com/wandb/sweeps/blob/deb0af18ecdab2d3af6be71b60afa40d948c7b8f/src/sweeps/bayes_search.py#L24) :

- “worst”: use the worst value of the run’s target metric,
- “best”: use the best value of the run’s target metric,
- “latest”: use the latest value of the run’s target metric.

Now in the event a run Fails, Crashes, is Killed, wandb [defaults](https://github.com/wandb/sweeps/blob/deb0af18ecdab2d3af6be71b60afa40d948c7b8f/src/sweeps/bayes_search.py#L439) to “worst” metric value unless the impute strategy was set by a user.

In terms of the difference between crashed vs failed runs

**failed runs means a** non-zero exit (control-c or exception or `sys.exit(1)` .

- _Scenario_: W&B kills the agent, and does not run any further sweep experiments.
- The sweep agent is designed to shutdown if (by default) there are 3 failures in the first 60 seconds, or the first 5 runs started are failures.

**a crashed run** : wandb backend never got a successful exit indication after 5-10 minutes of no heartbeat

---

_[View the full topic](https://community.wandb.ai/t/early-terminate-failing-with-exit-code-1/5086)._
