Repository navigation
ci: every concurrent process writes its own numba cache - #47
Merged
Merged
Conversation
numba numbers a new on-disk cache entry from the index it last read and saves the index before the data, so two processes that compile one kernel for different signatures at the same time can both take the same data file and leave the index pointing at the other's overload. The pool workers of run_validation.py --jobs shared numba's default cache directory. Each row-group worker is now a one-process spawn pool started while NUMBA_CACHE_DIR names its own directory; the groups go to the workers in turn, slowest first. Each concurrent taxonomy run takes its own directory too, and under xdist tests/conftest.py makes each worker's directory a subdirectory of an explicit NUMBA_CACHE_DIR instead of sharing it. The required aggregate job gets a 10-minute limit. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Owner
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
numba's on-disk cache is not safe for two processes that compile the same kernel for different signatures at the same time.
IndexDataCacheFile.save(numba/core/caching.py) chooses a new entry's data-file number from the index it last read, and saves the index before the data. Two such processes can both take<kernel>.1.nbc, and the index can be left pointing at the other process's overload. A later process that loads that entry gets machine code compiled for another signature.#45 already gives each pytest-xdist worker its own cache. Two gaps remain, and this PR closes them:
run_validation.py --jobs=Nrow-group workersNUMBA_CACHE_DIRnames its own directory; groups go to the workers in turn, slowest firstNUMBA_CACHE_DIRtimeout-minutes: 10The temporary cache directories are removed at the end of the run. Nothing else changes: same tests, same rows, same report, same
--checkcondition.Evidence
_isolated_pool: the worker sees its ownNUMBA_CACHE_DIR, the parent's environment is restored, the worker writes its cache files there, and the_dai2018_rowsgroup computed in the worker equals the serial result exactly._evaluate_rowswith the isolated pools against serial_rows(): all 67 rows identical as exact(tier, ident, quantity, target, value, status)tuples.--check --jobs=automust reproduce the committed report and its taxonomy lines exactly.Not in this PR
sea_state_batchspawn workers withworkers > 1share one cache. It gets its own PR with a cold-cache test._rows()test), so this isolation costs little.