python-jax

Provide expert guidance for JAX numerical computing with grad, jit, vmap, and pmap.

34|7|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/jkitchin/skillz --skill python-jax
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-jax
Source: https://github.com/jkitchin/skillz/tree/main/skills/programming/python-jax
Command: npx skills add https://github.com/jkitchin/skillz --skill python-jax

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert guidance for JAX, enabling accelerator-focused array computation and program transformations such as automatic differentiation, JIT compilation, vectorization, and parallelization.

Core Features & Use Cases

  • Transformations: automatic differentiation with jax.grad, JIT compilation with jax.jit, automatic vectorization with jax.vmap, and parallelization with jax.pmap.
  • Differentiation & Transformations: support for higher-order derivatives and nested pytrees.
  • Performance & Hardware: seamless GPU/TPU acceleration with minimal code changes.
  • Use cases include custom gradient-based optimization, high-performance numerical kernels, and scalable ML research workflows.

Quick Start

Create a small function, differentiate it with jax.grad, and run the gradient on a sample vector to observe automatic differentiation in action.

Frequently Asked Questions about python-jax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute gradients automatically with JAX?

JAX's `jax.grad` function computes automatic differentiation by transforming your code to generate gradient functions. Pass a function to `jax.grad` and it returns a new function that computes gradients with respect to the first argument, enabling gradient-based optimization and machine-learning workflows.

What's the best way to speed up NumPy-like code on GPU?

JAX provides GPU/TPU acceleration with minimal code changes through `jax.jit` for JIT compilation and seamless hardware offloading. Compile numerical kernels once and run them on accelerators automatically, achieving high-performance computation without rewriting your NumPy-compatible array operations.

Can I vectorize operations across multiple dimensions without loops?

JAX's `jax.vmap` applies automatic vectorization to transform scalar functions into batched operations, eliminating explicit loops. Use `vmap` to automatically batch across any dimension and combine it with `jit` for compiled, vectorized performance on GPU/TPU.

How do I parallelize computation across multiple GPUs or TPUs?

JAX's `jax.pmap` enables data parallelism across multiple devices by distributing array slices to each device and collecting results. Combine `pmap` with `vmap` and `grad` for scalable distributed machine-learning pipelines with multi-device parallelism.

Does JAX support higher-order derivatives and nested transformations?

JAX supports composing transformations: nest `grad` calls for higher-order derivatives, combine `grad` with `vmap` and `jit` for batched gradients, and use nested pytrees to handle complex data structures. This enables building sophisticated gradient-based algorithms and research workflows.

What's the learning curve for switching from NumPy to JAX?

JAX uses a NumPy-like API with immutable arrays and explicit random-key management as key differences. Functional programming with `jax.grad`, `jax.jit`, and `jax.vmap` adds concepts, but NumPy familiarity transfers directly—start with a simple function and apply transformations incrementally.