Skip to content

Commit 88682aa

Browse files
khluuIsotr0py
authored andcommitted
[ci/lint] Add back default arg for pre-commit (vllm-project#12279)
Signed-off-by: kevin <kevin@anyscale.com> Signed-off-by: Isotr0py <2037008807@qq.com>
1 parent dbc0538 commit 88682aa

File tree

6 files changed

+26
-29
lines changed

6 files changed

+26
-29
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

tests/models/decoder_only/language/test_gguf.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ def gguf_model(self):
7474
)
7575

7676
MODELS = [
77-
LLAMA_CONFIG,
78-
QWEN2_CONFIG,
79-
PHI3_CONFIG,
80-
GPT2_CONFIG,
81-
STABLELM_CONFIG,
77+
LLAMA_CONFIG, QWEN2_CONFIG, PHI3_CONFIG, GPT2_CONFIG, STABLELM_CONFIG,
8278
DOLPHIN_CONFIG
8379
# STARCODER_CONFIG, # broken
8480
]
@@ -114,11 +110,12 @@ def test_models(
114110
messages, tokenize=False, add_generation_prompt=True)
115111

116112
# Run unquantized model.
117-
with vllm_runner(model_name=model.original_model,
118-
enforce_eager=True, # faster tests
119-
dtype=dtype,
120-
max_model_len=MAX_MODEL_LEN,
121-
tensor_parallel_size=tp_size) as original_model:
113+
with vllm_runner(
114+
model_name=model.original_model,
115+
enforce_eager=True, # faster tests
116+
dtype=dtype,
117+
max_model_len=MAX_MODEL_LEN,
118+
tensor_parallel_size=tp_size) as original_model:
122119
original_outputs = original_model.generate_greedy_logprobs(
123120
example_prompts[:-1], max_tokens, num_logprobs)
124121

vllm/model_executor/models/paligemma.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class PaliGemmaForConditionalGeneration(nn.Module, SupportsMultiModal,
147147
"up_proj",
148148
],
149149
}
150-
150+
151151
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
152152
super().__init__()
153153
config = vllm_config.model_config.hf_config

vllm/model_executor/models/siglip.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,10 @@ def __init__(
348348
if quant_config and quant_config.get_name() == "bitsandbytes":
349349
quantizable = True
350350
else:
351-
# For other quantization, we require the hidden size to be a
351+
# For other quantization, we require the hidden size to be a
352352
# multiple of 64
353-
quantizable = (
354-
config.hidden_size % 64 == 0
355-
and config.intermediate_size % 64 == 0
356-
)
353+
quantizable = (config.hidden_size % 64 == 0
354+
and config.intermediate_size % 64 == 0)
357355
self.fc1 = ColumnParallelLinear(
358356
config.hidden_size,
359357
config.intermediate_size,

vllm/platforms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def cpu_platform_plugin() -> Optional[str]:
101101
try:
102102
from importlib.metadata import version
103103
is_cpu = "cpu" in version("vllm")
104-
if is_cpu == False:
104+
if not is_cpu:
105105
import platform
106106
is_cpu = platform.machine().lower().startswith("arm")
107107

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)