Skip to content

misc: cleanup #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 25, 2025
Merged

Conversation

b8zhong
Copy link
Contributor

@b8zhong b8zhong commented May 25, 2025

πŸ“Œ Description

Short unused import code cleanup

πŸ” Related Issues

N/A

βœ… Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.

Copy link
Collaborator

@yzh119 yzh119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the contribution!

@yzh119 yzh119 merged commit e5cfd6d into flashinfer-ai:main May 25, 2025
2 checks passed
@yzh119
Copy link
Collaborator

yzh119 commented May 25, 2025

A next step could be using ruff as pre-commit hook instead of isort (as suggested by @abcdabcd987 ).

b8zhong added a commit to bzhng-development/flashinfer that referenced this pull request May 25, 2025
b8zhong added a commit to bzhng-development/flashinfer that referenced this pull request May 25, 2025
@b8zhong b8zhong mentioned this pull request May 25, 2025
yzh119 pushed a commit that referenced this pull request May 26, 2025
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`
   ```
@yzh119 yzh119 mentioned this pull request May 26, 2025
5 tasks
Edenzzzz pushed a commit to Edenzzzz/flashinfer that referenced this pull request Jun 6, 2025
<!-- .github/pull_request_template.md -->

## πŸ“Œ Description

<!-- What does this PR do? Briefly describe the changes and why they’re
needed. -->

Short unused import code cleanup

## πŸ” Related Issues

N/A

<!-- Link any related issues here -->

### βœ… Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.
Edenzzzz pushed a commit to Edenzzzz/flashinfer that referenced this pull request Jun 6, 2025
Followup of flashinfer-ai#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`
   ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants