# Remote ray call Ignoring function arguments

**URL:** <https://discuss.ray.io/t/remote-ray-call-ignoring-function-arguments/7413>\
**Category:** Ray Core\
**Created:** [September 2, 2022, 4:37pm UTC](https://discuss.ray.io/t/remote-ray-call-ignoring-function-arguments/7413 "2022-09-02T16:37:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamAct](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/samact/32/3119_2.png) [@SamAct](https://discuss.ray.io/u/SamAct)\
**Post date:** [September 2, 2022, 4:37pm UTC](https://discuss.ray.io/t/remote-ray-call-ignoring-function-arguments/7413/1 "2022-09-02T16:37:09Z")

</div>

**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](https://huggingface.co/facebook/bart-large-cnn). 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.

---

<div class="post-metadata">

**Author:** ![Stephanie\_Wang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/stephanie_wang/32/18_2.png) [@Stephanie\_Wang](https://discuss.ray.io/u/Stephanie_Wang)\
**Post date:** [September 6, 2022, 9:11pm UTC](https://discuss.ray.io/t/remote-ray-call-ignoring-function-arguments/7413/2 "2022-09-06T21:11:31Z")

</div>

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:

```python
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)

```
