Add tqdm progress bars to JAX scans and loops using decorators, enabling side-effect-free progress tracking.
JAX-Tqdm is a Python library that adds tqdm progress bars to JAX scans and loops. It enables developers to monitor the progress of long-running JAX computations without violating JAX's pure functional constraints by using debug callbacks to update progress bars from the host.
JAX developers and researchers running iterative computations like training loops, simulations, or optimizations who need visual progress tracking without sacrificing performance.
It provides a simple, decorator-based API that integrates seamlessly with JAX's functional loops, offers performance-optimized updates, and maintains compatibility with JAX's parallelization features like vmap.
Add a tqdm progress bar to your JAX scans and loops.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds progress bars with minimal code changes using @scan_tqdm or @loop_tqdm decorators, as shown in the README examples for scan and fori_loop integration.
Compatible with vmap for parallelized loops, displaying stacked progress bars via the PBar wrapper, demonstrated in the 'Scans & Loops Inside Vmap' section.
Minimizes overhead by defaulting to 20 updates per loop (configurable with print_rate), ensuring progress tracking doesn't significantly impact computation speed.
Allows passing additional tqdm keyword arguments (e.g., desc, position) for appearance and behavior customization, as highlighted in the 'Progress Bar Options' section.
Only works with lax.scan and lax.fori_loop, not other JAX operations like while_loop or custom loops, which restricts its utility in broader JAX workflows.
Requires loops to start at 0, as noted in the examples, which can be restrictive if computations don't align with this indexing scheme.
Relies on JAX's debug callbacks for side effects, which may fail in environments where these features are disabled or in older JAX versions.