[Chore] Use upstream Transformers DeepseekV4Config (#61392)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Kevin H. Luu <khluu000@gmail.com>
This commit is contained in:
Harry Mellor
2026-10-15 01:08:08 -07:00
committed by GitHub
co-authored by Claude Opus 5.5 mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Kevin H. Luu
parent 1c4c319792
commit b965ee564d
31 changed files with 155 additions and 120 deletions
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from typing import Any
def get_compress_ratios(config: Any) -> list[int]:
"""Per-layer compress ratios (0 = sliding window), MTP layers included.
Reads the legacy `compress_ratios` of DeepSeek-V4.1 configs, or derives it
from `layer_types` of the upstream `DeepseekV4Config`, which drops the MTP
layers. Returns an empty list for other configs.
"""
if (compress_ratios := getattr(config, "compress_ratios", None)) is not None:
return compress_ratios
if (compress_rates := getattr(config, "compress_rates", None)) is None:
return []
ratios = [compress_rates.get(t, 0) for t in config.layer_types]
return ratios + [0] * config.num_nextn_predict_layers