Skip to content

Commit 01bfb22

Browse files
authored
[CI] Try introducing isort. (vllm-project#3495)
1 parent e67c295 commit 01bfb22

File tree

144 files changed

+506
-459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+506
-459
lines changed

.github/workflows/ruff.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install ruff==0.1.5 codespell==2.2.6 tomli==2.0.1
28+
pip install ruff==0.1.5 codespell==2.2.6 tomli==2.0.1 isort==5.13.2
2929
- name: Analysing the code with ruff
3030
run: |
3131
ruff .
3232
- name: Spelling check with codespell
3333
run: |
34-
codespell --toml pyproject.toml
34+
codespell --toml pyproject.toml
35+
- name: Run isort
36+
run: |
37+
isort . --check-only

benchmarks/benchmark_prefix_caching.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import argparse
22
import time
33

4-
from vllm import LLM
5-
from vllm import SamplingParams
4+
from vllm import LLM, SamplingParams
65

76
PROMPT = "You are a helpful assistant in recognizes the content of tables in markdown format. Here is a table as fellows. You need to answer my question about the table.\n# Table\n|Opening|Opening|Sl. No.|Film|Cast|Director|Music Director|Notes|\n|----|----|----|----|----|----|----|----|\n|J A N|9|1|Agni Pushpam|Jayabharathi, Kamalahasan|Jeassy|M. K. Arjunan||\n|J A N|16|2|Priyamvada|Mohan Sharma, Lakshmi, KPAC Lalitha|K. S. Sethumadhavan|V. Dakshinamoorthy||\n|J A N|23|3|Yakshagaanam|Madhu, Sheela|Sheela|M. S. Viswanathan||\n|J A N|30|4|Paalkkadal|Sheela, Sharada|T. K. Prasad|A. T. Ummer||\n|F E B|5|5|Amma|Madhu, Srividya|M. Krishnan Nair|M. K. Arjunan||\n|F E B|13|6|Appooppan|Thikkurissi Sukumaran Nair, Kamal Haasan|P. Bhaskaran|M. S. Baburaj||\n|F E B|20|7|Srishti|Chowalloor Krishnankutty, Ravi Alummoodu|K. T. Muhammad|M. S. Baburaj||\n|F E B|20|8|Vanadevatha|Prem Nazir, Madhubala|Yusufali Kechery|G. Devarajan||\n|F E B|27|9|Samasya|Madhu, Kamalahaasan|K. Thankappan|Shyam||\n|F E B|27|10|Yudhabhoomi|K. P. Ummer, Vidhubala|Crossbelt Mani|R. K. Shekhar||\n|M A R|5|11|Seemantha Puthran|Prem Nazir, Jayabharathi|A. B. Raj|M. K. Arjunan||\n|M A R|12|12|Swapnadanam|Rani Chandra, Dr. Mohandas|K. G. George|Bhaskar Chandavarkar||\n|M A R|19|13|Thulavarsham|Prem Nazir, sreedevi, Sudheer|N. Sankaran Nair|V. Dakshinamoorthy||\n|M A R|20|14|Aruthu|Kaviyoor Ponnamma, Kamalahasan|Ravi|G. Devarajan||\n|M A R|26|15|Swimming Pool|Kamal Haasan, M. G. Soman|J. Sasikumar|M. K. Arjunan||\n\n# Question\nWhat' s the content in the (1,1) cells\n" # noqa: E501
87

benchmarks/benchmark_serving.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525
from typing import AsyncGenerator, List, Tuple
2626

2727
import numpy as np
28+
from backend_request_func import (ASYNC_REQUEST_FUNCS, RequestFuncInput,
29+
RequestFuncOutput)
2830
from tqdm.asyncio import tqdm
2931
from transformers import PreTrainedTokenizerBase
30-
from vllm.transformers_utils.tokenizer import get_tokenizer
3132

32-
from backend_request_func import (
33-
ASYNC_REQUEST_FUNCS,
34-
RequestFuncInput,
35-
RequestFuncOutput,
36-
)
33+
from vllm.transformers_utils.tokenizer import get_tokenizer
3734

3835

3936
@dataclass

benchmarks/benchmark_throughput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from typing import List, Optional, Tuple
77

88
import torch
9+
from tqdm import tqdm
910
from transformers import (AutoModelForCausalLM, AutoTokenizer,
1011
PreTrainedTokenizerBase)
11-
from tqdm import tqdm
1212

1313

1414
def sample_requests(

benchmarks/kernels/benchmark_mixtral_moe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import os
33
import sys
44

5-
from vllm.model_executor.layers.fused_moe import fused_moe, get_config_file_name
65
import torch
76
import torch.nn.functional as F
87
import triton
98

9+
from vllm.model_executor.layers.fused_moe import (fused_moe,
10+
get_config_file_name)
11+
1012
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
1113

1214

benchmarks/kernels/benchmark_paged_attention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from typing import Optional
21
import argparse
32
import random
43
import time
4+
from typing import Optional
55

66
import torch
77

8-
from vllm.utils import STR_DTYPE_TO_TORCH_DTYPE, create_kv_caches_with_random
98
from vllm._C import ops
9+
from vllm.utils import STR_DTYPE_TO_TORCH_DTYPE, create_kv_caches_with_random
1010

1111
NUM_BLOCKS = 1024
1212
PARTITION_SIZE = 512

benchmarks/kernels/benchmark_rope.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import argparse
2+
from itertools import accumulate
13
from typing import Optional
24

3-
import argparse
4-
import torch
55
import nvtx
6-
from itertools import accumulate
6+
import torch
7+
78
from vllm.model_executor.layers.rotary_embedding import get_rope
89

910

cmake/hipify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#
1010

1111
import argparse
12-
import shutil
1312
import os
13+
import shutil
1414

1515
from torch.utils.hipify.hipify_python import hipify
1616

collect_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# Run it with `python collect_env.py` or `python -m torch.utils.collect_env`
77
import datetime
88
import locale
9+
import os
910
import re
1011
import subprocess
1112
import sys
12-
import os
1313
from collections import namedtuple
1414

1515
try:

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212

13+
import logging
1314
import os
1415
import sys
16+
1517
from sphinx.ext import autodoc
16-
import logging
1718

1819
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
1920

0 commit comments

Comments
 (0)