Skip to content

Commit 20efc0d

Browse files
remove F401 from ignore rules -- unused imports (Lightning-AI#2272)
Signed-off-by: Masaki Kozuki <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6a59af3 commit 20efc0d

File tree

25 files changed

+31
-43
lines changed

25 files changed

+31
-43
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ ignore = [
157157
# TODO(crcrpar): Resolves the following ignores as these are added while enabling ruff check in pre-commit
158158
"F821", # https://docs.astral.sh/ruff/rules/undefined-name/
159159
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
160-
"F401", # https://docs.astral.sh/ruff/rules/unused-import/
161160
"F405", # https://docs.astral.sh/ruff/rules/undefined-local-with-import-star-usage/
162161
"E712", # https://docs.astral.sh/ruff/rules/true-false-comparison/
163162
"E721", # https://docs.astral.sh/ruff/rules/type-comparison/

thunder/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,26 @@
7878

7979
# TODO RC1 Review exposed names
8080
__all__ = [
81+
# module aliases
82+
"clang",
83+
"dtypes",
84+
"devices",
8185
"transforms",
86+
# function aliases
87+
"get_compile_data",
88+
"trace",
89+
# class aliases
90+
"Proxy",
91+
"TensorProxy",
92+
"NumberProxy",
93+
"StringProxy",
94+
"IntegerProxy",
95+
"FloatProxy",
96+
"ComplexProxy",
97+
"TupleProxy",
98+
"ListProxy",
99+
"DictProxy",
100+
"AnyProxy",
82101
# dtype aliases
83102
"bool8",
84103
"uint8",

thunder/benchmarks/benchmark_peft.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import argparse
32
import os
43
import random
@@ -14,7 +13,7 @@
1413

1514
from tqdm import tqdm
1615

17-
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoTokenizer, WordpieceTokenizer
16+
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoTokenizer
1817
from peft import LoraConfig, get_peft_model
1918
from datasets import Dataset
2019

thunder/clang/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import annotations
2-
from collections import namedtuple
32
from collections.abc import Callable, Sequence
43
from functools import partial, reduce
54
from numbers import Number

thunder/core/jit_ext.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import time
1313
import warnings
1414
from types import (
15-
BuiltinFunctionType,
1615
BuiltinMethodType,
1716
CellType,
1817
FunctionType,

thunder/core/recipe.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ def apply(self, model):
131131
for plugin in post_plugins:
132132
lookasides.extend(plugin.setup_lookasides() or [])
133133

134-
from thunder.core import jit_ext, interpreter
135-
136134
if lookasides is not None:
137135
self._lookaside_executor = TemporaryExecutor()
138136
for lookaside in lookasides:

thunder/core/update_aliases.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from thunder.core.pytree import tree_flatten
66
from thunder.core.symbol import BoundSymbol, BoundSymbolTag, has_tags
77
from thunder.core.trace import from_trace, tracectx, TraceCtx as Trace, TraceProvenance, VariableInterface
8-
from thunder.torch import setitem_
98

109

1110
def _update_swap_map(swap_map, old_alias, new_alias):

thunder/distributed/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from torch.utils.weak import WeakTensorKeyDictionary
1616

1717
import thunder.core.utils as utils
18-
from thunder.core.proxies import DistParallelType
1918
from thunder.distributed.tensor_parallel import column_parallel
2019
from thunder.distributed.tensor_parallel import row_parallel
2120

thunder/dynamo/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
import dataclasses
66
import inspect
77
import itertools
8-
import copy
98
from types import NoneType
109
from collections import defaultdict
1110
from collections import namedtuple
1211

1312
import torch
1413
from torch.nn.modules.module import _addindent
15-
from torch._subclasses.fake_tensor import FakeTensor
1614
from torch.utils.weak import TensorWeakRef
1715

1816
if torch.distributed.is_available():

thunder/examine/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import Any
21
from collections.abc import Callable
32
import collections
43
import traceback

0 commit comments

Comments
 (0)