Skip to content

Commit 6bcfac0

Browse files
khluutjtanaa
authored andcommitted
[ci/lint] Add back default arg for pre-commit (vllm-project#12279)
Signed-off-by: kevin <[email protected]>
1 parent 4f2fc00 commit 6bcfac0

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- run: echo "::add-matcher::.github/workflows/matchers/actionlint.json"
1717
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
1818
with:
19-
extra_args: --hook-stage manual
19+
extra_args: --all-files --hook-stage manual

vllm/v1/stats/common.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
from vllm.sampling_params import SamplingParams
1111

1212

13-
class RequestStatsUpdate(msgspec.Struct,
14-
array_like=True,
15-
omit_defaults=True,
16-
gc=False):
13+
class RequestStatsUpdate(
14+
msgspec.Struct, # type: ignore
15+
array_like=True,
16+
omit_defaults=True,
17+
gc=False):
1718
"""
1819
An update to the request stats.
1920
@@ -341,16 +342,16 @@ def update_from(self, update: "RequestStatsUpdate"):
341342
self.queued_ts_s = ts
342343
elif update.type == RequestStatsUpdate.Type.PREFILLING:
343344
self.prefill_start_ts_s_lst.append(ts)
344-
self.num_cached_tokens = update.num_cached_tokens
345-
self.num_computed_tokens = update.num_computed_tokens
345+
self.num_cached_tokens = update.num_cached_tokens or 0
346+
self.num_computed_tokens = update.num_computed_tokens or 0
346347
elif update.type == RequestStatsUpdate.Type.PREEMPTED:
347348
self._reset_for_preemption(ts)
348349
elif update.type == RequestStatsUpdate.Type.DECODING:
349350
self.decoding_ts_s_lst.append(ts)
350351
elif update.type == RequestStatsUpdate.Type.DETOKENIZED:
351352
self._record_detokenized_output(
352353
ts,
353-
update.num_new_tokens,
354+
update.num_new_tokens or 0,
354355
)
355356
elif update.type == RequestStatsUpdate.Type.FINISHED:
356357
self.finished_ts_s = ts
@@ -425,10 +426,11 @@ class EngineCoreProcessStats:
425426
output_queue_size: Optional[int] = None
426427

427428

428-
class EngineCoreStatsSnapshot(msgspec.Struct,
429-
array_like=True,
430-
omit_defaults=True,
431-
gc=False):
429+
class EngineCoreStatsSnapshot(
430+
msgspec.Struct, # type: ignore
431+
array_like=True,
432+
omit_defaults=True,
433+
gc=False):
432434
"""
433435
A snapshot of the EngineCore's current stats over a period of time.
434436
"""

0 commit comments

Comments
 (0)