[Core] New scheduler fixes (#9186)

* .

* test_args passes

* .

* test_basic.py::test_many_fractional_resources causes ray to hang

* test_basic.py::test_many_fractional_resources causes ray to hang

* .

* .

* useful

* test_many_fractional_resources fails instead of hanging now :)

* Passes test_fractional_resources

* .

* .

* Some cleanup

* git is hard

* cleanup

* Fixed scheduling tests

* .

* .
This commit is contained in:
Alex Wu
2020-07-09 15:37:51 -07:00
committed by GitHub
parent f0a72ad985
commit 34b85659d4
9 changed files with 327 additions and 161 deletions
+17
View File
@@ -7,6 +7,7 @@ import subprocess
import sys
import time
import socket
import math
import ray
import ray.services
@@ -277,6 +278,22 @@ class Semaphore:
return self._sema.locked()
def dicts_equal(dict1, dict2, abs_tol=1e-4):
"""Compares to dicts whose values may be floating point numbers."""
if dict1.keys() != dict2.keys():
return False
for k, v in dict1.items():
if isinstance(v, float) and \
isinstance(dict2[k], float) and \
math.isclose(v, dict2[k], abs_tol=abs_tol):
continue
if v != dict2[k]:
return False
return True
@ray.remote
def _put(obj):
return obj
+1 -1
View File
@@ -127,7 +127,7 @@ def test_many_fractional_resources(shutdown_only):
}
if block:
ray.get(g.remote())
return true_resources == accepted_resources
return ray.test_utils.dicts_equal(true_resources, accepted_resources)
# Check that the resource are assigned correctly.
result_ids = []