Skip to content

Commit 209c5ac

Browse files
committed
up
1 parent 90662d6 commit 209c5ac

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.lintrunner.toml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,24 +384,18 @@ code = "TORCH_AO_IMPORT"
384384
include_patterns = ["**/*.py"]
385385
exclude_patterns = [
386386
"third-party/**",
387-
# Some existing files have imports from torch.ao.quantization that are not going away, e.g.,
388-
# from torch.ao.quantization.fx.utils, from torch.ao.quantization.qconfig, etc.
389-
"backends/xnnpack/test/test_xnnpack_utils.py",
390-
"exir/backend/test/demos/test_xnnpack_qnnpack.py",
391-
"backends/xnnpack/quantizer/xnnpack_quantizer_utils.py",
392-
"backends/xnnpack/test/quantizer/test_pt2e_quantization.py",
393-
"backends/xnnpack/test/quantizer/test_xnnpack_quantizer.py",
394-
"examples/xnnpack/quantization/example.py",
395-
"exir/tests/test_quantization.py",
396-
"exir/tests/test_memory_planning.py",
397387
]
388+
398389
command = [
399390
"python3",
400391
"-m",
401392
"lintrunner_adapters",
402393
"run",
403394
"grep_linter",
404-
"--pattern=\\bfrom torch\\.ao\\.quantization(?:\\.[A-Za-z0-9_]+)*\\b",
395+
"--pattern=\\bfrom torch\\.ao\\.quantization\\.quantizer(?:\\.[A-Za-z0-9_]+)*\\b",
396+
"--pattern=\\bfrom torch\\.ao\\.quantization\\.observer(?:\\.[A-Za-z0-9_]+)*\\b",
397+
"--pattern=\\bfrom torch\\.ao\\.quantization\\.quantize_pt2e(?:\\.[A-Za-z0-9_]+)*\\b",
398+
"--pattern=\\bfrom torch\\.ao\\.quantization\\.pt2e(?:\\.[A-Za-z0-9_]+)*\\b",
405399
"--linter-name=TorchAOImport",
406400
"--error-name=Prohibited torch.ao.quantization import",
407401
"""--error-description=\

extension/llm/export/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
from pytorch_tokenizers import get_tokenizer
3838
from torch.export import export_for_training, ExportedProgram
3939
from torch.nn.attention import SDPBackend
40-
from torchao.utils import unwrap_tensor_subclass
4140
from torchao.quantization.pt2e.quantize_pt2e import convert_pt2e, prepare_pt2e
4241
from torchao.quantization.pt2e.quantizer import Quantizer
4342
from torchao.quantization.pt2e.quantizer.composable_quantizer import ComposableQuantizer
43+
from torchao.utils import unwrap_tensor_subclass
4444

4545
FORMAT = "[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s"
4646
logging.basicConfig(level=logging.INFO, format=FORMAT)

0 commit comments

Comments
 (0)