jax-config

Configure JAX/Equinox dataclass configs as pytrees for JIT tracing.

3|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/peabody124/reproducible_agent_environment --skill jax-config
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jax-config
Source: https://github.com/peabody124/reproducible_agent_environment/tree/main/skills/jax-config
Command: npx skills add https://github.com/peabody124/reproducible_agent_environment --skill jax-config

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Configure JAX/Equinox-compatible dataclass configs that cleanly separate static vs dynamic fields for reliable JIT behavior and seamless Tyro CLI integration.

Core Features & Use Cases

  • Pytree-registered configs for stable JAX tracing and tunable hyperparameters without recompilation.
  • Tyro CLI integration for nested configs, default factories, and clean command-line options.
  • Guidance on wrapping dynamic floats as JAX arrays and combining with Equinox modules in large ML pipelines.

Quick Start

Create a dataclass for your configuration, register it as a JAX pytree at module scope, and expose a tyro.cli entry point. Use field(default_factory=...) for nested configs and wrap dynamic fields to enable tracing without recompilation.

Frequently Asked Questions about jax-config

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

FAQPage Schema
How do I pass a dataclass config into a jitted JAX function without triggering recompilation?

To avoid recompilation when passing dataclass configs into jitted JAX functions, register the dataclass as a JAX pytree and wrap dynamic float fields as 0-d arrays. This separates static fields for tracing from dynamic fields for tunable hyperparameters.

What's the best way to integrate nested dataclass configs with Tyro CLI in a JAX training loop?

Integrating nested dataclass configs with Tyro CLI requires using field(default_factory=...) for nested structures and exposing a tyro.cli entry point. This setup provides clean command-line options for your JAX training loop while maintaining pytree registration.

Why does JAX recompile my Equinox model when I change a hyperparameter in my config dataclass?

JAX recompiles your model because unregistered dataclass fields are treated as static, invalidating the trace. Registering the config as a pytree and wrapping dynamic floats as JAX arrays allows hyperparameter changes without triggering recompilation.

Does Equinox work with pytree-registered dataclass configs for large ML pipelines?

Yes, Equinox works seamlessly with pytree-registered dataclass configs. You can combine these registered configs directly with Equinox modules in large ML pipelines to maintain stable JAX tracing across complex model architectures.

When do I need to register a dataclass as a JAX pytree?

You need to register a dataclass as a JAX pytree when building models or training loops that pass configuration dataclasses into jitted functions. This registration enables deterministic behavior and ensures dynamic fields can be traced correctly without recompilation.