Repository navigation
[train][torchft] Fix Lighthouse Actor unschedulable error - #68635
Open
JasonLi1909 wants to merge 5 commits into
Open
JasonLi1909 wants to merge 5 commits into
JasonLi1909 wants to merge 5 commits into
Conversation
The Lighthouse actor is pinned with a hard node affinity to the Train controller's node, which is the driver's node and often a head node with no logical CPUs. Ray schedules an actor with 1 CPU by default, so on such a head node the actor is infeasible and TorchTrainer.fit() fails with ActorUnschedulableError. Schedule the actor with num_cpus=0 and add a regression test with a zero-CPU head node. Signed-off-by: JasonLi1909 <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request configures the LighthouseServerActor to reserve zero CPUs, allowing it to run on head nodes with no logical CPUs. It also introduces a new test suite, test_torchft_scheduling.py, to verify this behavior. Feedback suggests adding pytest.importorskip("torchft") to the test file to prevent failures in environments where torchft is not supported or installed.
…iner.py Use the per-test ray_start_4_cpus fixture from conftest.py instead of a module-scoped override, like the other test files that mix cluster setups, so the multi-node test can live next to the other torchft tests. Bump the target to large for the added per-test Ray startup. Signed-off-by: JasonLi1909 <[email protected]>
The driver attaches to the head node, so assert that instead of pinning a task there. Signed-off-by: JasonLi1909 <[email protected]>
Pass num_cpus=0 in the .options() call next to its node affinity, the way the controller and other Ray Train actors set resources, instead of in the class decorator. Signed-off-by: JasonLi1909 <[email protected]>
Signed-off-by: JasonLi1909 <[email protected]>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
#61156 pins the torchft Lighthouse actor, with a hard node affinity, to the Train controller's node, which is the driver's node. The actor sets no resources, so Ray requires 1 CPU to schedule it. On a head node with no CPUs, the default on Anyscale, the actor is infeasible and every
TorchftConfigrun fails at startup:The fix schedules the Lighthouse with
num_cpus=0, like the controller. CI missed this because the torchft tests run onray.init(num_cpus=4).Changes
num_cpus=0in the Lighthouse's.options()call, next to its node affinity, the way the controller and other Ray Train actors set resources where they're created.test_torch_trainer.py. To fit its multi-nodeClusterthere, the file now uses the per-testray_start_4_cpusfromconftest.pyinstead of a module-scoped override, like other files that mix cluster setups, and the target is bumped tolargefor the extra Ray startups.Tests
test_torchft_lighthouse_on_zero_cpu_head_node: new. Trains the torchft linear example from a 0-CPU head node with a 4-CPU worker node. Runs in the torchft CI image. Not run locally, since torchft only ships Linux wheels.torchft_config.pyas master), with onlytorchft.coordination.LighthouseServerstubbed: the error above before the fix, and a clean run after.Not a duplicate: no existing issue or PR covers this. Found while validating the torchft guide example (#68464). AI assistance was used.