A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 6, 13:15 UTC
[Deprecation] Deprecate `--calculate-kv-scales` option (#37201)
Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
Michael Goin committed
Mar 17, 2026 at 20:57 UTC
e78821b4387839bb198ebb35cc175518a6afc115
1 file changed
+14
-1
vllm/config/cache.py
+14
-1
@@ -83,7 +83,8 @@ class CacheConfig:
83
- "xxhash_cbor" combines canonical CBOR serialization with xxHash for
84
reproducible hashing. Requires the optional ``xxhash`` package."""
85
calculate_kv_scales: bool = False
86
- """This enables dynamic calculation of `k_scale` and `v_scale` when
86
+ """Deprecated: This option is deprecated and will be removed in v0.19.
87
+ It enables dynamic calculation of `k_scale` and `v_scale` when
88
kv_cache_dtype is fp8. If `False`, the scales will be loaded from the model
89
checkpoint if available. Otherwise, the scales will default to 1.0."""
90
cpu_kvcache_space_bytes: int | None = None
@@ -205,6 +206,18 @@ class CacheConfig:
206
object.__setattr__(self, "user_specified_block_size", True)
207
return self
208
209
+ @field_validator("calculate_kv_scales", mode="after")
210
+ @classmethod
211
+ def _warn_deprecated_calculate_kv_scales(cls, calculate_kv_scales: bool) -> bool:
212
+ if calculate_kv_scales:
213
+ logger.warning(
214
+ "The `--calculate-kv-scales` option is deprecated and will "
215
+ "be removed in v0.19. The scales will be loaded from the "
216
+ "model checkpoint if available, otherwise they default to "
217
+ "1.0."
218
+ )
219
+ return calculate_kv_scales
220
+
221
@field_validator("cache_dtype", mode="after")
222
@classmethod
223
def _validate_cache_dtype(cls, cache_dtype: CacheDType) -> CacheDType: