forked from foundation-model-stack/fms-model-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
146 lines (134 loc) · 4.48 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
[project]
name = "fms-model-optimizer"
description = "Quantization Techniques"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.9,<3.12"
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
]
dynamic = ["version"]
dependencies = [
"torch >=2.1, <2.4",
"numpy",
"tqdm",
"tensorboard",
"notebook",
"torchvision>=0.8",
"transformers",
"accelerate",
"evaluate",
"datasets",
"huggingface_hub",
"pandas",
"safetensors",
"ninja",
]
[project.optional-dependencies]
dev = ["pre-commit>=3.0.4,<5.0"]
fp8 = ["llmcompressor"]
gptq = ["auto_gptq"]
visualize = ["matplotlib", "graphviz", "pygraphviz"]
[project.urls]
homepage = "https://github.com/foundation-model-stack/fms-model-optimizer"
source = "https://github.com/foundation-model-stack/fms-model-optimizer"
issues = "https://github.com/foundation-model-stack/fms-model-optimizer/issues"
[tool.setuptools_scm]
version_file = "fms_mo/_version.py"
# do not include +gREV local version, required for Test PyPI upload
local_scheme = "no-local-version"
[tool.setuptools.packages.find]
where = [""]
include = ["fms_mo", "fms_mo*"]
[tool.ruff]
target-version = "py310"
# same as Black's default line length
line-length = 88
[tool.ruff.lint]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# modern type annotations
extend-safe-fixes = ["UP006", "UP007"]
# Fixers will be enabled gradually.
select = [
"B", # flake8-bugbear
"E", # pycodestyle
"F", # Pyflakes
"Q", # flake8-quotes
# Ruff does not support isort's import_headings feature, yet.
# "I", # isort
# "UP", # pyupgrade
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
]
# Issues should be fixded gradually
ignore = [
"B904", # `raise from err` or `raise from None`
"B905", # Without an explicit `strict=` parameter
"B006", # Do not use mutable data structures for argument defaults
"B007", # Loop control variable not used within loop body
"B009", # Do not call `getattr` with a constant attribute value
"B010", # Do not call `setattr` with a constant attribute value
"B028", # No explicit `stacklevel` keyword argument found
"E501", # Line too long
"E711", # Comparison to `None` should be `cond is None`
"E713", # Test for membership should be `not in`
"E714", # Test for object identity should be `is not`
"E722", # Do not use bare `except`
"E741", # Ambiguous variable name
"F401", # imported but unused
"F541", # "f-string without any placeholders
"F821", # Undefined name
"F841", # Local variable is assigned to but never used
"SIM102", # Use a single if instead of nested if
"SIM108", # Use ternary operator
"SIM118", # Use `key in dict` instead of `key in dict.keys()`
"SIM201", # Use `fw.data.dtype != dtype` instead of `not fw.data.dtype == dtype`
"SIM910", # "Use `config_fp32.get(other_str)` instead of `config_fp32.get(other_str, None)`
"TID252", # Prefer absolute imports over relative imports from parent modules
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"yamllint".msg = "yamllint is for CLI usage only."
[tool.ruff.lint.isort]
# same as .isort.cfg except for settings that are commented out as that are not yet supported
# profile="black"
from-first=true
# import_heading_future="Future"
# import_heading_stdlib="Standard"
# import_heading_thirdparty="Third Party"
# import_heading_firstparty="First Party"
# import_heading_localfolder="Local"
known-local-folder=["fms_mo","tests"]
# extend-skip="fms_mo/_version.py"
[tool.mypy]
mypy_path = [""]
packages = ["fms_mo", "tests"]
disable_error_code = []
# TODO: tighten MyPy checks by enabling these checks over time.
check_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
warn_return_any = true
# honor excludes by not following there through imports
follow_imports = "silent"
exclude = []
[[tool.mypy.overrides]]
# packages without typing annotations, without stubs, or not available.
module = [
"datasets",
"huggingface_hub.*",
]
ignore_missing_imports = true