[CI] Remove unused imports with Ruff to pre-commit config, only to benchmarks/docs/examples folder (#3969)
This commit is contained in:
@@ -23,7 +23,7 @@ import warnings
|
||||
from argparse import ArgumentParser
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
|
||||
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple
|
||||
|
||||
import aiohttp
|
||||
import numpy as np
|
||||
|
||||
@@ -4,8 +4,6 @@ import math
|
||||
import cudnn
|
||||
import torch
|
||||
import torch.utils.benchmark as benchmark
|
||||
import triton
|
||||
import triton.language as tl
|
||||
from flashinfer import BatchDecodeWithPagedKVCacheWrapper
|
||||
|
||||
from sglang.srt.layers.attention.triton_ops.decode_attention import decode_attention_fwd
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import itertools
|
||||
import math
|
||||
import os
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
||||
@@ -3,7 +3,6 @@ from typing import Optional, Tuple, Union
|
||||
|
||||
import torch
|
||||
import triton
|
||||
import triton.language as tl
|
||||
from flashinfer.norm import fused_add_rmsnorm, rmsnorm
|
||||
from torch import nn
|
||||
from vllm import _custom_ops as vllm_ops
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import itertools
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
import torch
|
||||
import triton
|
||||
import triton.language as tl
|
||||
|
||||
@@ -15,42 +15,28 @@
|
||||
import argparse
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import resource
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import warnings
|
||||
from argparse import ArgumentParser
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
import aiohttp
|
||||
import numpy as np
|
||||
import requests
|
||||
from launch_server import LORA_PATH, NUM_LORAS
|
||||
from tqdm.asyncio import tqdm
|
||||
from transformers import (
|
||||
AutoTokenizer,
|
||||
PreTrainedTokenizer,
|
||||
PreTrainedTokenizerBase,
|
||||
PreTrainedTokenizerFast,
|
||||
)
|
||||
from transformers import PreTrainedTokenizerBase
|
||||
|
||||
from sglang.bench_serving import (
|
||||
AIOHTTP_TIMEOUT,
|
||||
SHAREGPT_URL,
|
||||
BenchmarkMetrics,
|
||||
RequestFuncInput,
|
||||
RequestFuncOutput,
|
||||
calculate_metrics,
|
||||
check_chat_template,
|
||||
get_model,
|
||||
get_request,
|
||||
get_tokenizer,
|
||||
parse_request_rate_range,
|
||||
remove_prefix,
|
||||
sample_random_requests,
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ import time
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import tiktoken
|
||||
from tqdm import tqdm
|
||||
|
||||
from sglang.test.test_utils import (
|
||||
add_common_sglang_args_and_parse,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import argparse
|
||||
|
||||
import PIL.Image
|
||||
import torch
|
||||
from data_utils import save_json
|
||||
from eval_utils import (
|
||||
|
||||
@@ -5,7 +5,6 @@ import os
|
||||
import re
|
||||
|
||||
import yaml
|
||||
from datasets import concatenate_datasets, load_dataset
|
||||
|
||||
DOMAIN_CAT2SUB_CAT = {
|
||||
"Art and Design": ["Art", "Art_Theory", "Design", "Music"],
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import itertools
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
import threading
|
||||
import time
|
||||
from argparse import ArgumentParser
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user