-
Notifications
You must be signed in to change notification settings - Fork 7k
[data][llm] Ray Data LLM Config Refactor #58298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kouroshHakha
merged 27 commits into
ray-project:master
from
nrghosh:nrghosh/data-llm-config-refactor
Nov 19, 2025
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
7458b28
Data LLM Config Refactor - Part 1
nrghosh beb5d98
Data LLM Config Refactor - Part 2
nrghosh 1327d43
Data LLM Config Refactor - Part 3: Update SGLang processor with stage…
nrghosh 399ef58
Data LLM Config Refactor - Part 4: Add deprecation warnings for legac…
nrghosh 275a93d
Data LLM Config Refactor - Part 5: Update public API docstrings
nrghosh 5299043
wip - feedback: Fix config mutation and chat_template_kwargs bugs
nrghosh 2cf40d4
wip - feedback: Add concurrency to resolve_stage_config and fix CPU s…
nrghosh 163f51f
wip - feedback: Fix runtime_env and batch_size falsy value handling
nrghosh 89ba2fe
wip - Add num_cpus and memory support to StageConfig for per-stage re…
nrghosh 42dcaf0
wip - feedback: fix or operators to checks
nrghosh 5a607f6
wip - feedback: Fix resolve_stage_config to raise TypeError for unsup…
nrghosh 45dcf5e
wip
nrghosh 31ec8f6
wip - readability: refactor merging logic and simplify expressions
nrghosh cee0247
wip - cleanup: remove redundant checks for merged fields
nrghosh b938ba8
wip - extract CPU stage building helpers to shared utils module
nrghosh f4e2a5c
wip - detailed public API docstrings for nested stage configs
nrghosh 636e957
wip - Fix: handle None values in legacy flag coercion
nrghosh 245f521
Merge branch 'master' into nrghosh/data-llm-config-refactor
nrghosh 12bffb3
Update python/ray/llm/_internal/batch/processor/sglang_engine_proc.py
nrghosh 7c8d97f
Update python/ray/llm/_internal/batch/processor/vllm_engine_proc.py
nrghosh 66fee73
Merge branch 'master' into nrghosh/data-llm-config-refactor
nrghosh 474f119
Data LLM Config Refactor - Part 6: Add unit tests for stage config re…
nrghosh f0f7fdf
wip - fix None concurrency in `normalize_cpu_stage_concurrency`
nrghosh 4e35742
wip - update tests to use nested StageConfig schema
nrghosh 3293d47
wip
nrghosh c200da2
fix test
nrghosh cac411a
wip - test
nrghosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| """Shared utility functions for processor builders.""" | ||
|
|
||
| from typing import Any, Dict, Optional, Tuple, Union | ||
|
|
||
| from ray.llm._internal.batch.stages.configs import _StageConfigBase | ||
|
|
||
|
|
||
| def get_value_or_fallback(value: Any, fallback: Any) -> Any: | ||
| """Return value if not None, otherwise return fallback.""" | ||
| return value if value is not None else fallback | ||
|
|
||
|
|
||
| def extract_resource_kwargs( | ||
| runtime_env: Optional[Dict[str, Any]], | ||
| num_cpus: Optional[float], | ||
| memory: Optional[float], | ||
| ) -> Dict[str, Any]: | ||
| """Extract non-None resource kwargs for map_batches.""" | ||
| kwargs = {} | ||
| if runtime_env is not None: | ||
| kwargs["runtime_env"] = runtime_env | ||
| if num_cpus is not None: | ||
| kwargs["num_cpus"] = num_cpus | ||
| if memory is not None: | ||
| kwargs["memory"] = memory | ||
| return kwargs | ||
|
|
||
|
|
||
| def normalize_cpu_stage_concurrency( | ||
| concurrency: Optional[Union[int, Tuple[int, int]]] | ||
| ) -> Tuple[int, int]: | ||
| """Normalize concurrency for CPU stages (int -> (1, int) for autoscaling).""" | ||
| if concurrency is None: | ||
| return (1, 1) # Default to minimal autoscaling pool | ||
| if isinstance(concurrency, int): | ||
| return (1, concurrency) | ||
| return concurrency | ||
|
|
||
|
|
||
| def build_cpu_stage_map_kwargs( | ||
| stage_cfg: _StageConfigBase, | ||
| ) -> Dict[str, Any]: | ||
| """Build map_batches_kwargs for CPU stages.""" | ||
| concurrency = normalize_cpu_stage_concurrency(stage_cfg.concurrency) | ||
| return dict( | ||
| zero_copy_batch=True, | ||
| concurrency=concurrency, | ||
| batch_size=stage_cfg.batch_size, | ||
| **extract_resource_kwargs( | ||
| stage_cfg.runtime_env, | ||
| stage_cfg.num_cpus, | ||
| stage_cfg.memory, | ||
| ), | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.