hardware command provides tools for managing hardware configurations, including listing available devices, auto-selecting optimal hardware, and benchmarking performance.
Usage
Actions
| Action | Description |
|---|---|
list | List all available hardware devices (default) |
info | Show current device information |
auto | Auto-select optimal hardware |
select | Manually select a specific device |
benchmark | Benchmark available devices |
Options
| Option | Type | Default | Description |
|---|---|---|---|
--device | string | None | Device to select (required for select action) |
--precision | string | float32 | Precision (float32, float16, mixed, int8) |
--memory-limit | float | None | Memory limit in GB |
Actions in Detail
list - List Available Devices
Displays all available hardware devices with their specifications.info - Current Device Information
Shows detailed information about the currently selected device.auto - Auto-Select Optimal Device
Automatically selects the best available hardware based on capabilities.select - Manually Select Device
Manually choose a specific device.benchmark - Benchmark Devices
Run performance benchmarks on all available devices.Examples
List available hardware
Auto-select with mixed precision
Select specific GPU
Select CPU with memory limit
Benchmark with specific precision
Precision Modes
float32 (Default)
Standard 32-bit floating point precision:- Highest accuracy
- More memory usage
- Slower computation
float16
Half-precision floating point:- Good accuracy
- Reduced memory usage
- Faster computation on modern GPUs
mixed
Mixed precision training:- Combines float32 and float16
- Best balance of speed and accuracy
- Recommended for modern GPUs
int8
8-bit integer quantization:- Lower accuracy
- Minimal memory usage
- Fastest inference
- Best for deployment
Configuration Updates
When usingauto or select actions, the hardware settings are automatically saved to config.json:
Use Cases
1. Initial setup
Auto-select optimal hardware when starting a new project:2. Multi-GPU selection
Select a specific GPU in multi-GPU systems:3. Performance optimization
Benchmark devices to find the best option:4. Resource-constrained training
Limit memory usage for shared systems:5. CPU fallback
Switch to CPU when GPU is unavailable:Error Handling
No GPU available
Invalid device
Missing required option
Best Practices
1. Use auto-selection for new projects
2. Benchmark before production
Test different configurations to find the optimal setup:3. Monitor device information
Regularly check device utilization:4. Use mixed precision on modern GPUs
For GPUs with Tensor Cores (NVIDIA Volta, Turing, Ampere):5. Document hardware configurations
Keep track of hardware settings in your experiments:See Also
- Run command - Train with selected hardware
- Optimize command - Optimize for specific hardware
- Monitor command - Monitor hardware usage during training