Skip to content

[train][torchft] Remove ray.train.report from test case that continues training with fewer workers - #63783

Merged
elliot-barn merged 2 commits into
ray-project:masterfrom
TimothySeah:tseah/remove-min-workers-case-torchft
Jun 3, 2026
Merged

elliot-barn merged 2 commits into
ray-project:masterfrom
TimothySeah:tseah/remove-min-workers-case-torchft

Conversation

@TimothySeah

Copy link
Copy Markdown
Contributor

Summary

If torchft's min_replicas is less than ScalingConfig's num_workers, training can continue even if not all workers are present. However, ray.train.report only works if all ScalingConfig.num_workers workers form a barrier by calling ray.train.report. If the surviving worker calls ray.train.report after training, it will hang indefinitely - I need to investigate why the replacement worker fails to join the same barrier (take a look at these logs: https://gist.github.com/TimothySeah/1b6af036119b6fa284505ad48df3f4f9), but since we are optimizing for the "fixed training + ray data happy path," I think it's fine to punt this for now.

Testing

Failing unit test now passes.

…s training with fewer workers

Signed-off-by: Timothy Seah <[email protected]>
@TimothySeah
TimothySeah requested a review from a team as a code owner June 2, 2026 00:05

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

Copy link
Copy Markdown
Contributor

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 introduces a temporary workaround to conditionally report training progress based on whether all workers are required for training (training_requires_all_workers), updating both the example and test suite. The reviewer suggests optimizing the training loop in torchft_linear_example.py by checking the training_requires_all_workers condition before entering the tempfile.TemporaryDirectory() context manager to avoid unnecessary disk I/O operations when reporting is skipped.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@ray-gardener ray-gardener Bot added the train Ray Train Related Issue label Jun 2, 2026
@elliot-barn elliot-barn added the go add ONLY when ready to merge, run all tests label Jun 3, 2026
@elliot-barn
elliot-barn merged commit 416d5a3 into ray-project:master Jun 3, 2026
5 checks passed
rueian pushed a commit to rueian/ray that referenced this pull request Jun 4, 2026
…s training with fewer workers (ray-project#63783)

# Summary

If torchft's min_replicas is less than ScalingConfig's num_workers,
training can continue even if not all workers are present. However,
`ray.train.report` only works if all `ScalingConfig.num_workers` workers
form a barrier by calling `ray.train.report`. If the surviving worker
calls `ray.train.report` after training, it will hang indefinitely - I
need to investigate why the replacement worker fails to join the same
barrier (take a look at these logs:
https://gist.github.com/TimothySeah/1b6af036119b6fa284505ad48df3f4f9),
but since we are optimizing for the "fixed training + ray data happy
path," I think it's fine to punt this for now.

# Testing

Failing unit test now passes.

---------

Signed-off-by: Timothy Seah <[email protected]>
limarkdcunha pushed a commit to limarkdcunha/ray that referenced this pull request Jun 30, 2026
…s training with fewer workers (ray-project#63783)

# Summary

If torchft's min_replicas is less than ScalingConfig's num_workers,
training can continue even if not all workers are present. However,
`ray.train.report` only works if all `ScalingConfig.num_workers` workers
form a barrier by calling `ray.train.report`. If the surviving worker
calls `ray.train.report` after training, it will hang indefinitely - I
need to investigate why the replacement worker fails to join the same
barrier (take a look at these logs:
https://gist.github.com/TimothySeah/1b6af036119b6fa284505ad48df3f4f9),
but since we are optimizing for the "fixed training + ray data happy
path," I think it's fine to punt this for now.

# Testing

Failing unit test now passes.

---------

Signed-off-by: Timothy Seah <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…s training with fewer workers (ray-project#63783)

# Summary

If torchft's min_replicas is less than ScalingConfig's num_workers,
training can continue even if not all workers are present. However,
`ray.train.report` only works if all `ScalingConfig.num_workers` workers
form a barrier by calling `ray.train.report`. If the surviving worker
calls `ray.train.report` after training, it will hang indefinitely - I
need to investigate why the replacement worker fails to join the same
barrier (take a look at these logs:
https://gist.github.com/TimothySeah/1b6af036119b6fa284505ad48df3f4f9),
but since we are optimizing for the "fixed training + ray data happy
path," I think it's fine to punt this for now.

# Testing

Failing unit test now passes.

---------

Signed-off-by: Timothy Seah <[email protected]>
Signed-off-by: 400Ping <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants