mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
[docker] Detect CPUs in container correctly (#10507)
Co-authored-by: simon-mo <simon.mo@hey.com> Co-authored-by: Richard Liaw <rliaw@berkeley.edu> Co-authored-by: Alex Wu <itswu.alex@gmail.com>
This commit is contained in:
@@ -70,6 +70,7 @@ class TestMemoryScheduling(unittest.TestCase):
|
||||
|
||||
def testTuneDriverHeapLimit(self):
|
||||
try:
|
||||
ray.init(num_cpus=4, _memory=100 * MB)
|
||||
_register_all()
|
||||
result = tune.run(
|
||||
"PG",
|
||||
@@ -89,6 +90,11 @@ class TestMemoryScheduling(unittest.TestCase):
|
||||
|
||||
def testTuneDriverStoreLimit(self):
|
||||
try:
|
||||
ray.init(
|
||||
num_cpus=4,
|
||||
_memory=100 * MB,
|
||||
object_store_memory=100 * MB,
|
||||
)
|
||||
_register_all()
|
||||
self.assertRaisesRegexp(
|
||||
ray.tune.error.TuneError,
|
||||
@@ -107,6 +113,7 @@ class TestMemoryScheduling(unittest.TestCase):
|
||||
|
||||
def testTuneWorkerHeapLimit(self):
|
||||
try:
|
||||
ray.init(num_cpus=4, _memory=100 * MB)
|
||||
_register_all()
|
||||
result = tune.run(
|
||||
"PG",
|
||||
@@ -127,6 +134,11 @@ class TestMemoryScheduling(unittest.TestCase):
|
||||
|
||||
def testTuneWorkerStoreLimit(self):
|
||||
try:
|
||||
ray.init(
|
||||
num_cpus=4,
|
||||
_memory=100 * MB,
|
||||
object_store_memory=100 * MB,
|
||||
)
|
||||
_register_all()
|
||||
self.assertRaisesRegexp(
|
||||
ray.tune.error.TuneError,
|
||||
@@ -144,6 +156,7 @@ class TestMemoryScheduling(unittest.TestCase):
|
||||
|
||||
def testTuneObjectLimitApplied(self):
|
||||
try:
|
||||
ray.init(num_cpus=2, object_store_memory=500 * MB)
|
||||
result = tune.run(
|
||||
train_oom,
|
||||
resources_per_trial={"object_store_memory": 150 * 1024 * 1024},
|
||||
|
||||
Reference in New Issue
Block a user