# Run ray dataset.map\_batch in ray task

**URL:** <https://discuss.ray.io/t/run-ray-dataset-map-batch-in-ray-task/20771>\
**Category:** Ray Client\
**Created:** [November 27, 2024, 2:45am UTC](https://discuss.ray.io/t/run-ray-dataset-map-batch-in-ray-task/20771 "2024-11-27T02:45:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent-pli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/vincent-pli/32/7360_2.png) [@vincent-pli](https://discuss.ray.io/u/vincent-pli)\
**Post date:** [November 27, 2024, 2:45am UTC](https://discuss.ray.io/t/run-ray-dataset-map-batch-in-ray-task/20771/1 "2024-11-27T02:45:59Z")

</div>

Since Ray data doesn’t support Ray client([[Data] Ray client error "Global node is not initialized." · Issue #41333 · ray-project/ray · GitHub](https://github.com/ray-project/ray/issues/41333)). I have to run dataset.map\_batches as ray task.

but I got little confuse about the concurrence,  
I saw params `concurrency` for `dataset.map_batches`, it means ray worker to use concurrently, that’s great.  
but when I run it in ray task, with @remote(cpu\_num=1), and `concurrency = 4`, does that means a confliction? how to understand and guarantee the resource between task and `dataset.map_batch` running in that task.

thanks
