tessl install tessl/pypi-chex@0.1.0Comprehensive utilities library for JAX testing, debugging, and instrumentation
Agent Success
Agent success rate when using this tile
73%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.92x
Baseline
Agent success rate without this tile
38%
A utility for validating hardware requirements before running JAX computations. The validator should check device availability and ensure the runtime environment meets specified hardware requirements.
check_gpu_available() is called and a GPU is available, it returns True without raising errors @testcheck_gpu_available() is called and no GPU is available, it raises an AssertionError with an informative message @testcheck_tpu_available() is called and a TPU is available, it returns True without raising errors @testcheck_tpu_available() is called and no TPU is available, it raises an AssertionError with an informative message @testvalidate_devices(['gpu', 'cpu']) is called and all specified devices are available, it returns True @testvalidate_devices(['gpu', 'tpu']) is called and some devices are unavailable, it raises an AssertionError indicating which devices are missing @test@generates
def check_gpu_available() -> bool:
"""
Check if GPU hardware is available in the current environment.
Returns:
bool: True if GPU is available
Raises:
AssertionError: If no GPU is available
"""
def check_tpu_available() -> bool:
"""
Check if TPU hardware is available in the current environment.
Returns:
bool: True if TPU is available
Raises:
AssertionError: If no TPU is available
"""
def validate_devices(device_list: list) -> bool:
"""
Validate that all specified devices are available.
Parameters:
device_list: List of device type strings (e.g., ['gpu', 'cpu', 'tpu'])
Returns:
bool: True if all devices are available
Raises:
AssertionError: If any specified device is unavailable
"""Provides hardware assertion utilities for JAX.
@satisfied-by