Repository navigation
Give each xdist worker its own mlx compile cache as a stopgap - #90
Merged
Merged
Conversation
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.
This is a temporary stopgap, delete it once CI runs an mlx release that includes ml-explore/mlx#4638.
The linux leg keeps failing on "Could not load C++ shared library /tmp/mlx/0.32.3/cpu/lib...so: file too short", on a different random test each time (6 of the last 8 linux runs, including #85 and #86 three times in a row). mlx 0.32.3 shares its CPU compile cache across processes and treats "the .so exists" as done, so one xdist worker can load a kernel another worker is still linking. mlx#4638 fixes that properly with a temp file plus rename, it's merged but not in a release yet (latest is still 0.32.3).
Until then this adds a small pytest plugin, loaded with
-ponly on the linux xdist step, that points each worker's TMPDIR at its own folder. mlx builds the cache path from TMPDIR on every compile, so no two workers ever share a kernel file. Only the linux test step uses it, the sklearn step and the macOS leg run a single process. The plugin lives in.github/pytest/so the PYTHONPATH entry doesn't also make.github/workflows/configimportable. Two full local runs with it had no flakes and every kernel in a per-worker folder, while runs without it flaked once or twice each.We don't pin mlx to the fixed commit because that means building mlx from source on every run, and the requirement is
mlx[cpu]>=0.32with no upper pin, so CI picks up the fixed release by itself. Removing this plugin and the-pflag is the only follow up.