MCPcopy
hub / github.com/ray-project/ray / options

Method options

python/ray/remote_function.py:190–310  ·  view source on GitHub ↗

Configures and overrides the task invocation parameters. The arguments are the same as those that can be passed to :obj:`ray.remote`. Overriding `max_calls` is not supported. Args: num_returns: It specifies the number of object refs returned by t

(self, **task_options)

Source from the content-addressed store, hash-verified

188 self.__dict__["_inject_lock"] = Lock()
189
190 def options(self, **task_options):
191 """Configures and overrides the task invocation parameters.
192
193 The arguments are the same as those that can be passed to :obj:`ray.remote`.
194 Overriding `max_calls` is not supported.
195
196 Args:
197 num_returns: It specifies the number of object refs returned by
198 the remote function invocation.
199 num_cpus: The quantity of CPU cores to reserve
200 for this task or for the lifetime of the actor.
201 num_gpus: The quantity of GPUs to reserve
202 for this task or for the lifetime of the actor.
203 resources (Dict[str, float]): The quantity of various custom resources
204 to reserve for this task or for the lifetime of the actor.
205 This is a dictionary mapping strings (resource names) to floats.
206 label_selector (Dict[str, str]): If specified, the labels required for the node on
207 which this actor can be scheduled on. The label selector consist of key-value pairs,
208 where the keys are label names and the value are expressions consisting of an operator
209 with label values or just a value to indicate equality.
210 fallback_strategy (List[Dict[str, Any]]): If specified, expresses soft constraints
211 through a list of decorator options to fall back on when scheduling on a node.
212 accelerator_type: If specified, requires that the task or actor run
213 on a node with the specified type of accelerator.
214 See :ref:`accelerator types <accelerator_types>`.
215 memory: The heap memory request in bytes for this task/actor,
216 rounded down to the nearest integer.
217 object_store_memory: The object store memory request for actors only.
218 max_calls: This specifies the
219 maximum number of times that a given worker can execute
220 the given remote function before it must exit
221 (this can be used to address memory leaks in third-party
222 libraries or to reclaim resources that cannot easily be
223 released, e.g., GPU memory that was acquired by TensorFlow).
224 By default this is infinite for CPU tasks and 1 for GPU tasks
225 (to force GPU tasks to release resources after finishing).
226 max_retries: This specifies the maximum number of times that the remote
227 function should be rerun when the worker process executing it
228 crashes unexpectedly. The minimum valid value is 0,
229 the default is 3 (default), and a value of -1 indicates
230 infinite retries.
231 runtime_env (Dict[str, Any]): Specifies the runtime environment for
232 this actor or task and its children. See
233 :ref:`runtime-environments` for detailed documentation.
234 retry_exceptions: This specifies whether application-level errors
235 should be retried up to max_retries times.
236 scheduling_strategy: Strategy about how to
237 schedule a remote function or actor. Possible values are
238 None: ray will figure out the scheduling strategy to use, it
239 will either be the PlacementGroupSchedulingStrategy using parent&#x27;s
240 placement group if parent has one and has
241 placement_group_capture_child_tasks set to true,
242 or "DEFAULT";
243 "DEFAULT": default hybrid scheduling;
244 "SPREAD": best effort spread scheduling;
245 `PlacementGroupSchedulingStrategy`:
246 placement group based scheduling;
247 `NodeAffinitySchedulingStrategy`:

Callers

nothing calls this directly

Calls 5

get_runtime_env_infoFunction · 0.90
FuncWrapperClass · 0.85
copyMethod · 0.65
popMethod · 0.45

Tested by

no test coverage detected