Repository navigation
test_sbc_smoke: sample the tiny fits in-process so 3.14's forkserver default cannot time the fixture out - #612
Merged
Merged
Conversation
… 3.14's forkserver On Python 3.14 the Linux default multiprocessing start method changed from fork to forkserver. The SBC smoke fixture called pm.sample 21 times with cores=2, so every call started two forkserver workers that re-import pymc/exozippy and rebuild the compiled model: ~45 s per call against ~2-4 s with fork (measured on CPython 3.12 with mp_ctx forced, same model). The fixture ran 226-606 s on the ubuntu 3.14 legs against 112-387 s on 3.12 over the last ~30 master runs and kept hitting the 600 s pytest-timeout. The PK model samples 2 x 600 iterations in a second or two, so worker processes only ever cost time here. With cores=1 the fixture is 123 s locally (3.12) and no longer depends on the start-method default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWjnwpYHm56hSpKBzbPhrG
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.
Problem
On the ubuntu Python 3.14 legs, all three tests in
tests/test_sbc_smoke.pykeep erroring at setup withFailed: Timeout (>600.0s) from pytest-timeout. Master runs 43909944076, 44372891494 and PR #611's run 44382820961 all show it, and so do several nightly runs on the unchanged e89acda (11-11, 11-13, 11-14). The failure follows whichever shard holds the file.Root cause
Python 3.14 changed the default
multiprocessingstart method on Linux fromforktoforkserver. The module fixture callspm.sample21 times withcores=2: one prior run plus 20 replicates. pymc passesmp_ctx=None, so each call starts two worker processes with the platform default. A forkserver worker re-imports pymc/exozippy and rebuilds the compiled model on every call.Evidence:
--durationstranscripts of the last ~30 master runs:mp_ctxforced:fork: 2-4 s perpm.samplecallforkserver: 44-49 s per call (5 replicates: 81 s vs 239 s)Fix
Set
cores=1in the fixture so the two chains run sequentially in the test process. This model samples 2 x 600 iterations in a second or two, so worker processes only ever cost time here. The fixture now runs 123 s locally (3.12, all 21 calls "Sequential sampling"; all three tests pass), and its cost no longer depends on the start-method default.examples/validation/sbc.pyitself is unchanged. The full cluster runs choose their own--cores.🤖 Generated with Claude Code
https://claude.ai/code/session_01AWjnwpYHm56hSpKBzbPhrG