Index of every page on this site: llms.txt
All skills
Run it yourself

Write, debug, review, profile, or shard JAX numerical code. Use when the hard part is JAX tracing, autodiff, control flow, PRNGs, compilation, array placement, or runtime performance. Do not impose JAX on a NumPy-only or unrelated GPU task.

Use this Skill: https://skilld.dev/gh/tristanmanchester/agent-skills/jax-development

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesPERFORMANCE-PLAYBOOK.md

≈823 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Performance playbook

Separate the costs

State the workload and reference implementation, then distinguish host preparation, transfer, trace/lowering/compilation, dispatch, execution, materialisation, and communication. Validate numerical outputs and gradients before optimising. Record backend/devices, versions, shapes, dtypes, precision, sharding, and cache state.

Benchmark independent inputs

The bundled scripts/jax_benchmark_harness.py imports a trusted module exposing a function and a zero-argument input factory. Example target module:

import jax.numpy as jnp

def step(x):
    return x + 1

def make_inputs():
    return (jnp.arange(1024, dtype=jnp.float32),), {}

Use --file PATH --function step --factory make_inputs --jit --repeat 20. The factory must return fresh equivalent buffers for every invocation, including warm-up and first call. This makes explicit --donate-argnums 0 possible without reusing invalidated arrays. Static arguments must remain stable; setup itself must not dominate memory or change the workload. The helper does not detect every aliasing mistake in user factories.

Inputs are synchronised outside timing; results are synchronised inside. Any failure propagates rather than returning a plausible timing. Report median, spread and raw samples, not only the fastest run. First-call time mixes multiple costs and can hit caches. Use lower/compile probes or separate controlled processes when isolated compilation/cold-cache measurements matter. A pre-jitted callable can consume donated inputs even without the harness's --jit option.

A training loop is a different workload: carry the returned state into the next iteration, use fresh batches/keys, and separate warm-up from steady-state throughput. Do not keep resetting it and label the independent-input result training throughput. For eager/JIT comparison, use separate fresh-input runs and compare correctness and workload equivalence; donation invalidates shared comparison inputs too.

Diagnose before rewriting

Repeated compilations: inspect changing shape/dtype/sharding/static values, new closures/jitted functions, large captured constants and Python-loop unrolling. Use the compile probe/recompile explorer as diagnostic aids and confirm with compilation logs/traces; a signature heuristic is not an authoritative compile count.

Slow execution: inspect host conversions, tiny kernel dispatches, callbacks, input starvation, resharding, and redundant computation. Consider larger compiled regions, batching and structured loops only against an actual profile.

Memory pressure: measure live buffers and peaks, examine retained outputs, replication, intermediates and autodiff residuals. Donation and checkpointing have semantics and compute/memory trade-offs; neither is an automatic speed-up. Use jax.checkpoint before experimental alternatives unless evidence favours them.

Synchronise trace windows, capture realistic iterations, and use the target accelerator's profiler. CPU smoke tests cannot establish GPU/TPU throughput or multi-host correctness. A persistent cache helps repeated compilation but must be trusted and its warm/cold status included in measurements.

See source baseline for current APIs and official references.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo4 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides a suite of JAX development tools. It includes functionality for dynamic loading of local modules for benchmarking and a code scanner that processes user files, which introduces a low risk of dynamic execution and indirect prompt injection.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3323bc9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Steadyupdated last month
Other metadata
compatibility
Current-release baseline JAX 0.11.1 requires Python >=3.12; wheel/backend support must be checked separately. Diagnostics need Python 3.12+ and the project's JAX environment for runtime probes. Static helpers can run without JAX. Benchmark/probe commands execute trusted project code.
metadata
{
  "version": "3.0.0",
  "reviewed": "2026-09-13",
  "source": "https://github.com/jax-ml/jax/tree/jax-v0.11.1"
}

README badge

README badge for tristanmanchester/agent-skills/jax-development