Create an empty stats tracker dictionary for quantization metrics.
()
| 497 | |
| 498 | |
| 499 | def create_quantization_stats(): |
| 500 | """Create an empty stats tracker dictionary for quantization metrics.""" |
| 501 | return { |
| 502 | 'total_tensors': 0, |
| 503 | 'int8_tensors': 0, |
| 504 | 'int4_tensors': 0, |
| 505 | 'fp16_tensors': 0, |
| 506 | 'total_parameters': 0, |
| 507 | 'quantized_parameters': 0, |
| 508 | 'mse_values': [], |
| 509 | 'snr_values': [], |
| 510 | 'cos_sim_values': [], |
| 511 | 'saturation_warnings': 0 |
| 512 | } |
| 513 | |
| 514 | |
| 515 | def print_quantization_summary(quantization_stats, args=None): |
no outgoing calls
no test coverage detected