Version 0.2.10
This release introduces a comprehensive NaN debugging system for gradient computations, refactors the module mapping API for improved clarity, and adds graph context utilities for advanced state management.
New Features
NaN Debugging System
-
JIT-Compatible NaN/Inf Debugging: New debugging utilities for identifying NaN and Inf values during gradient computations
debug_nan: Analyze a function for NaN/Inf values with detailed reportingdebug_nan_if: Conditional NaN debugging with predicate-based activation- Full JIT compatibility for seamless integration into compiled workflows
- Support for debugging NaN in
whileandscanprimitives - Detailed analysis output including variable names, shapes, and affected indices
-
Gradient Function Integration: Added
debug_nanparameter to gradient transformation functionsgrad: Enable NaN debugging during gradient computationvector_grad: NaN debugging for vectorized gradientsjacobianandjacobian_reverse: NaN debugging for Jacobian computationshessian: NaN debugging for Hessian computations
-
Breakpoint Utility: New
breakpointfunction for conditional debugging- Wraps
jax.debug.breakpointwith predicate support - Only triggers when the specified condition is True
- Wraps
API Changes
Module System
-
Renamed
ModuleMappertoMap: Simplified naming for the vectorized module wrapperMapprovides vectorized (vmap2) and parallel (pmap2) mapping over modulesModuleMapperretained as a deprecated alias for backward compatibility- Internal
_ModuleMapperCallingrenamed to_MapCallerfor consistency
-
Enhanced
Map.map()Method: Now accepts callable functions for flexible mapping operations
Bug Fixes
- Fixed
get_backendimport for JAX version compatibility across different JAX releases - Removed
abstractmethoddecorators fromRegularizationclass to allow proper instantiation - Cleaned up unused imports in module initialization files
Internal Changes
- Added comprehensive test suite for NaN debugging (
_debug_test.py, 938 lines) - Removed deprecated
_mapping3.pymodule and associated tests - Streamlined module exports in
__init__.pyfiles