[Lint] Add python/sglang to ruff F401 checks and remove unused imports in files (#11685)
This commit is contained in:
@@ -4,7 +4,6 @@ import torch
|
||||
|
||||
from sglang.srt.configs.model_config import AttentionArch
|
||||
from sglang.srt.layers.attention.flashattention_backend import FlashAttentionBackend
|
||||
from sglang.srt.layers.attention.torch_native_backend import TorchNativeAttnBackend
|
||||
from sglang.srt.layers.radix_attention import RadixAttention
|
||||
from sglang.srt.mem_cache.memory_pool import MLATokenToKVPool
|
||||
from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode
|
||||
|
||||
@@ -2,8 +2,6 @@ import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from sglang.srt.layers.attention.flashattention_backend import FlashAttentionBackend
|
||||
from sglang.srt.layers.radix_attention import RadixAttention
|
||||
from sglang.srt.mem_cache.memory_pool import MLATokenToKVPool
|
||||
from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import argparse
|
||||
import ast
|
||||
import asyncio
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
|
||||
import sglang as sgl
|
||||
from sglang.lang.api import set_default_backend
|
||||
from sglang.lang.backend.runtime_endpoint import RuntimeEndpoint
|
||||
from sglang.utils import download_and_cache_file, dump_state_text, read_jsonl
|
||||
from sglang.utils import download_and_cache_file, read_jsonl
|
||||
|
||||
INVALID = -9999999
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ from sglang.test.simple_eval_common import (
|
||||
HTML_JINJA,
|
||||
Eval,
|
||||
EvalResult,
|
||||
MessageList,
|
||||
SamplerBase,
|
||||
SingleEvalResult,
|
||||
format_multichoice_question,
|
||||
|
||||
@@ -11,8 +11,6 @@ import re
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import tqdm
|
||||
|
||||
try:
|
||||
from human_eval.data import read_problems
|
||||
from human_eval.evaluation import estimate_pass_at_k
|
||||
@@ -41,7 +39,6 @@ def evaluate_functional_correctness(
|
||||
Evaluates the functional correctness of generated samples, and writes
|
||||
results to f"{sample_file}_results.jsonl.gz"
|
||||
"""
|
||||
import copy
|
||||
|
||||
# Check the generated samples against test suites.
|
||||
with ThreadPoolExecutor(max_workers=n_workers) as executor:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import itertools
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
@@ -577,7 +576,7 @@ class TestW8A8BlockFP8BatchedDeepGemm(CustomTestCase):
|
||||
if not torch.cuda.is_available():
|
||||
raise unittest.SkipTest("CUDA is not available")
|
||||
try:
|
||||
import deep_gemm
|
||||
import deep_gemm # noqa: F401
|
||||
except ImportError:
|
||||
raise unittest.SkipTest("DeepGEMM is not available")
|
||||
torch.set_default_device("cuda")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import itertools
|
||||
import os
|
||||
import unittest
|
||||
from typing import List, Tuple
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import argparse
|
||||
import time
|
||||
|
||||
import torch
|
||||
import triton # Added import
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
from typing import Literal, Optional
|
||||
from typing import Optional
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import types
|
||||
from typing import Optional
|
||||
|
||||
import pytest
|
||||
|
||||
Reference in New Issue
Block a user