"tools/vscode:/vscode.git/clone" did not exist on "e259d109fea97fbce6f81b3081390fcb99d594fa"
Unverified Commit 62797440 authored by Chang Su's avatar Chang Su Committed by GitHub
Browse files

[Lint] Add `python/sglang` to ruff F401 checks and remove unused imports in files (#11685)

parent 2614adf9
...@@ -4,7 +4,6 @@ import torch ...@@ -4,7 +4,6 @@ import torch
from sglang.srt.configs.model_config import AttentionArch from sglang.srt.configs.model_config import AttentionArch
from sglang.srt.layers.attention.flashattention_backend import FlashAttentionBackend 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.layers.radix_attention import RadixAttention
from sglang.srt.mem_cache.memory_pool import MLATokenToKVPool from sglang.srt.mem_cache.memory_pool import MLATokenToKVPool
from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode
......
...@@ -2,8 +2,6 @@ import unittest ...@@ -2,8 +2,6 @@ import unittest
import torch 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.mem_cache.memory_pool import MLATokenToKVPool
from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode from sglang.srt.model_executor.forward_batch_info import ForwardBatch, ForwardMode
from sglang.test.test_utils import CustomTestCase from sglang.test.test_utils import CustomTestCase
......
import argparse import argparse
import ast import ast
import asyncio import asyncio
import json
import re import re
import time import time
import numpy as np import numpy as np
import sglang as sgl import sglang as sgl
from sglang.lang.api import set_default_backend from sglang.utils import download_and_cache_file, read_jsonl
from sglang.lang.backend.runtime_endpoint import RuntimeEndpoint
from sglang.utils import download_and_cache_file, dump_state_text, read_jsonl
INVALID = -9999999 INVALID = -9999999
......
...@@ -18,7 +18,6 @@ from sglang.test.simple_eval_common import ( ...@@ -18,7 +18,6 @@ from sglang.test.simple_eval_common import (
HTML_JINJA, HTML_JINJA,
Eval, Eval,
EvalResult, EvalResult,
MessageList,
SamplerBase, SamplerBase,
SingleEvalResult, SingleEvalResult,
format_multichoice_question, format_multichoice_question,
......
...@@ -11,8 +11,6 @@ import re ...@@ -11,8 +11,6 @@ import re
from concurrent.futures import ThreadPoolExecutor, as_completed from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Dict, List, Optional from typing import Dict, List, Optional
import tqdm
try: try:
from human_eval.data import read_problems from human_eval.data import read_problems
from human_eval.evaluation import estimate_pass_at_k from human_eval.evaluation import estimate_pass_at_k
...@@ -41,7 +39,6 @@ def evaluate_functional_correctness( ...@@ -41,7 +39,6 @@ def evaluate_functional_correctness(
Evaluates the functional correctness of generated samples, and writes Evaluates the functional correctness of generated samples, and writes
results to f"{sample_file}_results.jsonl.gz" results to f"{sample_file}_results.jsonl.gz"
""" """
import copy
# Check the generated samples against test suites. # Check the generated samples against test suites.
with ThreadPoolExecutor(max_workers=n_workers) as executor: with ThreadPoolExecutor(max_workers=n_workers) as executor:
......
import itertools import itertools
import os
import unittest import unittest
import torch import torch
...@@ -577,7 +576,7 @@ class TestW8A8BlockFP8BatchedDeepGemm(CustomTestCase): ...@@ -577,7 +576,7 @@ class TestW8A8BlockFP8BatchedDeepGemm(CustomTestCase):
if not torch.cuda.is_available(): if not torch.cuda.is_available():
raise unittest.SkipTest("CUDA is not available") raise unittest.SkipTest("CUDA is not available")
try: try:
import deep_gemm import deep_gemm # noqa: F401
except ImportError: except ImportError:
raise unittest.SkipTest("DeepGEMM is not available") raise unittest.SkipTest("DeepGEMM is not available")
torch.set_default_device("cuda") torch.set_default_device("cuda")
......
import itertools import itertools
import os
import unittest import unittest
from typing import List, Tuple from typing import List, Tuple
......
import argparse import argparse
import time
import torch import torch
import triton # Added import import triton # Added import
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
from typing import Literal, Optional from typing import Optional
import pytest import pytest
import torch import torch
......
import types
from typing import Optional from typing import Optional
import pytest import pytest
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment