Report usage statistics if enabled.
(fd_config: FDConfig)
| 362 | |
| 363 | |
| 364 | def report_usage_stats(fd_config: FDConfig) -> None: |
| 365 | """Report usage statistics if enabled.""" |
| 366 | if not is_usage_stats_enabled(): |
| 367 | return |
| 368 | quant_val = fd_config.model_config.quantization |
| 369 | if quant_val is None: |
| 370 | quantization_str = None |
| 371 | elif isinstance(quant_val, dict): |
| 372 | quantization_str = quant_val.get("quantization") |
| 373 | elif isinstance(quant_val, str): |
| 374 | quantization_str = quant_val |
| 375 | else: |
| 376 | quantization_str = str(quant_val) |
| 377 | usage_message = UsageMessage() |
| 378 | usage_message.report_usage( |
| 379 | fd_config, |
| 380 | extra_kvs={ |
| 381 | "num_layers": fd_config.model_config.num_hidden_layers, |
| 382 | "quantization": quantization_str, |
| 383 | "block_size": fd_config.cache_config.block_size, |
| 384 | "gpu_memory_utilization": fd_config.cache_config.gpu_memory_utilization, |
| 385 | "enable_prefix_caching": fd_config.cache_config.enable_prefix_caching, |
| 386 | "disable_custom_all_reduce": fd_config.parallel_config.disable_custom_all_reduce, |
| 387 | "tensor_parallel_size": fd_config.parallel_config.tensor_parallel_size, |
| 388 | "data_parallel_size": fd_config.parallel_config.data_parallel_size, |
| 389 | "enable_expert_parallel": fd_config.parallel_config.enable_expert_parallel, |
| 390 | }, |
| 391 | ) |