-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
354 lines (305 loc) · 9.12 KB
/
pyproject.toml
File metadata and controls
354 lines (305 loc) · 9.12 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
[project]
name = "nemo-safe-synthesizer"
dynamic = ["version"]
description = "Safe synthesizer"
readme = "README.md"
authors = [{ name = "NVIDIA", email = "nemo@nvidia.com" }]
requires-python = ">=3.11, <3.14"
license = "Apache-2.0"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Software Development",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
# "unsloth[cu128-torch291]==2025.12.4 requires datasets==4.3.0"
# it only has a runtime error of course
# so we need to pin it here
"datasets==4.3.0",
"faker>=20.0",
"huggingface-hub>=0.34.4,<1",
"pandas>=2.1.3",
"pydantic[email]>=2.12.5",
"pydantic-settings>=2.6.1",
"pyyaml>=6.0.1",
"jsonschema>=4.22.0",
"rich>=14.1.0",
"structlog>=25.4.0",
"colorama>=0.4.6",
"tqdm>=4.67.1",
"setuptools>=80.0.0",
]
[dependency-groups]
dev = [
"ipywidgets",
"jsonpath-ng==1.5.3",
"jupyterlab-widgets",
"pandas-stubs>=2.1.3",
"prek>=0.3.1",
"packaging>=25.0.0",
"typer>=0.15.0",
"types-click",
"types-colorama>=0.4.6",
"textual",
{include-group = "docs"},
{include-group = "test"},
]
docs = [
"mkdocs-material",
"mkdocstrings[python]",
"griffe-pydantic",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"mkdocs-jupyter",
]
test = [
"pytest>=8.3.3",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"pytest-env>=1.1.0",
"pytest-subtests>=0.13.1",
"pytest-timeout>=2.3.1",
"pytest-xdist>=3.5.0",
]
[project.optional-dependencies]
engine = [
"anyascii",
"pycountry",
"betterproto",
"flashtext",
"cached-property",
"category-encoders",
"dython",
"dateparser",
"faker",
"huggingface-hub>=0.34.4,<1",
"langchain-core",
"json-repair",
"matplotlib",
"outlines>=1.0.0",
"prv-accountant",
"smart-open==7.0.5",
"python-stdnum",
"pandas>=2.1.3, <3",
"plotly",
"ratelimit",
"scikit-learn",
"range_regex>=0.1.0",
"tenacity==9.1.4",
"tiktoken>=0.7.0,<1.0",
"tldextract",
"tqdm>=4.67.1",
"urllib3>=2.6.1",
"wandb==0.26.0",
]
# the following are deps that have Torch as a dep. We keep them separated out from the engine deps
#
# it's a little annoying to have to split them up like this with redundant bits.
# it allows us to have a cpu and a cuda version of torch+deps
# and allow explicit installation of the cpu depset on linux.
cpu = [
"accelerate",
"bitsandbytes==0.49.1",
"flashinfer-python==0.6.6; sys_platform=='linux'",
"flashinfer-cubin==0.6.6; sys_platform=='linux'",
"gliner",
"kernels>=0.12.1",
"peft",
"opacus",
"sentence-transformers",
"torch==2.10.0; sys_platform == 'darwin'",
"torch==2.10.0+cpu; sys_platform == 'linux'",
"torchvision==0.25.0; sys_platform == 'darwin'",
"torchvision==0.25.0+cpu; sys_platform == 'linux'",
"torchao==0.16.0",
"transformers==4.57.3",
"triton>=2.0.0; sys_platform=='linux'",
"trl>=0.23.0",
"unsloth[cu128-torch2100]==2026.3.18; sys_platform=='linux'",
"unsloth_zoo==2026.3.7; sys_platform=='linux'",
"vllm==0.18.0; sys_platform=='linux'",
]
cu128 = [
"accelerate",
"bitsandbytes==0.49.1",
"flashinfer-python==0.6.6; sys_platform == 'linux'",
"flashinfer-cubin==0.6.6; sys_platform == 'linux'",
"flashinfer-jit-cache==0.6.6+cu128; sys_platform == 'linux'",
"gliner",
"kernels>=0.12.1",
"nvidia-cublas-cu12; sys_platform == 'linux'",
"nvidia-ml-py; sys_platform == 'linux'",
"opacus",
"peft",
"sentence-transformers",
"torch==2.10.0+cu128; sys_platform == 'linux'",
"torch-c-dlpack-ext",
"torchvision==0.25.0+cu128; sys_platform == 'linux'",
"torchao==0.16.0+cu128; sys_platform == 'linux' and platform_machine == 'x86_64'",
"transformers==4.57.3",
"triton>=2.0.0; sys_platform == 'linux'",
"trl>=0.23.0",
"unsloth[cu128-torch2100]==2026.3.18; sys_platform == 'linux'",
"unsloth_zoo==2026.3.7; sys_platform == 'linux'",
"vllm==0.18.0; sys_platform == 'linux'",
"xformers==v0.0.34; sys_platform == 'linux' and platform_machine == 'x86_64'",
]
# at some point, do per-subpackage dependencies
[tool.uv]
# Version pinned in .mise.toml but keep here as a fallback constraint
# Allow current 0.9.x line while staying below 0.10.0
required-version = ">=0.9.30, <0.10.0"
cache-keys = [
{ file = "pyproject.toml" }, { git = { commit = true, tags = true } },
{ file = "uv.lock" }
]
conflicts = [
[
{ extra = "cpu" },
{ extra = "cu128" },
],
]
# xformers requires torch and more to be built.
no-build-isolation-package = ["xformers"]
dependency-metadata = [
{ name = "xformers", requires-dist = ["setuptools", "torch", "wheel"]},
]
override-dependencies = [
"flashinfer-python; sys_platform != 'darwin'", # uv locking won't find the matching versions of flashinfer-python and -cubin without overriding
"flashinfer-cubin; sys_platform != 'darwin'", # perhaps because the published wheels have some wrong metadata
]
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
# we have to add the following to make the right python packages for linux
# for downstream use in our linux/arm64 docker images.
# there's subtle differences in the naming convention on the python side
# even though they are the same architecture, so we use aarch64
"sys_platform == 'linux' and platform_machine == 'aarch64'",
]
constraint-dependencies = ["torch==2.10.0", "regex==2025.07.34", "pandas<3"]
[tool.uv.sources]
# here we specifiy the dep's source from which UV should attempt to resolve
triton = { index = "pytorch-cu128", extra = "cu128" }
xformers = { index = "pytorch-cu128", extra = "cu128" }
# for torch - we have a "cpu" dep set and "cu128" dep set, specified in the optional dependencies above
torch = [
{ index = "pytorch-cpu", extra="cpu", marker = "sys_platform=='linux'"},
{ index = "pytorch-cu128", extra="cu128"},
]
torchao = [
{ index = "pytorch-cu128", extra="cu128"},
]
torchvision = [
{ index = "pytorch-cpu", extra="cpu" },
{ index = "pytorch-cu128", extra="cu128"},
]
flashinfer-python = [
{ index = "flashinfer-jit-cache", marker = "sys_platform=='linux'", extra="cu128"},
]
flashinfer-cubin = [
{ index = "flashinfer-jit-cache", marker = "sys_platform=='linux'", extra="cu128"},
]
flashinfer-jit-cache = [
{ index = "flashinfer-jit-cache", marker = "sys_platform=='linux'", extra="cu128"},
]
nvidia-cublas-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cuda-cupti-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cuda-nvrtc-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cuda-nvprof-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cuda-runtime-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cuda-nvml-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cudnn-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cusparse-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-cusparselt-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-nccl-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-nvjitlink-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-nvshmem-cu12 = [
{ index = "pytorch-cu128" },
]
nvidia-nvtx-cu12 = [
{ index = "pytorch-cu128" },
]
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
# required for linux cpu - it's got a `+cpu` on the version
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "nv-shared-pypi-local"
url = "https://urm.nvidia.com/artifactory/api/pypi/nv-shared-pypi-local/simple"
explicit = true
[[tool.uv.index]]
name = "flashinfer-jit-cache"
url = "https://flashinfer.ai/whl/cu128"
explicit = true
[[tool.uv.index]]
name = "nvidia-pypi-public"
url = "https://pypi.nvidia.com"
explicit = true
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
# Fallback when no git tag is available (e.g. shallow clone, Dependabot)
fallback-version = "0.0.0"
vcs = "git"
style = "pep440"
[tool.hatch.build.targets.wheel]
packages = ["src/nemo_safe_synthesizer"]
# Include license files in wheel distribution
artifacts = [
"LICENSE",
"THIRD_PARTY.md",
]
[project.scripts]
safe-synthesizer = "nemo_safe_synthesizer.cli.cli:cli"
[tool.ty.rules]
# Platform-specific imports (e.g. unsloth on macOS) use ty: ignore[unresolved-import]
# that appear unused when the package is installed. Suppress the noise.
unused-ignore-comment = "ignore"
[tool.ty.environment]
extra-paths = ["typings"]
[tool.ty.src]
# Below is a list of excluded directories from ty typechecks.
exclude = [
".uv_cache", # Cache Dir in CI
"./docs/**/*.ipynb",
"./src/nemo_safe_synthesizer/pii_replacer/",
]