Cap jixia concurrency to avoid OOM in load step#14
Merged
Conversation
The 'Load jixia data into PostgreSQL' step was OOM-killed deterministically ~85 modules in (runner lost, post-steps skipped, no error logged), while processing the most Mathlib-heavy modules. jixia_py defaults to CPUs+4 parallel workers; each loads ~2-3 GB of Mathlib, exceeding the 16 GB runner. Make the worker count configurable via JIXIA_MAX_WORKERS and set it to 2 in the weekly index workflow.
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent CI out-of-memory kills during the “Load jixia data into PostgreSQL” step by making jixia’s parallelism configurable and capping it in the weekly indexing workflow.
Changes:
- Read
JIXIA_MAX_WORKERSindatabase/jixia_db.pyand pass it to the jixia batch runner. - Set
JIXIA_MAX_WORKERS: '2'in the weekly GitHub Actions workflow environment to reduce peak memory usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
database/jixia_db.py |
Adds env-driven worker cap and forwards it into the jixia batch execution call. |
.github/workflows/weekly-index.yml |
Caps jixia worker concurrency in CI to avoid runner OOM during the load step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+182
to
+183
| max_workers_env = os.environ.get("JIXIA_MAX_WORKERS") | ||
| max_workers = int(max_workers_env) if max_workers_env else None |
Comment on lines
186
to
191
| results = project.batch_run_jixia( | ||
| base_dir=d, | ||
| prefixes=prefixes, | ||
| plugins=["module", "declaration", "symbol"], | ||
| max_workers=max_workers, | ||
| ) |
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.
Why
With the toolchain fix (#13), jixia indexes correctly, but the Load jixia data into PostgreSQL step was cancelled twice, deterministically at exactly 85 modules (~12 min in), while processing the most Mathlib-heavy modules (
Relativity/Tensors,PauliMatrices).Signature: runner lost, post-steps skipped, no error logged, 0 jixia subprocess failures. That's a silent OOM kill — jixia_py defaults to
CPUs + 4parallel workers (8 on the runner), each loading ~2-3 GB of Mathlib, blowing past the 16 GB runner.What
JIXIA_MAX_WORKERS.JIXIA_MAX_WORKERS: '2'in the workflow so peak memory stays well under 16 GB.Trade-off: the load step runs longer (fewer parallel workers) but stays within the 6-hour job limit. Local runs are unaffected (defaults to full parallelism when the env var is unset).