Configuration
HardwareSimulationConfig
Define hardware constraints:Configuration Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| enabled | bool | False | Enable hardware simulation |
| max_memory_mb | float | 512.0 | Maximum memory in megabytes |
| compute_speed_factor | float | 1.0 | Compute speed multiplier (>1 = slower) |
| precision_mode | str | ”float32” | Required precision (float32, float16, int8) |
| batch_size_limit | int | 128 | Maximum batch size allowed |
Memory Estimation
Estimate Memory Requirements
Batch Size Adjustment
Automatic Batch Size Reduction
Adjust batch size to fit memory constraints:Running with Hardware Constraints
Basic Usage
Result Structure
Compute Speed Simulation
Thecompute_speed_factor parameter simulates slower hardware:
Implementation
Precision Constraints
Force specific precision modes:Warning System
The simulation generates warnings for constraint violations:- Batch size reduced due to memory constraints
- Projected memory exceeds limit
- Model cannot run with batch_size=1
Integration with PrecisionConfig
Create hardware simulation config from existing precision config:Logging Results
Save hardware simulation logs:Use Cases
Edge Device Simulation
Simulate deployment on resource-constrained edge devices:Mobile Device Simulation
Simulate mobile deployment:IoT Device Simulation
Simulate IoT devices with severe constraints:Validation
Check if model can run under constraints:Next Steps
Benchmarking
Run performance benchmarks
Statistical Analysis
Analyze results with confidence intervals