Skip to content

Update num_proc handling for vllm and Ray mode#973

Open
ArdalanM wants to merge 1 commit into
datajuicer:mainfrom
ArdalanM:patch-1
Open

Update num_proc handling for vllm and Ray mode#973
ArdalanM wants to merge 1 commit into
datajuicer:mainfrom
ArdalanM:patch-1

Conversation

@ArdalanM
Copy link
Copy Markdown

@ArdalanM ArdalanM commented May 1, 2026

Summary

TextTaggingByPromptMapper was unconditionally setting self.num_proc = 1, which in a
Ray+vLLM run capped the actor pool to a single GPU. The only available multi-GPU strategy
was tensor parallelism (tensor_parallel_size=N); data parallelism was silently broken.

This fix makes num_proc = 1 conditional on the execution backend, so Ray can now schedule
one vLLM actor per GPU — enabling both data parallelism, tensor parallelism, or a
combination of both.

Adjust num_proc initialization based on vllm and Ray mode.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the initialization of the TextTaggingByPromptMapper to conditionally set the number of processes based on whether vLLM and Ray mode are enabled. The goal is to allow Ray to manage data parallelism by scheduling actors per GPU. A review comment suggests that the current implementation unnecessarily restricts parallelism for the HuggingFace backend when running on Ray and provides a suggestion to simplify the logic to check only for Ray mode.

Comment thread data_juicer/ops/mapper/text_tagging_by_prompt_mapper.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant