Skip to content

ray-crash-course/06-Exploring-Ray-API-Calls.ipynb there is an incorrect API parameter #47

@japsonzbz

Description

@japsonzbz

In part @ray.remote(),the argument named num_return_vals is different from that in the Ray Docs.

When I execute the sample code given in notebook:

@ray.remote(num_return_vals=3)
def tuple3(one, two, three):
    return (one, two, three)
...

The following error will appear:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-9-05124ba20d56> in <module>
----> 1 @ray.remote(num_return_vals=3)
      2 def tuple3(one, two, three):
      3     return (one, two, three)
      4 
      5 x_ref, y_ref, z_ref = tuple3.remote("a", 1, 2.2)

~/opt/anaconda3/envs/anyscale-academy/lib/python3.7/site-packages/ray/worker.py in remote(*args, **kwargs)
   1926             "max_task_retries",
   1927             "max_retries",
-> 1928         ], error_string
   1929 
   1930     num_cpus = kwargs["num_cpus"] if "num_cpus" in kwargs else None

AssertionError: The @ray.remote decorator must be applied either with no arguments and no parentheses, for example '@ray.remote', or it must be applied using some of the arguments 'num_returns', 'num_cpus', 'num_gpus', 'memory', 'object_store_memory', 'resources', 'max_calls', or 'max_restarts', like '@ray.remote(num_returns=2, resources={"CustomResource": 1})'.

I checked the documentation Ray v2.0.0.dev0 and the correct parameters should be as follows:

@ray.remote(num_returns=3)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions