Skip to content

Commit 266aa02

Browse files
authored
misc: unused import followup (#1093)
Followup of #1092 The last one. Additionally @yzh119 I didn't fix the below unused imports, I am not sure if it will break the build. ``` flashinfer/jit/attention/__init__.py:17:15: F401 `.pytorch` imported but unused; consider removing, adding to `__all__`, or using a redundant alias | 15 | """ 16 | 17 | from . import pytorch, tvm | ^^^^^^^ F401 18 | from .pytorch import gen_batch_decode_mla_module as gen_batch_decode_mla_module 19 | from .pytorch import gen_batch_decode_module as gen_batch_decode_module | = help: Use an explicit re-export: `pytorch as pytorch` flashinfer/jit/attention/__init__.py:17:24: F401 `.tvm` imported but unused; consider removing, adding to `__all__`, or using a redundant alias | 15 | """ 16 | 17 | from . import pytorch, tvm | ^^^ F401 18 | from .pytorch import gen_batch_decode_mla_module as gen_batch_decode_mla_module 19 | from .pytorch import gen_batch_decode_module as gen_batch_decode_module | = help: Use an explicit re-export: `tvm as tvm` flashinfer/prefill.py:2664:13: F841 Local variable `module` is assigned to but never used | 2662 | if args not in modules_dict: 2663 | uri = get_batch_prefill_uri("cutlass", *args) 2664 | module = get_fmha_module(*args) | ^^^^^^ F841 2665 | 2666 | @register_custom_op( | = help: Remove assignment to unused variable `module` flashinfer/profiler/__init__.py:17:8: F401 `argparse` imported but unused | 15 | """ 16 | 17 | import argparse | ^^^^^^^^ F401 18 | import csv 19 | import json | = help: Remove unused import: `argparse` flashinfer/profiler/__init__.py:18:8: F401 `csv` imported but unused | 17 | import argparse 18 | import csv | ^^^ F401 19 | import json 20 | from collections import namedtuple | = help: Remove unused import: `csv` flashinfer/profiler/__init__.py:19:8: F401 `json` imported but unused | 17 | import argparse 18 | import csv 19 | import json | ^^^^ F401 20 | from collections import namedtuple 21 | from enum import Enum | = help: Remove unused import: `json` flashinfer/profiler/__init__.py:20:25: F401 `collections.namedtuple` imported but unused | 18 | import csv 19 | import json 20 | from collections import namedtuple | ^^^^^^^^^^ F401 21 | from enum import Enum 22 | from typing import List | = help: Remove unused import: `collections.namedtuple` ```
1 parent e5cfd6d commit 266aa02

File tree

6 files changed

+4
-14
lines changed

6 files changed

+4
-14
lines changed

aot_build_utils/generate_batch_ragged_prefill_sm90_inst.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818
import sys
1919
from pathlib import Path
2020

21-
from .literal_map import (
22-
dtype_literal,
23-
idtype_literal,
24-
mask_mode_literal,
25-
pos_encoding_mode_literal,
26-
)
21+
from .literal_map import dtype_literal, idtype_literal, mask_mode_literal
2722

2823

2924
def get_cu_file_str(

aot_build_utils/generate_single_decode_inst.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def get_cu_file_str(
6262
}}
6363
""".format(
6464
head_dim_qk=head_dim_qk,
65-
head_dim_vo=head_dim_vo,
6665
pos_encoding_mode=pos_encoding_mode_literal[int(pos_encoding_mode)],
6766
dtype_q=dtype_literal[dtype_q],
6867
dtype_kv=dtype_literal[dtype_kv],

aot_build_utils/generate_single_prefill_sm90_inst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import sys
1919
from pathlib import Path
2020

21-
from .literal_map import dtype_literal, mask_mode_literal, pos_encoding_mode_literal
21+
from .literal_map import dtype_literal, mask_mode_literal
2222

2323

2424
def get_cu_file_str(

ci/scripts/jenkins/git_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _request(
134134
logging.info(f"Got response from {full_url}: {content}")
135135
try:
136136
response = json.loads(content)
137-
except json.decoder.JSONDecodeError as e:
137+
except json.decoder.JSONDecodeError:
138138
return content
139139

140140
return response

tests/test_custom_allreduce.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# flashinfer: adapted from sglang + vllm
22
# refer to sgl-kernel/tests/test_custom_allreduce.py from sglang
33

4-
import ctypes
54
import logging
65
import multiprocessing as mp
7-
import random
86
import socket
9-
from dataclasses import dataclass
10-
from typing import Any, Dict, List, Optional
7+
from typing import Any
118

129
import pytest
1310
import torch

tests/test_groupwise_scaled_gemm_fp8.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import torch.nn.functional as F
2222
from einops import einsum, rearrange
2323

24-
import flashinfer
2524
from flashinfer.gemm import (
2625
gemm_fp8_nt_blockscaled,
2726
gemm_fp8_nt_groupwise,

0 commit comments

Comments
 (0)