Skip to content

Commit c1cc0ef

Browse files
committed
chore: ignore SIM rules
Signed-off-by: Aaron Pham <[email protected]>
1 parent 2dadfea commit c1cc0ef

File tree

8 files changed

+18
-20
lines changed

8 files changed

+18
-20
lines changed

format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ echo 'vLLM codespell: Done'
159159

160160
# Lint specified files
161161
lint() {
162-
ruff "$@"
162+
ruff check "$@"
163163
}
164164

165165
# Lint files that differ from main branch. Ignores dirs that are not slated
@@ -175,7 +175,7 @@ lint_changed() {
175175

176176
if ! git diff --diff-filter=ACM --quiet --exit-code "$MERGEBASE" -- '*.py' '*.pyi' &>/dev/null; then
177177
git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.py' '*.pyi' | xargs \
178-
ruff
178+
ruff check
179179
fi
180180

181181
}

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ requires = [
1212
build-backend = "setuptools.build_meta"
1313

1414
[tool.ruff]
15-
# Allow lines to be as long as 80.
16-
line-length = 80
15+
# Allow lines to be as long as 119
16+
line-length = 119
1717
exclude = [
1818
# External file, leaving license intact
1919
"examples/fp8/quantizer/quantize.py"
@@ -26,11 +26,9 @@ select = [
2626
# Pyflakes
2727
"F",
2828
# pyupgrade
29-
"UP",
29+
# "UP",
3030
# flake8-bugbear
3131
"B",
32-
# flake8-simplify
33-
"SIM",
3432
# isort
3533
# "I",
3634
"G",

tests/multimodal/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def assert_nested_tensors_equal(expected: NestedTensors,
77
actual: NestedTensors):
8-
assert type(expected) == type(actual)
8+
assert isinstance(expected, actual)
99
if isinstance(expected, torch.Tensor):
1010
assert torch.equal(expected, actual)
1111
else:

tests/test_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_an_error_is_raised_when_custom_logging_config_file_does_not_exist():
111111
configuration occurs."""
112112
with pytest.raises(RuntimeError) as ex_info:
113113
_configure_vllm_root_logger()
114-
assert ex_info.type == RuntimeError
114+
assert isinstance(ex_info.type, RuntimeError)
115115
assert "File does not exist" in str(ex_info)
116116

117117

@@ -152,7 +152,7 @@ def test_an_error_is_raised_when_custom_logging_config_is_unexpected_json(
152152
logging_config_file.name):
153153
with pytest.raises(ValueError) as ex_info:
154154
_configure_vllm_root_logger()
155-
assert ex_info.type == ValueError
155+
assert isinstance(ex_info.type, ValueError)
156156
assert "Invalid logging config. Expected Dict, got" in str(ex_info)
157157

158158

vllm/attention/ops/triton_flash_attention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _attn_fwd_inner(
126126
# We start from end of seqlen_k so only the first iteration would need
127127
# to be checked for padding if it is not a multiple of block_n
128128
# TODO: This can be optimized to only be true for the padded block.
129-
if MASK_STEPS: # noqa: SIM102
129+
if MASK_STEPS:
130130
# If this is the last block / iteration, we want to
131131
# mask if the sequence length is not a multiple of block size
132132
# a solution is to always do BLOCK_M // BLOCK_N + 1 steps
@@ -621,7 +621,7 @@ def attn_fwd(
621621
start_m_idx = start_m * BLOCK_M
622622
causal_start_idx = seqlen_q - seqlen_k
623623
acc = acc.to(Out.type.element_ty)
624-
if IS_CAUSAL: # noqa: SIM102
624+
if IS_CAUSAL:
625625
if causal_start_idx > start_m_idx and causal_start_idx < end_m_idx:
626626
out_mask_boundary = tl.full((BLOCK_DMODEL, ),
627627
causal_start_idx,

vllm/engine/async_llm_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ async def generate(
806806
request_id: The unique id of the request.
807807
lora_request: LoRA request to use for generation, if any.
808808
trace_headers: OpenTelemetry trace headers.
809-
prompt_adapter_request: Prompt Adapter request to use
809+
prompt_adapter_request: Prompt Adapter request to use
810810
for generation, if any.
811811
812812
Yields:
@@ -1022,15 +1022,15 @@ def remove_logger(self, logger_name: str) -> None:
10221022
async def start_profile(self) -> None:
10231023
# using type instead of isinstance to check to avoid capturing
10241024
# inherited classes
1025-
if type(self.engine.model_executor) == GPUExecutorAsync:
1025+
if isinstance(self.engine.model_executor, GPUExecutorAsync):
10261026
self.engine.model_executor.start_profile()
10271027
else:
10281028
self.engine.model_executor._run_workers("start_profile")
10291029

10301030
async def stop_profile(self) -> None:
10311031
# using type instead of isinstance to check to avoid capturing
10321032
# inherited classes
1033-
if type(self.engine.model_executor) == GPUExecutorAsync:
1033+
if isinstance(self.engine.model_executor, GPUExecutorAsync):
10341034
self.engine.model_executor.stop_profile()
10351035
else:
10361036
self.engine.model_executor._run_workers("stop_profile")

vllm/engine/llm_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class LLMEngine:
144144
decoding.
145145
executor_class: The model executor class for managing distributed
146146
execution.
147-
prompt_adapter_config (Optional): The configuration related to serving
147+
prompt_adapter_config (Optional): The configuration related to serving
148148
prompt adapters.
149149
log_stats: Whether to log statistics.
150150
usage_context: Specified entry point, used for usage info collection.
@@ -1600,15 +1600,15 @@ def check_health(self) -> None:
16001600
def start_profile(self) -> None:
16011601
# using type instead of isinstance to check to avoid capturing
16021602
# inherited classes (MultiprocessingGPUExecutor)
1603-
if type(self.model_executor) == GPUExecutor:
1603+
if isinstance(self.model_executor, GPUExecutor):
16041604
self.model_executor.start_profile()
16051605
else:
16061606
self.model_executor._run_workers("start_profile")
16071607

16081608
def stop_profile(self) -> None:
16091609
# using type instead of isinstance to check to avoid capturing
16101610
# inherited classes (MultiprocessingGPUExecutor)
1611-
if type(self.model_executor) == GPUExecutor:
1611+
if isinstance(self.model_executor, GPUExecutor):
16121612
self.model_executor.stop_profile()
16131613
else:
16141614
self.model_executor._run_workers("stop_profile")

vllm/model_executor/guided_decoding/outlines_logits_processors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def __call__(self, input_ids: List[int],
6767
instruction = self._guide.get_next_instruction(
6868
state=self._fsm_state[seq_id])
6969

70-
if type(instruction) == Generate:
70+
if isinstance(instruction, Generate):
7171
allowed_tokens = instruction.tokens
72-
elif type(instruction) == Write:
72+
elif isinstance(instruction, Write):
7373
# TODO: support fast forward tokens
7474
allowed_tokens = [instruction.tokens[0]]
7575
else:

0 commit comments

Comments
 (0)