Skip to content

Commit e082fed

Browse files
authored
Merge pull request #34 from NVIDIA/release/v0.5.0
nvmath-python-0.5.0 release
2 parents 80a63cd + 64ccc98 commit e082fed

File tree

165 files changed

+12122
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+12122
-873
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ dist
1313
build
1414
wheelhouse
1515

16+
#Mac system files
17+
.DS_Store
18+
1619
#Test
1720
.pytest_cache
1821
*.pickle
@@ -23,3 +26,5 @@ wheelhouse
2326
Pipfile*
2427
.venv*
2528
.pipenv-cache
29+
30+
.mypy_cache

builder/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def check_path(header):
4343

4444
def decide_lib_name(ext_name):
4545
# TODO: move the record of the supported lib list elsewhere?
46-
for lib in ("cublas", "cusolver", "cufftMp", "cufft", "cusparse", "curand", "nvpl", "nvshmem", "mathdx"):
46+
for lib in ("cublas", "cusolver", "cufftMp", "cufft", "cusparse", "curand", "nvpl", "nvshmem", "mathdx", "cudss"):
4747
if lib in ext_name:
4848
return lib
4949
else:
@@ -105,7 +105,7 @@ def _prep_includes_libs_rpaths(self, lib_name):
105105
ldflag += f",-rpath,$ORIGIN/../../../../{lib_name}/lib:$ORIGIN/../../../../../../"
106106
case "cufftMp":
107107
ldflag += ",-rpath,$ORIGIN/../../../nvidia/cufftmp/cu12/lib"
108-
case "mathdx":
108+
case "mathdx" | "cudss":
109109
ldflag += ",-rpath,$ORIGIN/../../../nvidia/cu12/lib"
110110
case _:
111111
ldflag += f",-rpath,$ORIGIN/../../../nvidia/{lib_name}/lib"

docs/sphinx/_static/switcher.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "latest",
44
"url": "https://docs.nvidia.com/cuda/nvmath-python/latest"
55
},
6+
{
7+
"version": "0.5.0",
8+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.5.0"
9+
},
610
{
711
"version": "0.4.0",
812
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.4.0"

docs/sphinx/bindings/cudss.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. module:: nvmath.bindings.cudss
2+
3+
cuDSS (:mod:`nvmath.bindings.cudss`)
4+
==========================================
5+
6+
For detailed documentation on the original C APIs, refer to the `cuDSS documentation
7+
<https://docs.nvidia.com/cuda/cudss/>`_.
8+
9+
Enums and constants
10+
*******************
11+
12+
.. autosummary::
13+
:toctree: generated/
14+
15+
AlgType
16+
ConfigParam
17+
cuDSSError
18+
DataParam
19+
IndexBase
20+
Layout
21+
MatrixFormat
22+
MatrixType
23+
MatrixViewType
24+
OpType
25+
Phase
26+
PivotType
27+
Status
28+
29+
Functions
30+
*********
31+
32+
.. autosummary::
33+
:toctree: generated/
34+
35+
check_status
36+
config_create
37+
config_destroy
38+
config_get
39+
config_set
40+
create
41+
data_create
42+
data_destroy
43+
data_get
44+
data_set
45+
destroy
46+
execute
47+
get_config_param_dtype
48+
get_data_param_dtype
49+
get_device_mem_handler
50+
get_property
51+
matrix_create_batch_csr
52+
matrix_create_batch_dn
53+
matrix_create_csr
54+
matrix_create_dn
55+
matrix_destroy
56+
matrix_get_batch_csr
57+
matrix_get_batch_dn
58+
matrix_get_csr
59+
matrix_get_dn
60+
matrix_get_format
61+
matrix_set_batch_csr_pointers
62+
matrix_set_batch_values
63+
matrix_set_csr_pointers
64+
matrix_set_values
65+
set_comm_layer
66+
set_device_mem_handler
67+
set_stream
68+
set_threading_layer

docs/sphinx/bindings/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ follows:
3131
- :mod:`nvmath.bindings.cublas`
3232
* - cuBLASLt
3333
- :mod:`nvmath.bindings.cublasLt`
34+
* - cuDSS
35+
- :mod:`nvmath.bindings.cudss`
3436
* - cuFFT
3537
- :mod:`nvmath.bindings.cufft`
3638
* - cuRAND
@@ -186,6 +188,7 @@ This reference describes all nvmath-python's math primitives.
186188

187189
cublas
188190
cublasLt
191+
cudss
189192
cufft
190193
cusolver
191194
cusolverDn

docs/sphinx/conf.py

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"json_url": "/cuda/nvmath-python/latest/_static/switcher.json",
164164
"version_match": version,
165165
},
166-
"navbar_start": ["navbar-logo", "version-switcher"],
166+
"navbar_start": ["navbar-logo"],
167167
}
168168
html_show_sphinx = False
169169

@@ -182,7 +182,7 @@
182182

183183
# TODO: remove this once examples are published.
184184
linkcheck_ignore = [
185-
"https://github.com/NVIDIA/nvmath-python/tree/main/examples/distributed/.*",
185+
"https://github.com/NVIDIA/nvmath-python/tree/main/examples/sparse/.*",
186186
]
187187

188188

@@ -193,6 +193,21 @@ def autodoc_process_docstring(app, what, name, obj, options, lines):
193193
# there's no way we can touch the docstrings of np.dtype objects, so we
194194
# need to do post-processing here
195195
if isinstance(obj, np.dtype):
196+
docs = {}
197+
from nvmath.sparse._internal.cudss_data_ifc import memory_estimates_dtype
198+
199+
# TODO: find better way to declare docs in the source code.
200+
if obj == memory_estimates_dtype:
201+
docs = {
202+
"permanent_device_memory": "permanent device memory",
203+
"peak_device_memory": "peak device memory",
204+
"permanent_host_memory": "permanent host memory",
205+
"peak_host_memory": "peak host memory",
206+
"hybrid_min_device_memory": "(if in hybrid memory mode) minimum device memory for the hybrid memory mode",
207+
"hybrid_max_device_memory": "(if in hybrid memory mode) maximum host memory for the hybrid memory mode",
208+
"reserved": "reserved for future use",
209+
}
210+
196211
_, *mod, struct = name.split(".")
197212
mod = ".".join(mod)
198213
if mod == "bindings":
@@ -207,7 +222,8 @@ def autodoc_process_docstring(app, what, name, obj, options, lines):
207222
lines.append(line)
208223
lines.append("\n")
209224
for k in obj.fields:
210-
lines.append(f":param {k}:\n")
225+
docs_value = docs.get(k, "")
226+
lines.append(f":param {k}: {docs_value}\n")
211227
else:
212228
match_numba_dtype = re.search(r"nvmath.device.float(\d+)x(\d+)_type", name)
213229
if match_numba_dtype:
@@ -302,6 +318,7 @@ def remove_notebook_copyright(self, app, docname, content):
302318

303319

304320
def setup(app):
321+
fixup_internal_alias()
305322
app.add_css_file("nvmath_override.css")
306323
app.connect("autodoc-process-docstring", autodoc_process_docstring)
307324
app.connect("source-read", lambda *args, **kwargs: notebook_handler.remove_notebook_copyright(*args, **kwargs))
@@ -310,6 +327,16 @@ def setup(app):
310327
app.add_post_transform(UnqualifiedTitlesTransform)
311328

312329

330+
def fixup_internal_alias():
331+
from nvmath.sparse._internal import cudss_config_ifc, cudss_data_ifc
332+
333+
cudss_config_ifc.PlanConfig.__name__ = "DirectSolverPlanConfig"
334+
cudss_data_ifc.PlanInfo.__name__ = "DirectSolverPlanInfo"
335+
cudss_config_ifc.FactorizationConfig.__name__ = "DirectSolverFactorizationConfig"
336+
cudss_config_ifc.SolutionConfig.__name__ = "DirectSolverSolutionConfig"
337+
cudss_data_ifc.FactorizationInfo.__name__ = "DirectSolverFactorizationInfo"
338+
339+
313340
# -- Other options -------------------------------------------------
314341

315342
autosummary_generate = True
@@ -323,12 +350,21 @@ def setup(app):
323350
}
324351

325352
intersphinx_mapping = {
326-
"python": ("https://docs.python.org/3/", None),
327-
"numpy": ("https://numpy.org/doc/stable/", None),
353+
"cublas": ("https://docs.nvidia.com/cuda/cublas/", None),
354+
"cuda-bindings": ("https://nvidia.github.io/cuda-python/cuda-bindings/", None),
355+
"cuda-core": ("https://nvidia.github.io/cuda-python/cuda-core/", None),
356+
"cudss": ("https://docs.nvidia.com/cuda/cudss/", None),
357+
"cufft": ("https://docs.nvidia.com/cuda/cufft/", None),
328358
"cupy": ("https://docs.cupy.dev/en/stable/", None),
329-
"torch": ("https://pytorch.org/docs/stable/", None),
359+
# curand is not using sphinx yet - June, 2025
360+
# "curand": ("https://docs.nvidia.com/cuda/curand/", None),
361+
"cusolver": ("https://docs.nvidia.com/cuda/cusolver/", None),
362+
"cusparse": ("https://docs.nvidia.com/cuda/cusparse/", None),
330363
"numba": ("https://numba.readthedocs.io/en/stable/", None),
331-
"cufft": ("https://docs.nvidia.com/cuda/cufft/", None),
364+
"numpy": ("https://numpy.org/doc/stable/", None),
365+
"python": ("https://docs.python.org/3/", None),
366+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
367+
"torch": ("https://docs.pytorch.org/docs/stable/", None),
332368
}
333369

334370
napoleon_google_docstring = True

docs/sphinx/host-apis/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ Contents
1616
:maxdepth: 2
1717

1818
Linear Algebra <linalg/index.rst>
19+
Sparse Linear Algebra <sparse/index.rst>
1920
Fast Fourier Transform <fft/index.rst>
2021
Host API Utilities <utils.rst>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
*********************
2+
Sparse Linear Algebra
3+
*********************
4+
5+
.. _sparse-overview:
6+
7+
Overview
8+
========
9+
10+
The sparse linear algebra module :mod:`nvmath.sparse` in nvmath-python leverages various
11+
NVIDIA math libraries to support sparse linear algebra computations. As of the current Beta
12+
release, we offer the specialized sparse direct solver API based on the `cuDSS library
13+
<https://docs.nvidia.com/cuda/cudss/>`_.
14+
15+
.. _sparse-api-reference:
16+
17+
API Reference
18+
=============
19+
20+
.. module:: nvmath.sparse
21+
22+
Generic Linear Algebra APIs (:mod:`nvmath.sparse`)
23+
--------------------------------------------------
24+
25+
Generic APIs will be available in a later release.
26+
27+
.. module:: nvmath.sparse.advanced
28+
29+
Specialized Linear Algebra APIs (:mod:`nvmath.sparse.advanced`)
30+
---------------------------------------------------------------
31+
32+
.. autosummary::
33+
:toctree: generated/
34+
35+
direct_solver
36+
DirectSolver
37+
DirectSolverFactorizationConfig
38+
DirectSolverFactorizationInfo
39+
DirectSolverPlanConfig
40+
DirectSolverPlanInfo
41+
DirectSolverSolutionConfig
42+
memory_estimates_dtype
43+
44+
:template: dataclass.rst
45+
46+
DirectSolverAlgType
47+
DirectSolverMatrixType
48+
DirectSolverMatrixViewType
49+
DirectSolverOptions
50+
ExecutionCUDA
51+
ExecutionHybrid
52+
HybridMemoryModeOptions

docs/sphinx/installation.rst

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,19 @@ dependency is *required* unless stated otherwise.
289289
- 525.60.13+ (Linux) with CUDA 12.x
290290
- 525.60.13+ (Linux) with CUDA 12.x
291291
* - Python
292-
- 3.10-3.12
293-
- 3.10-3.12
294-
- 3.10-3.12
295-
- 3.10-3.12
296-
- 3.10-3.12
292+
- 3.10-3.13
293+
- 3.10-3.13
294+
- 3.10-3.13
295+
- 3.10-3.13
296+
- 3.10-3.13
297297
* - pip
298298
- 22.3.1+
299299
-
300300
-
301301
-
302302
-
303303
* - setuptools
304-
- >=70.0.0
304+
- >=77.0.3
305305
-
306306
-
307307
-
@@ -313,7 +313,7 @@ dependency is *required* unless stated otherwise.
313313
-
314314
-
315315
* - Cython
316-
- >=0.29.22,<3
316+
- >=3.0.4,<3.1
317317
-
318318
-
319319
-
@@ -330,10 +330,10 @@ dependency is *required* unless stated otherwise.
330330
- CUDA 12.x
331331
* - NumPy
332332
-
333-
- >=1.24
334-
- >=1.24
335-
- >=1.24
336-
- >=1.24
333+
- >=1.25
334+
- >=1.25
335+
- >=1.25
336+
- >=1.25
337337
* - | CuPy
338338
| (see `CuPy installation guide <https://docs.cupy.dev/en/stable/install.html>`_)
339339
-
@@ -351,7 +351,7 @@ dependency is *required* unless stated otherwise.
351351
* - libmathdx (cuBLASDx, cuFFTDx, ...)
352352
-
353353
-
354-
- 0.2.*
354+
- >=0.2.1,<0.3
355355
-
356356
-
357357
* - numba-cuda
@@ -360,12 +360,6 @@ dependency is *required* unless stated otherwise.
360360
- >=0.11.0
361361
- >=0.11.0
362362
-
363-
* - Numba
364-
-
365-
-
366-
- >=0.59.1
367-
- >=0.59.1
368-
-
369363
* - pynvjitlink
370364
-
371365
-
@@ -404,7 +398,7 @@ nvmath-python is tested in the following environments:
404398
* - GPU model
405399
- H100, B200, RTX 4090, CG1 (Grace-Hopper)
406400
* - Python
407-
- 3.10, 3.11, 3.12
401+
- 3.10, 3.11, 3.12, 3.13
408402
* - CPU architecture
409403
- x86_64, aarch64
410404
* - Operating system
@@ -626,7 +620,7 @@ For more information with regard to the new CUDA 12+ package layout on conda-for
626620
.. [2] nvmath-python relies on `CUDA minor version compatibility
627621
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html
628622
#minor-version-compatibility>`_.
629-
.. [4] As of beta 4.0 (v0.4.0), CuPy is a required run-time dependency except for CPU-only
623+
.. [4] As of beta 5.0 (v0.5.0), CuPy is a required run-time dependency except for CPU-only
630624
execution. In a future release it will be turned into an optional run-time dependency.
631625
.. [5] For example, Hopper GPUs are supported starting CUDA 11.8, so they would not work
632626
with libraries from CUDA 11.7 or below.

docs/sphinx/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ An example illustrating the use of the global Python logger is shown below:
220220
level=logging.DEBUG,
221221
format='%(asctime)s %(levelname)-8s %(message)s',
222222
datefmt='%m-%d %H:%M:%S'
223-
)
223+
)
224224
225225
# Call nvmath-python Pythonic APIs
226226
out = nvmath.linalg.advanced.matmul(...)

0 commit comments

Comments
 (0)