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 15, 07:15 UTC
Handle non-serializable objects when dumping benchmark results (#19114)
Huy Do committed
Jun 4, 2025 at 22:40 UTC
0678b52251edd75405a1db81132c2d63d86b16b6
2 files changed
+8
-1
.pre-commit-config.yaml
+2
@@ -11,6 +11,8 @@ repos:
11
hooks:
12
- id: yapf
13
args: [--in-place, --verbose]
14
+ # Keep the same list from yapfignore here to avoid yapf failing without any inputs
15
+ exclude: '(.buildkite|benchmarks|build|examples)/.*'
16
- repo: https://github.com/astral-sh/ruff-pre-commit
17
rev: v0.11.7
18
hooks:
benchmarks/benchmark_utils.py
+6
-1
@@ -66,4 +66,9 @@ class InfEncoder(json.JSONEncoder):
66
67
def write_to_json(filename: str, records: list) -> None:
68
with open(filename, "w") as f:
69
- json.dump(records, f, cls=InfEncoder)
69
+ json.dump(
70
+ records,
71
+ f,
72
+ cls=InfEncoder,
73
+ default=lambda o: f"<{type(o).__name__} object is not JSON serializable>",
74
+ )