fix(train): assign SDK-managed channels to instance groups on heterog… - #6116
Conversation
…eneous clusters ModelTrainer injects code/sm_drivers/recipe channels that users cannot configure. On a heterogeneous cluster, SageMaker enforces an all-or-nothing rule: if any channel is assigned to instance groups, every channel must be. So setting instance_group_names on any user channel caused CreateTrainingJob to fail with "Some channels have assigned instance groups ... while others not: [sm_drivers, code]", making instance_group_names unusable with ModelTrainer. When a user assigns instance groups to any channel, assign the SDK-managed channels to the full set of instance groups (code/drivers must be present on every node). Behavior is unchanged when instance groups are not in use. Fixes aws#6089
|
Claude finished @mohamedzeidan2021's task in 2m 42s —— View job PR Review: assign SDK-managed channels to instance groups on heterogeneous clusters
Overall this is a clean, well-scoped fix for issue #6089. The approach is correct: the SDK-injected channels ( What's done well
Minor observations (non-blocking)
No correctness, security, or performance issues found. Nice work on the targeted fix and the regression tests. |
|
Claude finished @mohamedzeidan2021's task in 2m 45s —— View job PR Review: assign SDK-managed channels to instance groups on heterogeneous clusters
This is a clean, correctly-scoped fix for #6089. I traced the full flow and confirm the approach is sound. Correctness — verified
Non-blocking observations
TestsThe three added tests cover the meaningful states cleanly: user-assigns → managed assigned; heterogeneous but user-unassigned → managed stays unset; homogeneous → never assigned. Regression reference to #6089 is helpful. One coverage gap worth a follow-up: a test where the user assigns groups via a No correctness, security, or performance issues found. Nice, targeted fix. ✅ |
|
checks passed from before- just removed comments: https://github.com/aws/sagemaker-python-sdk/actions/runs/30401366494 |
…eneous clusters
ModelTrainer injects code/sm_drivers/recipe channels that users cannot configure. On a heterogeneous cluster, SageMaker enforces an all-or-nothing rule: if any channel is assigned to instance groups, every channel must be. So setting instance_group_names on any user channel caused CreateTrainingJob to fail with "Some channels have assigned instance groups ... while others not: [sm_drivers, code]", making instance_group_names unusable with ModelTrainer.
When a user assigns instance groups to any channel, assign the SDK-managed channels to the full set of instance groups (code/drivers must be present on every node). Behavior is unchanged when instance groups are not in use.
Fixes #6089
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.