Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/autoscaler_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/common_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/core_worker_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/dependency_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/event_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_actor_data_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_driver_job_event_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_driver_job_event_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_event_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_node_data_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_node_data_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_runtime_env_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_runtime_env_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_submission_job_event_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_task_event_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_task_event_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/gcs_service_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/instance_manager_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/logging_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/logging_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/metrics_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/metrics_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/node_manager_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/ray_client_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/ray_client_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/reporter_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_agent_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_agent_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_common_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_common_pb2_grpc.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/usage_pb2.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/__pycache__/__init__.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/__init__.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/linalg.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/random.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/__init__.py +44 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/__init__.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/core.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/linalg.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/random.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/core.py +99 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/linalg.py +126 -0
- .venv/lib/python3.11/site-packages/ray/experimental/array/remote/random.py +8 -0
- .venv/lib/python3.11/site-packages/ray/experimental/dynamic_resources.py +7 -0
- .venv/lib/python3.11/site-packages/ray/experimental/job/__init__.py +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/job/__pycache__/__init__.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/job/example_job/demo_script.py +77 -0
- .venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__init__.py +5 -0
- .venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__pycache__/__init__.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__pycache__/pool.cpython-311.pyc +0 -0
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/autoscaler_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (10.3 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/common_pb2.cpython-311.pyc
ADDED
|
Binary file (41.2 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/core_worker_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (32.6 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/dependency_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (311 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/event_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (3.65 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_actor_data_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (318 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_driver_job_event_pb2.cpython-311.pyc
ADDED
|
Binary file (3.06 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_driver_job_event_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (324 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_event_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (313 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_node_data_pb2.cpython-311.pyc
ADDED
|
Binary file (3.84 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_node_data_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (317 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_runtime_env_pb2.cpython-311.pyc
ADDED
|
Binary file (2.68 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_runtime_env_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (319 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_submission_job_event_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (328 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_task_event_pb2.cpython-311.pyc
ADDED
|
Binary file (7.16 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/export_task_event_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (318 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/gcs_service_pb2.cpython-311.pyc
ADDED
|
Binary file (58.5 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/instance_manager_pb2.cpython-311.pyc
ADDED
|
Binary file (9.88 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/logging_pb2.cpython-311.pyc
ADDED
|
Binary file (1.58 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/logging_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (308 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/metrics_pb2.cpython-311.pyc
ADDED
|
Binary file (9.55 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/metrics_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (308 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/node_manager_pb2.cpython-311.pyc
ADDED
|
Binary file (26 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/ray_client_pb2.cpython-311.pyc
ADDED
|
Binary file (25.5 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/ray_client_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (25 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/reporter_pb2.cpython-311.pyc
ADDED
|
Binary file (7.12 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_agent_pb2.cpython-311.pyc
ADDED
|
Binary file (4.31 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_agent_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (318 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_common_pb2.cpython-311.pyc
ADDED
|
Binary file (3.12 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/runtime_env_common_pb2_grpc.cpython-311.pyc
ADDED
|
Binary file (319 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/core/generated/__pycache__/usage_pb2.cpython-311.pyc
ADDED
|
Binary file (7.29 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (195 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (880 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/linalg.cpython-311.pyc
ADDED
|
Binary file (13.4 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/distributed/__pycache__/random.cpython-311.pyc
ADDED
|
Binary file (1.15 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from . import linalg, random
|
| 2 |
+
from .core import (
|
| 3 |
+
add,
|
| 4 |
+
copy,
|
| 5 |
+
diag,
|
| 6 |
+
dot,
|
| 7 |
+
eye,
|
| 8 |
+
hstack,
|
| 9 |
+
ones,
|
| 10 |
+
shape,
|
| 11 |
+
subarray,
|
| 12 |
+
subtract,
|
| 13 |
+
sum,
|
| 14 |
+
sum_list,
|
| 15 |
+
transpose,
|
| 16 |
+
tril,
|
| 17 |
+
triu,
|
| 18 |
+
vstack,
|
| 19 |
+
zeros,
|
| 20 |
+
zeros_like,
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
__all__ = [
|
| 24 |
+
"random",
|
| 25 |
+
"linalg",
|
| 26 |
+
"zeros",
|
| 27 |
+
"zeros_like",
|
| 28 |
+
"ones",
|
| 29 |
+
"eye",
|
| 30 |
+
"dot",
|
| 31 |
+
"vstack",
|
| 32 |
+
"hstack",
|
| 33 |
+
"subarray",
|
| 34 |
+
"copy",
|
| 35 |
+
"tril",
|
| 36 |
+
"triu",
|
| 37 |
+
"diag",
|
| 38 |
+
"transpose",
|
| 39 |
+
"add",
|
| 40 |
+
"subtract",
|
| 41 |
+
"sum",
|
| 42 |
+
"shape",
|
| 43 |
+
"sum_list",
|
| 44 |
+
]
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (915 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/core.cpython-311.pyc
ADDED
|
Binary file (5.2 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/linalg.cpython-311.pyc
ADDED
|
Binary file (5.04 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/__pycache__/random.cpython-311.pyc
ADDED
|
Binary file (526 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/core.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
import ray
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@ray.remote
|
| 7 |
+
def zeros(shape, dtype_name="float", order="C"):
|
| 8 |
+
return np.zeros(shape, dtype=np.dtype(dtype_name), order=order)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@ray.remote
|
| 12 |
+
def zeros_like(a, dtype_name="None", order="K", subok=True):
|
| 13 |
+
dtype_val = None if dtype_name == "None" else np.dtype(dtype_name)
|
| 14 |
+
return np.zeros_like(a, dtype=dtype_val, order=order, subok=subok)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
@ray.remote
|
| 18 |
+
def ones(shape, dtype_name="float", order="C"):
|
| 19 |
+
return np.ones(shape, dtype=np.dtype(dtype_name), order=order)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@ray.remote
|
| 23 |
+
def eye(N, M=-1, k=0, dtype_name="float"):
|
| 24 |
+
M = N if M == -1 else M
|
| 25 |
+
return np.eye(N, M=M, k=k, dtype=np.dtype(dtype_name))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
@ray.remote
|
| 29 |
+
def dot(a, b):
|
| 30 |
+
return np.dot(a, b)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
@ray.remote
|
| 34 |
+
def vstack(*xs):
|
| 35 |
+
return np.vstack(xs)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
@ray.remote
|
| 39 |
+
def hstack(*xs):
|
| 40 |
+
return np.hstack(xs)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
# TODO(rkn): Instead of this, consider implementing slicing.
|
| 44 |
+
# TODO(rkn): Be consistent about using "index" versus "indices".
|
| 45 |
+
@ray.remote
|
| 46 |
+
def subarray(a, lower_indices, upper_indices):
|
| 47 |
+
idx = tuple(slice(l, u) for (l, u) in zip(lower_indices, upper_indices))
|
| 48 |
+
return a[idx]
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
@ray.remote
|
| 52 |
+
def copy(a, order="K"):
|
| 53 |
+
return np.copy(a, order=order)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
@ray.remote
|
| 57 |
+
def tril(m, k=0):
|
| 58 |
+
return np.tril(m, k=k)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
@ray.remote
|
| 62 |
+
def triu(m, k=0):
|
| 63 |
+
return np.triu(m, k=k)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@ray.remote
|
| 67 |
+
def diag(v, k=0):
|
| 68 |
+
return np.diag(v, k=k)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
@ray.remote
|
| 72 |
+
def transpose(a, axes=None):
|
| 73 |
+
axes = None if (axes == [] or axes is None) else axes
|
| 74 |
+
return np.transpose(a, axes=axes)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
@ray.remote
|
| 78 |
+
def add(x1, x2):
|
| 79 |
+
return np.add(x1, x2)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
@ray.remote
|
| 83 |
+
def subtract(x1, x2):
|
| 84 |
+
return np.subtract(x1, x2)
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
@ray.remote
|
| 88 |
+
def sum(x, axis=-1):
|
| 89 |
+
return np.sum(x, axis=axis if axis != -1 else None)
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
@ray.remote
|
| 93 |
+
def shape(a):
|
| 94 |
+
return np.shape(a)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
@ray.remote
|
| 98 |
+
def sum_list(*xs):
|
| 99 |
+
return np.sum(xs, axis=0)
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/linalg.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
import ray
|
| 4 |
+
|
| 5 |
+
__all__ = [
|
| 6 |
+
"matrix_power",
|
| 7 |
+
"solve",
|
| 8 |
+
"tensorsolve",
|
| 9 |
+
"tensorinv",
|
| 10 |
+
"inv",
|
| 11 |
+
"cholesky",
|
| 12 |
+
"eigvals",
|
| 13 |
+
"eigvalsh",
|
| 14 |
+
"pinv",
|
| 15 |
+
"slogdet",
|
| 16 |
+
"det",
|
| 17 |
+
"svd",
|
| 18 |
+
"eig",
|
| 19 |
+
"eigh",
|
| 20 |
+
"lstsq",
|
| 21 |
+
"norm",
|
| 22 |
+
"qr",
|
| 23 |
+
"cond",
|
| 24 |
+
"matrix_rank",
|
| 25 |
+
"multi_dot",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
@ray.remote
|
| 30 |
+
def matrix_power(M, n):
|
| 31 |
+
return np.linalg.matrix_power(M, n)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@ray.remote
|
| 35 |
+
def solve(a, b):
|
| 36 |
+
return np.linalg.solve(a, b)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
@ray.remote(num_returns=2)
|
| 40 |
+
def tensorsolve(a):
|
| 41 |
+
raise NotImplementedError
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
@ray.remote(num_returns=2)
|
| 45 |
+
def tensorinv(a):
|
| 46 |
+
raise NotImplementedError
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
@ray.remote
|
| 50 |
+
def inv(a):
|
| 51 |
+
return np.linalg.inv(a)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
@ray.remote
|
| 55 |
+
def cholesky(a):
|
| 56 |
+
return np.linalg.cholesky(a)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
@ray.remote
|
| 60 |
+
def eigvals(a):
|
| 61 |
+
return np.linalg.eigvals(a)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
@ray.remote
|
| 65 |
+
def eigvalsh(a):
|
| 66 |
+
raise NotImplementedError
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
@ray.remote
|
| 70 |
+
def pinv(a):
|
| 71 |
+
return np.linalg.pinv(a)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
@ray.remote
|
| 75 |
+
def slogdet(a):
|
| 76 |
+
raise NotImplementedError
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
@ray.remote
|
| 80 |
+
def det(a):
|
| 81 |
+
return np.linalg.det(a)
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
@ray.remote(num_returns=3)
|
| 85 |
+
def svd(a):
|
| 86 |
+
return np.linalg.svd(a)
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
@ray.remote(num_returns=2)
|
| 90 |
+
def eig(a):
|
| 91 |
+
return np.linalg.eig(a)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
@ray.remote(num_returns=2)
|
| 95 |
+
def eigh(a):
|
| 96 |
+
return np.linalg.eigh(a)
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
@ray.remote(num_returns=4)
|
| 100 |
+
def lstsq(a, b):
|
| 101 |
+
return np.linalg.lstsq(a)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
@ray.remote
|
| 105 |
+
def norm(x):
|
| 106 |
+
return np.linalg.norm(x)
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
@ray.remote(num_returns=2)
|
| 110 |
+
def qr(a):
|
| 111 |
+
return np.linalg.qr(a)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
@ray.remote
|
| 115 |
+
def cond(x):
|
| 116 |
+
return np.linalg.cond(x)
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
@ray.remote
|
| 120 |
+
def matrix_rank(M):
|
| 121 |
+
return np.linalg.matrix_rank(M)
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
@ray.remote
|
| 125 |
+
def multi_dot(*a):
|
| 126 |
+
raise NotImplementedError
|
.venv/lib/python3.11/site-packages/ray/experimental/array/remote/random.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
import ray
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@ray.remote
|
| 7 |
+
def normal(shape):
|
| 8 |
+
return np.random.normal(size=shape)
|
.venv/lib/python3.11/site-packages/ray/experimental/dynamic_resources.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def set_resource(resource_name, capacity, node_id=None):
|
| 2 |
+
raise DeprecationWarning(
|
| 3 |
+
"Dynamic custom resources are deprecated. Consider using placement "
|
| 4 |
+
"groups instead (docs.ray.io/en/master/placement-group.html). You "
|
| 5 |
+
"can also specify resources at Ray start time with the 'resources' "
|
| 6 |
+
"field in the cluster autoscaler."
|
| 7 |
+
)
|
.venv/lib/python3.11/site-packages/ray/experimental/job/__init__.py
ADDED
|
File without changes
|
.venv/lib/python3.11/site-packages/ray/experimental/job/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (193 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/job/example_job/demo_script.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Regular ray application that user wrote and runs on local cluster.
|
| 2 |
+
# intermediate status are dumped to GCS
|
| 3 |
+
import argparse
|
| 4 |
+
import time
|
| 5 |
+
|
| 6 |
+
import ray
|
| 7 |
+
import ray.experimental.internal_kv as ray_kv
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
@ray.remote
|
| 11 |
+
class StepActor:
|
| 12 |
+
def __init__(self, interval_s=1, total_steps=3):
|
| 13 |
+
self.interval_s = interval_s
|
| 14 |
+
self.stopped = False
|
| 15 |
+
self.current_step = 1
|
| 16 |
+
self.total_steps = total_steps
|
| 17 |
+
|
| 18 |
+
worker = ray._private.worker.global_worker
|
| 19 |
+
worker_id = worker.core_worker.get_actor_id()
|
| 20 |
+
ray_kv._internal_kv_put(f"JOB:{worker_id}", self.current_step, overwrite=True)
|
| 21 |
+
|
| 22 |
+
def run(self):
|
| 23 |
+
worker = ray._private.worker.global_worker
|
| 24 |
+
worker_id = worker.core_worker.get_actor_id()
|
| 25 |
+
|
| 26 |
+
while self.current_step <= self.total_steps:
|
| 27 |
+
if not self.stopped:
|
| 28 |
+
print(
|
| 29 |
+
f"Sleeping {self.interval_s} secs to executing "
|
| 30 |
+
f"step {self.current_step}"
|
| 31 |
+
)
|
| 32 |
+
time.sleep(self.interval_s)
|
| 33 |
+
self.current_step += 1
|
| 34 |
+
ray_kv._internal_kv_put(
|
| 35 |
+
f"JOB:{worker_id}", self.current_step, overwrite=True
|
| 36 |
+
)
|
| 37 |
+
else:
|
| 38 |
+
print("Stop called or reached final step.")
|
| 39 |
+
break
|
| 40 |
+
|
| 41 |
+
self.stopped = True
|
| 42 |
+
ray_kv._internal_kv_put(f"JOB:{worker_id}", "DONE", overwrite=True)
|
| 43 |
+
return "DONE"
|
| 44 |
+
|
| 45 |
+
def get_step(self):
|
| 46 |
+
return self.current_step
|
| 47 |
+
|
| 48 |
+
def stop(self):
|
| 49 |
+
self.stopped = True
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
if __name__ == "__main__":
|
| 53 |
+
parser = argparse.ArgumentParser()
|
| 54 |
+
parser.add_argument(
|
| 55 |
+
"--interval-s",
|
| 56 |
+
required=False,
|
| 57 |
+
type=int,
|
| 58 |
+
default=1,
|
| 59 |
+
help="Address to use to connect to Ray",
|
| 60 |
+
)
|
| 61 |
+
parser.add_argument(
|
| 62 |
+
"--total-steps",
|
| 63 |
+
required=False,
|
| 64 |
+
type=int,
|
| 65 |
+
default=3,
|
| 66 |
+
help="Password for connecting to Redis",
|
| 67 |
+
)
|
| 68 |
+
args, _ = parser.parse_known_args()
|
| 69 |
+
|
| 70 |
+
ray.init()
|
| 71 |
+
step_actor = StepActor.remote(
|
| 72 |
+
interval_s=args.interval_s, total_steps=args.total_steps
|
| 73 |
+
)
|
| 74 |
+
ref = step_actor.run.remote()
|
| 75 |
+
print(ray.get([ref]))
|
| 76 |
+
job_key = ray_kv._internal_kv_list("JOB:")[0]
|
| 77 |
+
print(f"{job_key}, {ray_kv._internal_kv_get(job_key)}")
|
.venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__init__.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from multiprocessing import TimeoutError
|
| 2 |
+
|
| 3 |
+
from .pool import Pool
|
| 4 |
+
|
| 5 |
+
__all__ = ["Pool", "TimeoutError"]
|
.venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (360 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/ray/experimental/multiprocessing/__pycache__/pool.cpython-311.pyc
ADDED
|
Binary file (501 Bytes). View file
|
|
|