17
17
from dask .utils import parse_bytes
18
18
19
19
from ..diagnostics .nvml import has_cuda_context
20
- from ..utils import ensure_ip , get_ip , get_ipv6 , log_errors , nbytes
20
+ from ..utils import ensure_ip , get_ip , get_ipv6 , host_array , log_errors , nbytes
21
21
from .addressing import parse_host_port , unparse_host_port
22
22
from .core import Comm , CommClosedError , Connector , Listener
23
23
from .registry import Backend , backends
41
41
ucx_create_endpoint = None # type: ignore
42
42
ucx_create_listener = None # type: ignore
43
43
44
- host_array = None
45
44
device_array = None
46
45
pre_existing_cuda_context = False
47
46
cuda_context_created = False
@@ -57,7 +56,7 @@ def synchronize_stream(stream=0):
57
56
58
57
59
58
def init_once ():
60
- global ucp , host_array , device_array
59
+ global ucp , device_array
61
60
global ucx_create_endpoint , ucx_create_listener
62
61
global pre_existing_cuda_context , cuda_context_created
63
62
@@ -115,14 +114,6 @@ def init_once():
115
114
116
115
ucp .init (options = ucx_config , env_takes_precedence = True )
117
116
118
- # Find the function, `host_array()`, to use when allocating new host arrays
119
- try :
120
- import numpy
121
-
122
- host_array = lambda n : numpy .empty ((n ,), dtype = "u1" )
123
- except ImportError :
124
- host_array = lambda n : bytearray (n )
125
-
126
117
# Find the function, `cuda_array()`, to use when allocating new CUDA arrays
127
118
try :
128
119
import rmm
0 commit comments