Skip to content

research: reduce cold JAX compile time (post-#71 follow-up) #74

Description

@Jammy2211

Overview

Follow-up to #71 (research: settings suffice → cache-by-default shipped in PyAutoConf#128): investigate ways to reduce the cold JAX compile time itself — the once-per-(machine, jax-version, shape) cost the persistent cache cannot remove. Worst measured case: ~7m30 for the GPU pixelized-gradient input_reduce_fusion; ~2 min for CPU MGE gradient fits; plus the uncacheable ~15 s–2 min Python tracing floor every process pays even warm.

Plan

  1. HLO artifact (unblocked by PyAutoConf#128's XLA_FLAGS fix): sync RAL mirrors, re-run the 8-min A100 probe with dump flags, analyze what the 7m30 fusion contains; produce the upstream-XLA-report artifact.
  2. XLA compile-speed knobs on that fusion (A100, fresh cache per config): compilation parallelism, fusion-heuristic flags; honest autotune A/B (the 2026-07-15 one is unproven — flags were clobbered).
  3. Tracing floor (local CPU): profile the uncacheable tracing cost and its scaling with model depth.
  4. Cache-entry proliferation: count distinct entries a realistic SLaM pipeline generates; identify avoidable shape/graph variation (canonicalization candidates).
  5. Pre-warming: shared cluster cache-dir guidance; jax.export/AOT portability (can a warm cache be shipped?).

Deliverable: cold-compile findings + second verdict in jax_compile/README.md (which levers get productized); follow-ups via intake. Out of scope: restructuring likelihoods into piecewise jit stages (ruled out by #71).

Detailed implementation plan

Affected Repositories

Branch Survey

Repository Current Branch Dirty?
./autolens_profiling main (post-#73 merge) clean

Suggested branch: feature/cold-compile-reduction

Key Files / Instruments

  • jax_compile/probe.py (merged) — extend with tracing-profile and flag-sweep modes as needed
  • RAL: pixgrad_logs/compile_ab.sbatch pattern (fresh JAX_COMPILATION_CACHE_DIR per job; matched args or shapes miss)
  • Established (do not re-derive): research: JAX compile time — jit boundaries vs settings #71 findings — XLA compiles on host CPUs (load-sensitive); slow-compile banner re-fires during one compile; cache serves AOT path cross-process

Original Prompt

PyAutoMind draft/research/workspaces/investigate_ways_to_reduce_the_cold_jax.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions