mirror of
https://github.com/wassname/ray.git
synced 2026-08-05 13:21:03 +08:00
Make sure user seeding does not affect actor ID generation. (#506)
* Make sure user seeding does not affect actor ID generation. * Fix linting. * Add test.
This commit is contained in:
committed by
Philipp Moritz
parent
e50a23b820
commit
245c8ab888
+1
-6
@@ -5,7 +5,6 @@ from __future__ import print_function
|
||||
import hashlib
|
||||
import inspect
|
||||
import json
|
||||
import numpy as np
|
||||
import random
|
||||
import redis
|
||||
import traceback
|
||||
@@ -14,7 +13,7 @@ import ray.local_scheduler
|
||||
import ray.pickling as pickling
|
||||
import ray.signature as signature
|
||||
import ray.worker
|
||||
from ray.utils import binary_to_hex, hex_to_binary
|
||||
from ray.utils import random_string, binary_to_hex, hex_to_binary
|
||||
|
||||
# This is a variable used by each actor to indicate the IDs of the GPUs that
|
||||
# the worker is currently allowed to use.
|
||||
@@ -30,10 +29,6 @@ def get_gpu_ids():
|
||||
return gpu_ids
|
||||
|
||||
|
||||
def random_string():
|
||||
return np.random.bytes(20)
|
||||
|
||||
|
||||
def random_actor_id():
|
||||
return ray.local_scheduler.ObjectID(random_string())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user