(config)
| 38 | |
| 39 | |
| 40 | def _create_prefix_caching_config(config) -> config_lib.PrefixCachingConfig | None: |
| 41 | if not config.enable_prefix_caching: |
| 42 | return None |
| 43 | |
| 44 | if not config.use_chunked_prefill: |
| 45 | raise ValueError("Prefix caching requires chunked prefill.") |
| 46 | |
| 47 | return config_lib.PrefixCachingConfig( |
| 48 | max_hbm_byte=config.prefix_caching_hbm_byte, |
| 49 | max_dram_byte=config.prefix_caching_dram_byte, |
| 50 | ) |
| 51 | |
| 52 | |
| 53 | def main(config): |