-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (149 loc) · 4.38 KB
/
Copy pathpyproject.toml
File metadata and controls
162 lines (149 loc) · 4.38 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "mobius-onnx"
dynamic = ["version"]
description = "ONNX model definitions for GenAI using onnxscript.nn"
authors = [
{ name = "Microsoft Corporation" },
]
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
dependencies = [
"huggingface_hub",
"ml_dtypes",
"numpy>=1.24.0",
"onnx_ir>=1.0.0",
"onnx-shape-inference>=0.3.1",
"onnxscript>=0.7.1",
"rfc8785",
"safetensors",
"torch>=2.10.0",
"tqdm",
"transformers", # >5.0 recommended
]
[project.scripts]
mobius = "mobius.__main__:main"
[project.optional-dependencies]
transformers = ["transformers", "safetensors"]
gguf = ["gguf>=0.10.0"]
testing = [
"accelerate",
"diffusers",
"onnxruntime-easy>=0.1.1",
# onnxruntime>=1.28 is required for the fused Attention kernel to apply
# attention-logit soft-capping *before* the mask/bias (ONNX spec order).
# Older kernels (<=1.26) applied softcap after the mask, which diverges from
# the DecomposeAttentionPass output and fails its softcap parity tests.
"onnxruntime>=1.28.0",
"torch",
"transformers>=5.0",
"safetensors",
"onnxruntime-genai",
"pytest-xdist",
"pytest-timeout",
"gguf>=0.10.0",
"Pillow",
"librosa",
"jsonschema>=4.0",
]
ort-genai = ["onnxruntime-genai", "Pillow"]
docs = ["furo", "myst-parser", "sphinx", "sphinx_copybutton", "sphinxcontrib-mermaid"]
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
"mobius.upstream_patches" = ["data/*/*/*.patch", "data/*/*/*.json", "data/*/*/*.md"]
"mobius.integrations.onnx_genai" = ["_schema/*.json"]
"mobius.integrations.gguf._upstream_data" = ["*.json"]
[tool.setuptools.dynamic]
version = { attr = "mobius.__version__" }
[tool.pytest.ini_options]
addopts = "--tb=short --color=yes"
testpaths = ["src", "tests", "scripts"]
python_files = ["*_test.py"]
markers = [
"integration: integration tests requiring model downloads and GPU/CPU inference (deselect with '-m \"not integration\"')",
"integration_fast: integration tests for single-modality models (text, encoder, audio)",
"integration_slow: integration tests for multi-modality models (vision-language, multimodal)",
"benchmark: graph construction performance benchmarks",
"arch_validation: L2 architecture validation tests that download real HF configs (no weights) and build full-size ONNX graphs (deselect with '-m \"not arch_validation\"')",
"golden: L4 checkpoint-verified golden comparison tests (deselect with '-m \"not golden\"')",
"generation: L5 generation end-to-end golden tests (deselect with '-m \"not generation\"')",
"ort_genai_fast: network-free end-to-end tests against released onnxruntime-genai wheels",
"ort_genai_real: pinned real-artifact onnxruntime-genai generation tests",
]
[tool.mypy]
check_untyped_defs = true
disable_error_code = 'override,import-untyped'
disallow_any_generics = false
disallow_untyped_decorators = true
show_column_numbers = true
strict_optional = true
warn_incomplete_stub = true
warn_no_return = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = false
[tool.ruff]
line-length = 95
target-version = "py310"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle
"F", # Pyflakes
"G", # flake8-logging-format
"I", # isort
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"NPY", # modern numpy
"PERF", # Perflint
"PIE", # flake8-pie
"PYI", # flake8-pyi
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"SLOT", # flake8-slot
"T10", # flake8-debugger
"TID", # Disallow relative imports
"TRY", # flake8-try-except-raise
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
preview = true
ignore = [
"B9",
"C408",
"D1",
"D401",
"D417",
"E1",
"E2",
"E3",
"E501",
"SIM103",
"NPY002",
"PERF203",
"PERF401",
"PYI041",
"RUF022",
"RUF031",
"RUF052",
"RUF067",
"RUF105",
"SIM102",
"SIM108",
"SIM114",
"SIM116",
"TRY003",
]
[tool.ruff.lint.per-file-ignores]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.pydocstyle]
convention = "google"