A high-throughput and memory-efficient inference and serving engine for LLMs
fix: AOT compile cache collision for dataclass-based HF configs (#45059)
Signed-off-by: Angela Yi <yiangela7@gmail.com>
Angela Yi committed
Jun 10, 2026 at 08:05 UTC
de900fa7e5e1a28cc1faac94b76981993e648f4f
1 file changed
+12
-12
vllm/config/utils.py
+12
-12
@@ -279,6 +279,18 @@ def normalize_value(x):
279
except Exception:
280
return str(x)
281
282
+ # PretrainedConfig (must be before dataclass branch as these are now dataclasses)
283
+ if hasattr(x, "to_json_string") and callable(x.to_json_string):
284
+ try:
285
+ return x.to_json_string()
286
+ except (TypeError, ValueError):
287
+ # to_json_string() may fail for trust-remote-code configs
288
+ # with non-JSON-serializable nested objects. Fall back to
289
+ # normalizing the dict representation recursively.
290
+ if hasattr(x, "to_dict") and callable(x.to_dict):
291
+ return normalize_value(x.to_dict())
292
+ raise
293
+
294
# Dataclasses: represent as (FQN, sorted(field,value) tuple) for stability.
295
if is_dataclass(x):
296
type_fqn = f"{x.__class__.__module__}.{x.__class__.__qualname__}"
@@ -296,18 +308,6 @@ def normalize_value(x):
308
if isinstance(x, Sequence) and not isinstance(x, (str, bytes, bytearray)):
309
return tuple(normalize_value(v) for v in x)
310
299
- # PretrainedConfig
300
- if hasattr(x, "to_json_string") and callable(x.to_json_string):
301
- try:
302
- return x.to_json_string()
303
- except (TypeError, ValueError):
304
- # to_json_string() may fail for trust-remote-code configs
305
- # with non-JSON-serializable nested objects. Fall back to
306
- # normalizing the dict representation recursively.
307
- if hasattr(x, "to_dict") and callable(x.to_dict):
308
- return normalize_value(x.to_dict())
309
- raise
310
-
311
# Unsupported type: e.g., modules, generators, open files, or objects
312
# without a stable JSON/UUID representation. Hard-error to avoid
313
# under-hashing.