Comprehensive utilities library for JAX testing, debugging, and instrumentation
73
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
Install with Tessl CLI
npx tessl i tessl/pypi-chexevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10