# Tune job doesn't end (hanging) when run in localmode=True and v2.0.0dev

**URL:** <https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243>\
**Category:** Ray Tune\
**Created:** [March 12, 2021, 12:28pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243 "2021-03-12T12:28:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![diman82](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/diman82/32/407_2.png) [@diman82](https://discuss.ray.io/u/diman82)\
**Post date:** [March 12, 2021, 12:28pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/1 "2021-03-12T12:28:52Z")

</div>

When running a tune job with ray v 2.0.0dev (Py3.8 on Windows), it never ends. I can see in the output, that it finished all iterations, but it never exits. When I run in debug mode (in IDE), and pause at the end (after all iterations finished), the current code execution is here: [ray/import\_thread.py at f60bd3afeefc78e30bd625e8ce98e064acd37b1f · ray-project/ray · GitHub](https://github.com/ray-project/ray/blob/f60bd3afeefc78e30bd625e8ce98e064acd37b1f/python/ray/_private/import_thread.py#L76)  
**This problem doesn’t happen with ray v 1.2.0 !!**

What can be the problem? Is it a known problem?

P.S It may be related to : [Ray Tune training hangs](https://discuss.ray.io/t/ray-tune-training-hangs/632)

---

<div class="post-metadata">

**Author:** ![Ameer\_Haj\_Ali](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ameer_haj_ali/32/279_2.png) [@Ameer\_Haj\_Ali](https://discuss.ray.io/u/Ameer_Haj_Ali)\
**Post date:** [March 13, 2021, 11:52pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/2 "2021-03-13T23:52:03Z")

</div>

Hi @diman82. Thanks for asking. @kai can maybe help you.  
If you do not get a response please let me know!

---

<div class="post-metadata">

**Author:** ![kai](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai/32/3380_2.png) [@kai](https://discuss.ray.io/u/kai)\
**Post date:** [March 15, 2021, 9:26am UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/3 "2021-03-15T09:26:47Z")

</div>

Hi @diman82, this is probably because we enabled placement group support per default, but placement groups are currently not supported in local model. See also this issue:

> <https://github.com/ray-project/ray/issues/13932>
>
> What is the problem?
> With local\_mode=True, placement groups ready() remote function always returns the placement group, even if it is unfeasible to...

To fix this problem for the short term, please set the `TUNE_PLACEMENT_GROUP_AUTO_DISABLED` environment variable to `1`, e.g. like this:

```auto
os.environ["TUNE_PLACEMENT_GROUP_AUTO_DISABLED"] = "1"

```

It might make sense for us to disable placement groups automatically when running in local mode until this is fixed. I’ll open an issue to track this.

---

<div class="post-metadata">

**Author:** ![diman82](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/diman82/32/407_2.png) [@diman82](https://discuss.ray.io/u/diman82)\
**Post date:** [March 16, 2021, 12:20pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/4 "2021-03-16T12:20:52Z")

</div>

@kai Thanks a lot, this workaround worked.

---

<div class="post-metadata">

**Author:** ![stefanbschneider](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/stefanbschneider/32/232_2.png) [@stefanbschneider](https://discuss.ray.io/u/stefanbschneider)\
**Post date:** [March 16, 2021, 2:44pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/5 "2021-03-16T14:44:31Z")

</div>

Off-topic question: How do you mark answers as solutions here? I couldn’t find this option in my questions. Or is it restricted to staff to mark answers as solutions?

---

<div class="post-metadata">

**Author:** ![diman82](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/diman82/32/407_2.png) [@diman82](https://discuss.ray.io/u/diman82)\
**Post date:** [March 16, 2021, 4:14pm UTC](https://discuss.ray.io/t/tune-job-doesnt-end-hanging-when-run-in-localmode-true-and-v2-0-0dev/1243/6 "2021-03-16T16:14:36Z")

</div>

@stefanbschneider Nope, I marked it by myself.  
Maybe you need to get a specific badge for it…
