Skip to content

Commit 1cbc60b

Browse files
authored
Updates for nvmath-python-0.4.0 release (#26)
Updates for nvmath-python-0.4.0 release
1 parent 02d18a3 commit 1cbc60b

File tree

289 files changed

+33630
-12080
lines changed

Some content is hidden

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

289 files changed

+33630
-12080
lines changed

.pre-commit-config.yaml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.6.0
7+
rev: v5.0.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-ast
@@ -22,37 +22,41 @@ repos:
2222
args: ['--fix=lf']
2323

2424
- repo: https://github.com/abravalheri/validate-pyproject
25-
rev: v0.19
25+
rev: v0.24
2626
hooks:
2727
- id: validate-pyproject
2828
additional_dependencies: ["validate-pyproject-schema-store[all]"]
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.6.4
31+
rev: v0.11.2
3232
hooks:
3333
- id: ruff
3434
args: [--fix]
3535
- id: ruff-format
3636

37-
# FIXME
3837
# Mypy: static type checking
3938
- repo: https://github.com/pre-commit/mirrors-mypy
40-
rev: "v1.13.0"
39+
rev: "v1.15.0"
4140
hooks:
4241
- id: mypy
42+
# Envorce only one source of configuration.
4343
args: ["--config-file", "pyproject.toml"]
44-
files: ^nvmath(.*)\.py$
4544
additional_dependencies:
4645
- cuda-python
4746
- cupy-cuda12x
48-
- mpi4py-mpich
47+
# TODO: https://github.com/mpi4py/mpi4py/issues/630
48+
# - mpi4py
4949
- numba
50+
- numba-cuda
5051
- numpy
5152
- pytest
5253
- scipy
5354
- torch
5455
- types-cffi
5556
- types-pywin32
57+
- invoke
58+
- cython<3
59+
- wheel
5660

5761
# FIXME: Prettier pre-commit plugin is no longer supported
5862
# Autoformat: YAML, JSON, Markdown, etc.
@@ -63,7 +67,7 @@ repos:
6367

6468
# Spellcheck
6569
- repo: https://github.com/codespell-project/codespell
66-
rev: "v2.3.0"
70+
rev: "v2.4.1"
6771
hooks:
6872
- id: codespell
6973
additional_dependencies:
@@ -78,38 +82,32 @@ repos:
7882

7983
# Security: secrets
8084
- repo: https://github.com/gitleaks/gitleaks
81-
rev: v8.18.4
85+
rev: v8.24.0
8286
hooks:
8387
- id: gitleaks
8488

85-
# FIXME
86-
# Security: secrets
87-
- repo: https://github.com/thoughtworks/talisman
88-
rev: "v1.32.0"
89-
hooks:
90-
- id: talisman-commit
91-
entry: cmd --githook pre-commit
92-
93-
# FIXME
9489
# Bash linter
95-
# - repo: https://github.com/openstack/bashate
96-
# rev: 2.1.1
97-
# hooks:
98-
# - id: bashate
99-
# args: ["--ignore=E006,E010,E020"]
90+
- repo: https://github.com/openstack/bashate
91+
rev: 2.1.1
92+
hooks:
93+
- id: bashate
94+
args: ["--ignore=E006,E010,E020"]
10095

101-
# FIXME
10296
# Shell script linter
103-
# - repo: https://github.com/shellcheck-py/shellcheck-py
104-
# rev: "v0.10.0.1"
105-
# hooks:
106-
# - id: shellcheck
97+
- repo: https://github.com/shellcheck-py/shellcheck-py
98+
rev: "v0.10.0.1"
99+
hooks:
100+
- id: shellcheck
107101

108102
# Lint: Markdown
109103
- repo: https://github.com/igorshubovych/markdownlint-cli
110-
rev: v0.41.0
104+
rev: v0.44.0
111105
hooks:
112106
- id: markdownlint
107+
# Setting up node version explicitly
108+
# https://github.com/igorshubovych/markdownlint-cli/issues/502
109+
language: node
110+
language_version: "22.14.0"
113111
# Ignore old internal README that will not be rendered as docs page
114112
args: ["--fix", "--ignore", "internal/gtc2024/README.md"]
115113

@@ -119,6 +117,3 @@ repos:
119117
- id: sphinx-lint
120118
args: ["--enable", "all", "--max-line-length", "92"]
121119
exclude: ^(.*)generated/(.*)\.rst$
122-
123-
default_language_version:
124-
python: python310

.talismanrc

Lines changed: 0 additions & 89 deletions
This file was deleted.

builder/pep517.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

builder/utils.py

Lines changed: 18 additions & 13 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", "cufft", "cusparse", "curand", "nvpl"):
46+
for lib in ("cublas", "cusolver", "cufftMp", "cufft", "cusparse", "curand", "nvpl", "nvshmem", "mathdx"):
4747
if lib in ext_name:
4848
return lib
4949
else:
@@ -92,18 +92,23 @@ def _prep_includes_libs_rpaths(self, lib_name):
9292
extra_linker_flags = ["-Wl,--strip-all"]
9393
if lib_name is not None:
9494
ldflag = "-Wl,--disable-new-dtags"
95-
if lib_name == "nvpl":
96-
# 1. the nvpl bindings land in
97-
# site-packages/nvmath/bindings/nvpl/_internal/ as opposed to other
98-
# packages that have their bindings in
99-
# site-packages/nvmath/bindings/_internal/, so we need one extra `..` to
100-
# get into `site-packages` and then the lib_name=nvpl is not in nvidia
101-
# dir but directly in the site-packages.
102-
# 2. mkl lib is placed directly in the python `lib` directory, not in
103-
# python{ver}/site-packages
104-
ldflag += f",-rpath,$ORIGIN/../../../../{lib_name}/lib:$ORIGIN/../../../../../../"
105-
else:
106-
ldflag += f",-rpath,$ORIGIN/../../../nvidia/{lib_name}/lib"
95+
match lib_name:
96+
case "nvpl":
97+
# 1. the nvpl bindings land in
98+
# site-packages/nvmath/bindings/nvpl/_internal/ as opposed to other
99+
# packages that have their bindings in
100+
# site-packages/nvmath/bindings/_internal/, so we need one extra
101+
# `..` to get into `site-packages` and then the lib_name=nvpl is not
102+
# in nvidia dir but directly in the site-packages.
103+
# 2. mkl lib is placed directly in the python `lib` directory, not
104+
# in python{ver}/site-packages
105+
ldflag += f",-rpath,$ORIGIN/../../../../{lib_name}/lib:$ORIGIN/../../../../../../"
106+
case "cufftMp":
107+
ldflag += ",-rpath,$ORIGIN/../../../nvidia/cufftmp/cu12/lib"
108+
case "mathdx":
109+
ldflag += ",-rpath,$ORIGIN/../../../nvidia/cu12/lib"
110+
case _:
111+
ldflag += f",-rpath,$ORIGIN/../../../nvidia/{lib_name}/lib"
107112
extra_linker_flags.append(ldflag)
108113

109114
return cuda_incl_dir, extra_linker_flags

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL=/bin/bash
33

44
# You can set these variables from the command line or environment
55
SPHINX_NVMATH_PYTHON_VER ?= $(shell [[ $$(< ../pyproject.toml) =~ [^a-zA-Z_]version\ =\ [^0-9.]*([0-9.]*) ]] && echo $${BASH_REMATCH[1]})
6-
SPHINXOPTS ?= -W
6+
SPHINXOPTS ?= -j auto -W
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = sphinx
99
BUILDDIR ?= _build/html

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.4.0",
8+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.4.0"
9+
},
610
{
711
"version": "0.3.0",
812
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.3.0"

docs/sphinx/conf.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
try:
3636
import nvmath
37-
from nvmath._internal.enum_utils import snake_to_camel
37+
from nvmath.internal.enum_utils import snake_to_camel
3838
except ImportError:
3939
warnings.warn(
4040
"\n\n\n"
@@ -93,6 +93,13 @@
9393
"nbsphinx_link",
9494
]
9595

96+
extlinks = {
97+
"cufftmp_hw": (
98+
"https://docs.nvidia.com/cuda/cufftmp/usage/requirements.html#hardware-%s",
99+
"p2p or GPUDirect RDMA over IB %s",
100+
)
101+
}
102+
96103
imgmath_latex_preamble = r"\usepackage{braket}"
97104

98105
imgmath_image_format = "svg"
@@ -126,6 +133,9 @@
126133
# This pattern also affects html_static_path and html_extra_path.
127134
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
128135

136+
if tags.has("exclude-nvmath-distributed"): # noqa: F821
137+
exclude_patterns += ["distributed-apis"]
138+
129139
# The reST default role (used for this markup: `text`) to use for all documents.
130140
default_role = "cpp:any" # cpp:any
131141

@@ -170,6 +180,11 @@
170180
# Output file base name for HTML help builder.
171181
htmlhelp_basename = "nvmath-python-doc"
172182

183+
# TODO: remove this once examples are published.
184+
linkcheck_ignore = [
185+
"https://github.com/NVIDIA/nvmath-python/tree/main/examples/distributed/.*",
186+
]
187+
173188

174189
def autodoc_process_docstring(app, what, name, obj, options, lines):
175190
if snake_to_camel is None:
@@ -303,6 +318,8 @@ def setup(app):
303318
# avoid name clash with the fft func
304319
"nvmath.fft.FFT": "nvmath.fft.FFT-class",
305320
"nvmath.linalg.advanced.Matmul": "nvmath.linalg.advanced.Matmul-class",
321+
"nvmath.distributed.fft.FFT": "nvmath.distributed.fft.FFT-class",
322+
"nvmath.distributed.reshape.Reshape": "nvmath.distributed.reshape.Reshape-class",
306323
}
307324

308325
intersphinx_mapping = {

docs/sphinx/device-apis/utils.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ API Reference
3636
CodeType
3737
ComputeCapability
3838
CodeType
39-
Symbol
4039
Dim3

0 commit comments

Comments
 (0)