Remote ray call Ignoring function arguments

How severe does this issue affect your experience of using Ray?

  • None: Just asking a question out of curiosity
  • Low: It annoys or frustrates me for a moment.
  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.
  • High: It blocks me to complete my task.

I am trying to apply ray to a transformer pipeline as:

@ray.remote
def predict(pipeline, text_data, max_length, min_length, do_sample):
    return pipeline(text_data, max_length, min_length, do_sample)

and initializing as:

predictions = ray.get(predict.remote(pipe_1, section, max_length=some_length, min_length=some_length, do_sample=False))

the pipeline pipe_1 is defined using ray.put()

pipe_1 = ray.put("transformer pipeline method definition")

Pipeline method definition is similar to as described here. I have initialized ray.init() as :
ray.init(num_cpus=num_cpus, ignore_reinit_error=True)

However its seems my *args are being ignored. Looks like max_length, min_length and do_sample arguments are ignored - below is the sample console output:

(predict pid=19440) Ignoring args : (529, 423, False)
(predict pid=19440) Ignoring args : (680, 544, False)

Any suggestions.

Sorry I’m not exactly sure what you mean by the args getting ignored. Could you post a runnable reproduction, preferably without the actual pipeline (you can just use an empty function)?

I’m not sure if this is related to your issue, but I would also suggest calling pipeline as a remote function instead of passing it into the wrapper task. This is likely to be more efficient and fault-tolerant, as Ray will broadcast the pipeline definition to all workers beforehand. You can do this like so:

pipe1 = "transformer pipeline method definition"
pipe1_remote_fn = ray.remote(pipe1)
pipe1_remote_fn.remote(section, max_length=some_length, min_length=some_length, do_sample=False)