[direct call] Assign resource ids for direct call tasks (#6364)

This commit is contained in:
Eric Liang
2019-12-05 10:16:04 -08:00
committed by GitHub
parent 4c6739476b
commit 6223d2ed0b
20 changed files with 149 additions and 66 deletions
+20 -12
View File
@@ -16,15 +16,23 @@ py_test(
py_test(
name = "test_actor_resources",
size = "large",
size = "medium",
srcs = ["test_actor_resources.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
)
py_test(
name = "test_actor_resources_direct",
size = "medium",
srcs = ["test_actor_resources_direct.py", "test_actor_resources.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
)
py_test(
name = "test_actor_failures",
size = "large",
size = "medium",
srcs = ["test_actor_failures.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -80,7 +88,7 @@ py_test(
py_test(
name = "test_stress",
size = "large",
size = "medium",
srcs = ["test_stress.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -88,7 +96,7 @@ py_test(
py_test(
name = "test_stress_sharded",
size = "large",
size = "medium",
srcs = ["test_stress_sharded.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -167,7 +175,7 @@ py_test(
py_test(
name = "test_garbage_collection",
size = "medium",
size = "small",
srcs = ["test_garbage_collection.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -175,7 +183,7 @@ py_test(
py_test(
name = "test_global_state",
size = "medium",
size = "small",
srcs = ["test_global_state.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -183,7 +191,7 @@ py_test(
py_test(
name = "test_logical_graph",
size = "medium",
size = "small",
srcs = ["test_logical_graph.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -215,7 +223,7 @@ py_test(
py_test(
name = "test_microbenchmarks",
size = "medium",
size = "small",
srcs = ["test_microbenchmarks.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -230,7 +238,7 @@ py_test(
py_test(
name = "test_monitors",
size = "medium",
size = "small",
srcs = ["test_monitors.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -285,7 +293,7 @@ py_test(
py_test(
name = "test_ray_init",
size = "medium",
size = "small",
srcs = ["test_ray_init.py"],
deps = ["//:ray_lib"],
)
@@ -308,7 +316,7 @@ py_test(
py_test(
name = "test_tensorflow",
size = "medium",
size = "small",
srcs = ["test_tensorflow.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
@@ -324,7 +332,7 @@ py_test(
py_test(
name = "test_webui",
size = "medium",
size = "small",
srcs = ["test_webui.py"],
tags = ["exclusive"],
deps = ["//:ray_lib"],
-4
View File
@@ -1152,7 +1152,6 @@ def setup_queue_actor():
ray.shutdown()
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="TODO support block/unblock")
def test_fork(setup_queue_actor):
queue = setup_queue_actor
@@ -1171,7 +1170,6 @@ def test_fork(setup_queue_actor):
assert filtered_items == list(range(1))
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="TODO support block/unblock")
def test_fork_consistency(setup_queue_actor):
queue = setup_queue_actor
@@ -1203,7 +1201,6 @@ def test_fork_consistency(setup_queue_actor):
assert filtered_items == list(range(num_items_per_fork))
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="TODO support block/unblock")
def test_pickled_handle_consistency(setup_queue_actor):
queue = setup_queue_actor
@@ -1237,7 +1234,6 @@ def test_pickled_handle_consistency(setup_queue_actor):
assert filtered_items == list(range(num_items_per_fork))
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="TODO support block/unblock")
def test_nested_fork(setup_queue_actor):
queue = setup_queue_actor
+3
View File
@@ -17,6 +17,8 @@ import ray
import ray.test_utils
import ray.cluster_utils
RAY_FORCE_DIRECT = bool(os.environ.get("RAY_FORCE_DIRECT"))
def test_actor_deletion_with_gpus(shutdown_only):
ray.init(
@@ -84,6 +86,7 @@ def test_actor_class_methods(ray_start_regular):
assert ray.get(a.g.remote(2)) == 4
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="no actor method resources")
def test_resource_assignment(shutdown_only):
"""Test to make sure that we assign resource to actors at instantiation."""
# This test will create 16 actors. Declaring this many CPUs initially will
@@ -0,0 +1,17 @@
"""Wrapper script that sets RAY_FORCE_DIRECT."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
import sys
import os
if __name__ == "__main__":
os.environ["RAY_FORCE_DIRECT"] = "1"
sys.exit(
pytest.main([
"-v",
os.path.join(os.path.dirname(__file__), "test_actor_resources.py")
]))
-6
View File
@@ -5,7 +5,6 @@ from __future__ import print_function
import collections
import io
import os
import json
import logging
import re
@@ -24,8 +23,6 @@ import ray.test_utils
logger = logging.getLogger(__name__)
RAY_FORCE_DIRECT = bool(os.environ.get("RAY_FORCE_DIRECT"))
def test_simple_serialization(ray_start_regular):
primitive_objects = [
@@ -94,7 +91,6 @@ def test_simple_serialization(ray_start_regular):
assert type(obj) == type(new_obj_2)
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="resource shape not implemented")
def test_fair_queueing(shutdown_only):
ray.init(
num_cpus=1, _internal_config=json.dumps({
@@ -1065,7 +1061,6 @@ def test_redefining_remote_functions(shutdown_only):
assert ray.get(ray.get(h.remote(i))) == i
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="reconstruction not implemented")
def test_submit_api(shutdown_only):
ray.init(num_cpus=2, num_gpus=1, resources={"Custom": 1})
@@ -1124,7 +1119,6 @@ def test_submit_api(shutdown_only):
assert ray.get([id1, id2, id3, id4]) == [0, 1, "test", 2]
@pytest.mark.skipif(RAY_FORCE_DIRECT, reason="reconstruction not implemented")
def test_many_fractional_resources(shutdown_only):
ray.init(num_cpus=2, num_gpus=2, resources={"Custom": 2})
+3 -3
View File
@@ -30,7 +30,7 @@ py_test(
py_test(
name = "test_commands",
size = "medium",
size = "small",
srcs = ["tests/test_commands.py"],
deps = [":tune_lib"],
tags = ["exclusive"],
@@ -98,7 +98,7 @@ py_test(
py_test(
name = "test_var",
size = "medium",
size = "small",
srcs = ["tests/test_var.py"],
deps = [":tune_lib"],
tags = ["exclusive"],
@@ -138,7 +138,7 @@ py_test(
py_test(
name = "test_tune_save_restore",
size = "large",
size = "small",
srcs = ["tests/test_tune_save_restore.py"],
deps = [":tune_lib"],
tags = ["exclusive"],