Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

fix(compile): pre-create the XLA cache dirs group-writable — first-creator ownership locked other users out#974

Open
claude-spd1 wants to merge 1 commit into
feature/jaxfrom
bridge/task-xla-autotune-cache-group-unwritable
Open

fix(compile): pre-create the XLA cache dirs group-writable — first-creator ownership locked other users out#974
claude-spd1 wants to merge 1 commit into
feature/jaxfrom
bridge/task-xla-autotune-cache-group-unwritable

Conversation

@claude-spd1

Copy link
Copy Markdown
Collaborator

Description

The shared $PARAM_DECOMP_OUT_DIR/xla_compilation_cache is multi-user, but jax >= 0.10 auto-enables the XLA per-fusion autotune side cache under it, and XLA creates xla_gpu_per_fusion_autotune_cache_dir/ and its tmp/ itself with hardcoded 0755 (umask-independent — that's why the files inside were 664 but the dirs weren't group-writable). Whichever user's run touched the cache first locked every other user out: their runs died with PERMISSION_DENIED writing tmp_per_fusion_cache_*.textproto at the first train step.

New param_decomp/compile_cache.py::ensure_group_writable_cache_dirs pre-creates the cache tree group-writable before jax initializes the cache; both jax entrypoints call it (LM trainer on rank 0, pretrainer in _maybe_enable_compilation_cache). Dirs that already have group write are untouched; a broken dir owned by someone else now fails fast at startup instead of one ~25-min compile later.

Note for #: bridge/task-jax-worker-persistent-cache introduces a param_decomp/compile_cache.py of its own (the one-policy-definition refactor). Same module name is deliberate — on merge, combine both functions in that module and call ensure_group_writable_cache_dirs from its enable_persistent_compilation_cache.

Related Issue

Bridge task xla-autotune-cache-group-unwritable (run p-9e6a4af3 / job 1052115 was the observed casualty). The live shared dir was already healed by hand (swapped for a 2775 copy, 670 autotune entries preserved); this PR is the structural fix so first-creation never matters again.

Motivation and Context

Any non-first user's pd-lm run was dead on arrival at the first train step.

How Has This Been Tested?

  • New param_decomp/tests/test_compile_cache.py: creates the tree group-writable, repairs a 0755 tree, leaves already-writable dirs untouched (3 passed).
  • make check clean (ruff + basedpyright).
  • Imported both entrypoints and ran the helper against the real healed production cache dir — verified it's a byte-for-byte no-op there.

Does this PR introduce a breaking change?

No.

🤖 Generated with Claude Code

Crew-Address: task/xla-autotune-cache-group-unwritable

…eator ownership locked other users out

jax >= 0.10 auto-enables the XLA per-fusion autotune side cache under the
shared xla_compilation_cache dir, and XLA creates that subdir and its tmp/
itself with hardcoded 0755 (umask-independent). Whichever user's run touched
the cache first left every other user's run dying with PERMISSION_DENIED at
the first train step (observed: run p-9e6a4af3 / job 1052115). Both jax
entrypoints (LM trainer rank 0, pretrainer) now pre-create the cache tree
group-writable via param_decomp/compile_cache.py before jax initializes the
cache, so it no longer matters who runs first.

Crew-Address: task/xla-autotune-cache-group-unwritable
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant