feat: add per-node stage worker sizing - #2354
Conversation
Signed-off-by: Praateek <praateekm@gmail.com>
Signed-off-by: Praateek <praateekm@gmail.com>
|
🌿 Preview your docs: https://nvidia-preview-praateek-num-workers-per-node.docs.buildwithfern.com/nemo/curator Here are the markdown pages you've updated: |
Greptile SummaryThis PR adds backend-neutral per-node worker sizing and translates it into backend-specific worker-pool configuration.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Stage["ProcessingStage.num_workers_per_node()"] --> Validate["Validate finite positive value"]
Validate --> RayData["Ray Data: ceil(value × alive nodes)"]
Validate --> ActorPool["Ray Actor Pool: ceil(value × alive nodes), then cap"]
Validate --> Xenna["Xenna: forward per-node value"]
Reviews (2): Last reviewed commit: "fix: reject non-finite per-node worker c..." | Re-trigger Greptile |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
| raise ValueError(msg) | ||
|
|
||
| if total_pool_size is not None: | ||
| map_batches_kwargs["scheduling_strategy"] = "SPREAD" |
There was a problem hiding this comment.
Thoughts on SPREAD vs STRICT_SPREAD for this given that num_workers_per_node seems to be a fixed/opinionated config?
| if num_workers_per_node is None: | ||
| return None | ||
|
|
||
| node_count = get_alive_ray_node_count(ignore_head_node=self.ignore_head_node) |
There was a problem hiding this comment.
I think the docs mention this but we're not guaranteed to avoid scheduling on the head node in some cases.
Do you forsee this causing issues for setups?
Summary
ProcessingStage.num_workers_per_node()andwith_(num_workers_per_node=...)configuration.ceil(workers_per_node * alive_nodes)with best-effortSPREADplacement and head-node-aware counting.API changes
num_workers,num_workers_per_node, and Ray Data actor-pool min/max/initial sizing are mutually exclusive.ImageDuplicatesRemovalStage(num_workers_per_node=...)is replaced byImageDuplicatesRemovalStage(...).with_(num_workers_per_node=...).xenna_stage_spec()["num_workers_per_node"]configurations remain supported when the common worker hooks are unset.Validation
Replaces #2198.
Fixes #2197.