Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
487 lines (423 loc) · 14.5 KB
/
Copy pathpyproject.toml
File metadata and controls
487 lines (423 loc) · 14.5 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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
#####################################################################
# Core Project metadata
#####################################################################
[project]
name = "nvidia-physicsnemo"
authors = [
{ name="NVIDIA PhysicsNeMo Team"},
]
description = "A deep learning framework for AI-driven multi-physics systems"
readme = "README.md"
requires-python = ">=3.11,<3.15"
license = "Apache-2.0"
license-files = ["LICENSE.txt", "THIRD_PARTY_NOTICES.md"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dynamic = ["version", "optional_dependencies"]
dependencies = [
"warp-lang>=1.17.0",
"nvtx>=0.2.16",
"treelib>=1.8.0",
"numpy>=2.2.6",
"torch>=2.13.0",
"tqdm>=4.70.1",
"requests>=2.34.2",
# Retain a direct floor for urllib3's decompression-bomb security fixes.
"urllib3>=2.8.0",
"GitPython>=3.1.62",
"s3fs>=2026.9.0",
"packaging>=26.0",
"timm>=1.0.30",
"einops>=0.8.2",
"h5py>=3.16.0",
"cftime>=1.6.6",
"jaxtyping>=0.3.11",
"termcolor>=3.3.0",
"hydra-core>=1.3.7",
"tensordict[zarr]>=0.15.3,<0.16.0",
"omegaconf>=2.3.1",
"importlib-metadata>=9.0.1",
"psutil>=7.2.2",
"fsspec>=2026.9.0",
]
[project.urls]
Homepage = "https://github.com/NVIDIA/physicsnemo"
Documentation = "https://docs.nvidia.com/physicsnemo/index.html#core"
Issues = "https://github.com/NVIDIA/physicsnemo/issues"
Changelog = "https://github.com/NVIDIA/physicsnemo/blob/main/CHANGELOG.md"
#####################################################################
# Flags for UV compatibility
#####################################################################
[tool.uv]
managed = true
conflicts = [
[
{ extra = "cu12" },
{ extra = "cu13" },
],
[
{ extra = "natten-cu12" },
{ extra = "natten-cu13" },
],
[
{ extra = "transformer-engine-cu12" },
{ extra = "transformer-engine-cu13" },
],
[
{ extra = "cu12" },
{ extra = "natten-cu13" },
],
[
{ extra = "cu12" },
{ extra = "transformer-engine-cu13" },
],
[
{ extra = "cu13" },
{ extra = "natten-cu12" },
],
[
{ extra = "cu13" },
{ extra = "transformer-engine-cu12" },
],
[
{ extra = "natten-cu12" },
{ extra = "transformer-engine-cu13" },
],
[
{ extra = "natten-cu13" },
{ extra = "transformer-engine-cu12" },
],
]
[tool.uv.extra-build-dependencies]
torch-sparse = ["torch"]
torch-cluster = ["torch"]
torch-scatter = ["torch"]
transformer-engine-torch = [{ requirement = "torch", match-runtime = true }]
[[tool.uv.index]]
name = "nvidia"
url = "https://pypi.nvidia.com"
explicit = true # Only use for packages that explicitly specify this index
# Select PyTorch wheels from the same CUDA major version as RAPIDS and CuPy.
# These indexes apply to uv; pip users must select the wheel index explicitly.
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
# PyTorch 2.13 is the newest release with CUDA 12.9 wheels. CUDA 12.9 keeps
# Blackwell kernels and satisfies RAPIDS' nvJitLink>=12.9 requirement; later
# PyTorch releases publish CUDA 12 wheels only for CUDA 12.6, which stops at
# sm_90. Linux only: this index has no Windows wheels.
[[tool.uv.index]]
name = "pytorch-cu129"
url = "https://download.pytorch.org/whl/cu129"
explicit = true
# NATTEN pre-built wheel indexes (flat HTML pages), split by CUDA version AND
# torch version. The full path is required because natten encodes both CUDA
# and torch versions in local version identifiers (e.g. 0.21.7+torch2130cu126).
# Keep these URLs and the torch pins in the natten extras in sync: the binary
# extensions must use the same PyTorch ABI as the runtime.
# NATTEN publishes no CUDA 12.9 build; its CUDA 12.6 wheels run on the CUDA
# 12.9 PyTorch runtime but contain kernels only through sm_90.
# See https://natten.org/install/ for available builds.
[[tool.uv.index]]
name = "natten-cu126-whl"
url = "https://whl.natten.org/cu126/torch2.13.0"
format = "flat"
explicit = true
[[tool.uv.index]]
name = "natten-cu130-whl"
url = "https://whl.natten.org/cu130/torch2.13.0"
format = "flat"
explicit = true
[tool.uv.sources]
# When a CUDA 12 extra is active, torch/torchvision come from the CUDA 12.9
# index; with a CUDA 13 extra, they come from the CUDA 13.0 index. The NATTEN
# and Transformer Engine extras select the index too, so their CUDA binaries
# match PyTorch even without cu12/cu13. Every extra listed here must also
# declare torch and torchvision.
# When no CUDA extra is active (bare install), they come from PyPI.
# On macOS, CUDA extras should not be used (no GPU builds available).
torch = [
{ index = "pytorch-cu129", extra = "cu12" },
{ index = "pytorch-cu129", extra = "natten-cu12" },
{ index = "pytorch-cu129", extra = "transformer-engine-cu12" },
{ index = "pytorch-cu130", extra = "cu13" },
{ index = "pytorch-cu130", extra = "natten-cu13" },
{ index = "pytorch-cu130", extra = "transformer-engine-cu13" },
]
torchvision = [
{ index = "pytorch-cu129", extra = "cu12" },
{ index = "pytorch-cu129", extra = "natten-cu12" },
{ index = "pytorch-cu129", extra = "transformer-engine-cu12" },
{ index = "pytorch-cu130", extra = "cu13" },
{ index = "pytorch-cu130", extra = "natten-cu13" },
{ index = "pytorch-cu130", extra = "transformer-engine-cu13" },
]
cuml-cu13 = { index = "nvidia" }
cuml-cu12 = { index = "nvidia" }
pylibraft-cu13 = { index = "nvidia" }
pylibraft-cu12 = { index = "nvidia" }
nvidia-dali-cuda130 = { index = "nvidia" }
nvidia-dali-cuda120 = { index = "nvidia" }
# When natten-cu12 or natten-cu13 extras are active, pull natten from
# the pre-built wheel index instead of building from source via PyPI.
natten = [
{ index = "natten-cu126-whl", extra = "natten-cu12" },
{ index = "natten-cu130-whl", extra = "natten-cu13" },
]
# transformer-engine-torch is an sdist whose setup.py dynamically pins
# transformer_engine_cu{12,13} based on torch.version.cuda in the build
# environment. Without this override, uv lock freezes whichever CUDA
# variant happened to be in the build env, which broke CI when PyTorch
# 2.12 flipped the PyPI default to cu130 (the cu13 binary then got
# pulled into a CUDA 12.8 runtime, producing missing libcublas.so.13
# errors at import time). We provide the CUDA-agnostic subset of the
# dependencies here; the matching cuXX binary is pulled by the explicit
# transformer-engine-cu12 / transformer-engine-cu13 extras below.
# Static deps mirror TE 2.19's build_tools/pytorch.py::install_requirements().
[[tool.uv.dependency-metadata]]
name = "transformer-engine-torch"
requires-dist = [
"torch>=2.1",
"einops",
"onnxscript",
"onnx",
"packaging",
"pydantic",
"nvdlfw-inspect",
"nvidia-cudnn-frontend>=1.28.0",
]
#####################################################################
# Flags Controlling the local build of physicsnemo
#####################################################################
[build-system]
requires = ["hatchling>=1.32.4"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "physicsnemo/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["physicsnemo"]
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/docs",
"/examples",
"/test",
"/CODING_STANDARDS",
"/benchmarks",
]
#####################################################################
# Local Development Requirements (pytest, etc)
#####################################################################
[dependency-groups]
dev = [
"asv>=0.6.6",
"coverage>=7.16.2",
"interrogate>=1.7.0",
"onnx>=1.23.1",
"onnxscript>=0.7.2",
"pre-commit>=4.6.2",
"pytest>=9.1.1",
"pytest-dependency>=0.6.1",
"pytest-timeout>=2.4.0",
"ruff>=0.14.8",
"pytest-testmon>=2.2.0",
"ipykernel>=7.4.0",
"import-linter>=2.15",
]
#####################################################################
# Optional Dependency groups
#####################################################################
# These groups are self-referential. So, they chain together as you
# move up the physicsnemo hierarchy. A new extra dep in `physicsnemo/nn`
# will also be an extra dep in `physicsnemo/models`, but not the other
# direction.
[project.optional-dependencies]
# CUDA backend extras (mutually exclusive via [tool.uv] conflicts).
# Combine with feature extras, e.g. nvidia-physicsnemo[nn-extras,cu13].
# When neither is specified, torch comes from PyPI and no RAPIDS
# packages are installed.
cu13 = [
"torch>=2.13.0",
"torchvision>=0.28.0",
"cuml-cu13>=26.8.0",
"pylibraft-cu13>=26.8.0",
# RAPIDS' stable Numba 0.64 dependency does not support NumPy 2.5.
"numpy<2.5",
# Keep CuPy and PyTorch on the same CUDA major version (cupy/cupy#9827).
"cupy-cuda13x>=14.2.0",
"nvidia-dali-cuda130>=2.3.0",
]
cu12 = [
# PyTorch 2.14+ has no CUDA 12.9 wheels; see the pytorch-cu129 index.
"torch>=2.13.0,<2.14",
"torchvision>=0.28.0",
"cuml-cu12>=26.8.0",
"pylibraft-cu12>=26.8.0",
"cupy-cuda12x>=14.2.0",
"nvidia-dali-cuda120>=2.3.0",
]
# NATTEN pre-built wheel extras (mutually exclusive via [tool.uv] conflicts).
# Pair with the matching CUDA backend extra, e.g.:
# uv sync --extra cu12 --extra natten-cu12
# uv sync --extra cu13 --extra natten-cu13
# NATTEN 0.21.7 provides wheels for PyTorch 2.13, but not 2.14 yet.
# Without these extras, install NATTEN separately; see https://natten.org/install/.
natten-cu12 = [
"torch==2.13.0",
"torchvision>=0.28.0",
"natten>=0.21.7",
]
natten-cu13 = [
"torch==2.13.0",
"torchvision>=0.28.0",
"natten>=0.21.7",
]
# Transformer Engine extras (mutually exclusive via [tool.uv] conflicts).
# Pair with the matching CUDA backend extra, e.g.:
# pip install nvidia-physicsnemo[cu12,transformer-engine-cu12]
# pip install nvidia-physicsnemo[cu13,transformer-engine-cu13]
# Uses the metapackage's `core_cu12` / `core_cu13` extras (introduced in
# transformer-engine 2.14.0) to explicitly pin the CUDA backend binary,
# so the resolution doesn't depend on torch.version.cuda in the build
# env. See [[tool.uv.dependency-metadata]] above for the matching
# override on transformer-engine-torch's dynamic CUDA dep.
transformer-engine-cu12 = [
"torch>=2.13.0,<2.14",
"torchvision>=0.28.0",
"transformer_engine[core_cu12,pytorch]>=2.19.0",
]
transformer-engine-cu13 = [
"torch>=2.13.0",
"torchvision>=0.28.0",
"transformer_engine[core_cu13,pytorch]>=2.19.0",
]
utils-extras = [
"wandb>=0.30.0",
"mlflow>=3.16.1",
"line_profiler>=5.0.2",
]
mesh-extras = [
"matplotlib>=3.11.2",
"pyvista>=0.49.0",
"vtk>=9.7.1",
]
nn-extras = [
"scipy>=1.17.1",
"nvidia-physicsnemo[utils-extras]",
]
model-extras = [
"nvidia-physicsnemo[nn-extras]",
"pandas>=2.3.3",
"pyvista>=0.49.0",
"vtk>=9.7.1",
]
datapipes-extras = [
"pandas>=2.3.3",
"tfrecord>=1.14.6",
"dask>=2026.8.0",
"netCDF4>=1.7.3",
"xarray>=2026.7.0",
"zarr>=3.1.6",
]
uq-extras = [
"gpytorch>=1.15.2",
]
# Use case specific dependency groups.
gnns = [
"torch_geometric>=2.8.0.post1",
"torch_scatter>=2.1.2",
"torch_sparse>=0.6.18",
"torch_cluster>=1.6.3",
"PyYAML>=6.0.3",
# "nvfuser",
"nvidia-physicsnemo[model-extras]",
]
sym = [
"sympy>=1.14.0",
]
#####################################################################
# Linting configuration
#####################################################################
[tool.ruff]
# Enable flake8/pycodestyle (`E`), Pyflakes (`F`), flake8-bandit (`S`),
# isort (`I`), and performance 'PERF' rules.
lint.select = ["E", "F", "S", "I", "PERF"]
lint.fixable = ["I"]
# Never enforce `E501` (line length violations),
# and `S311` (random number generators)
# and `F722` which breaks jaxtyping annotations
lint.ignore = ["E501", "S311", "F722"]
# Exclude the docs and experimental folders (this applies to both lint and format)
exclude = ["docs", "physicsnemo/experimental"]
[tool.ruff.lint.per-file-ignores]
# Ignore `F401` (import violations) in all `__init__.py` files, and in `docs/*.py`.
"__init__.py" = ["F401"]
"docs/*.py" = ["F401"]
# Ignore `S101` (assertions) in all `test` files.
"test/*.py" = ["S101"]
"examples/**/test_*.py" = ["S101"]
[project.entry-points."physicsnemo.models"]
# AFNO
AFNO = "physicsnemo.models.afno:AFNO"
DistributedAFNO = "physicsnemo.models.afno:DistributedAFNO"
ModAFNO = "physicsnemo.models.afno:ModAFNO"
# Diffusion UNets
SongUNet = "physicsnemo.models.diffusion_unets:SongUNet"
SongUNetPosEmbd = "physicsnemo.models.diffusion_unets:SongUNetPosEmbd"
SongUNetPosLtEmbd = "physicsnemo.models.diffusion_unets:SongUNetPosLtEmbd"
DhariwalUNet = "physicsnemo.models.diffusion_unets:DhariwalUNet"
DiffusionUNet3D = "physicsnemo.models.diffusion_unets:DiffusionUNet3D"
# DiT
DiT = "physicsnemo.models.dit:DiT"
# Diffusion wrappers
CorrDiffRegressionUNet = "physicsnemo.models.diffusion_unets:CorrDiffRegressionUNet"
StormCastUNet = "physicsnemo.models.diffusion_unets:StormCastUNet"
# DLWP
DLWP = "physicsnemo.models.dlwp:DLWP"
# DLWP HEALPix
HEALPixRecUNet = "physicsnemo.models.dlwp_healpix:HEALPixRecUNet"
HEALPixUNet = "physicsnemo.models.dlwp_healpix:HEALPixUNet"
# DPOT
DPOTNet = "physicsnemo.models.dpot:DPOTNet"
# Fengwu
Fengwu = "physicsnemo.models.fengwu:Fengwu"
# FIGConvNet
FIGConvUNet = "physicsnemo.models.figconvnet:FIGConvUNet"
# FLARE
FLARE = "physicsnemo.models.flare:FLARE"
# FNO
FNO = "physicsnemo.models.fno:FNO"
# GeoTransolver
GeoTransolver = "physicsnemo.models.geotransolver:GeoTransolver"
# GLOBE
GLOBE = "physicsnemo.models.globe:GLOBE"
# GraphCast
GraphCastNet = "physicsnemo.models.graphcast:GraphCastNet"
# MeshGraphNets
MeshGraphNet = "physicsnemo.models.meshgraphnet:MeshGraphNet"
BiStrideMeshGraphNet = "physicsnemo.models.meshgraphnet:BiStrideMeshGraphNet"
MeshGraphKAN = "physicsnemo.models.meshgraphnet:MeshGraphKAN"
HybridMeshGraphNet = "physicsnemo.models.meshgraphnet:HybridMeshGraphNet"
# MLP
FullyConnected = "physicsnemo.models.mlp:FullyConnected"
# Pangu
Pangu = "physicsnemo.models.pangu:Pangu"
# Pix2Pix
Pix2Pix = "physicsnemo.models.pix2pix:Pix2Pix"
Pix2PixUnet = "physicsnemo.models.pix2pix:Pix2PixUnet"
# RNNs
One2ManyRNN = "physicsnemo.models.rnn:One2ManyRNN"
Seq2SeqRNN = "physicsnemo.models.rnn:Seq2SeqRNN"
# SRNNs
SRResNet = "physicsnemo.models.srrn:SRResNet"
# SwinRNN
SwinRNN = "physicsnemo.models.swinvrnn:SwinRNN"
# TopoDiff
TopoDiff = "physicsnemo.models.topodiff:TopoDiff"
# Transolver
Transolver = "physicsnemo.models.transolver:Transolver"
# VFGN
VFGN = "physicsnemo.models.vfgn:VFGNLearnedSimulator"