ci: run distributed pool tests in a dedicated gloo job - #2011
Open
saud5150 wants to merge 1 commit into
Open
Conversation
Add a distributed-tests job that runs the @pytest.mark.DDP tests with USE_PYTEST_POOL=1 on the shared gloo (CPU) process pool. The flag stays off by default everywhere else, so local runs and the main test matrix are unchanged; only this job activates the pool. Kept in its own Python 3.12 job so a pool issue cannot destabilize the main 3.7/3.12 suite. Verified the spawn/gloo/importlib path runs green on Linux: both BarlowTwins DDP tests pass with the flag on and skip with it off. Part of lightly-ai#1982.
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.
Part of #1982.
Description
The distributed test pool from #1983 is gated behind
USE_PYTEST_POOL, which defaults to off, so its@pytest.mark.DDPtests never run in CI — they only execute when the flag is set manually. This adds a dedicateddistributed-testsjob that runs the DDP tests on the shared gloo (CPU) pool withUSE_PYTEST_POOL=1, so real multi-rank collectives are exercised on every PR instead of relying on mocks (the gap that hid #1977 until #1980).The flag stays off by default everywhere else, so local runs and the main 3.7/3.12 test matrix are unchanged — only this job enables the pool. It's a separate job (not a step in the existing
testjob) so a pool issue can't destabilise the main suite, and it runs on Python 3.12, the version I verified on Linux (below).Tests
Before enabling it, I reproduced the CI runner in Docker (
python:3.12-slim, CPU torch, gloo) to confirm the spawn path runs green on Linux — Linux defaults multiprocessing tofork, but the pool forcesspawn, so it behaves like macOS:The job's collection scope matches the existing
testjob (whole repo,--ignore=./lightly/openapi_generated/), which already proves collection works with the full pinned deps.Documentation
.rstfiles).CI-only change — no public API or docs.
Implications / comments / further issues
A few decisions I'd value your call on:
testjob — I chose a separate job for isolation; a step would be smaller but couples pool flakiness to the main suite.detect-code-changesgate astest), so it needs the same required-but-skippable handling — related to ci: run required checks for merge groups #2007.Unrelated side-finding while testing on torch 2.13:
torch.distributed.nn.functional.all_reduce(used by the #1980 BarlowTwins fix) now emits aFutureWarning(deprecated fortorch.distributed._functional_collectives.all_reduce). Not touched here — flagging as a possible follow-up.