Skip to content

Commit 48f5b64

Browse files
authored
Merge pull request #58 from NVIDIA/release/v0.9.0
release: nvmath-python-0.9.0
2 parents 711b2cd + e0a90db commit 48f5b64

674 files changed

Lines changed: 67495 additions & 11896 deletions

File tree

Some content is hidden

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

‎.gitignore‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ Pipfile*
2828
.pipenv-cache
2929

3030
.mypy_cache
31+
32+
# Cursor Local Agent Settings
33+
.cursor/local/*
34+
!.cursor/local/settings.template.md
35+
.cursor/sandbox.json
36+
.cursor/plans/
37+
.cursor/rules/
38+
!.cursor/rules/global-*
39+
40+
# GPU Bridge temporary files
41+
internal/cursor/run/
42+
43+
# graphify
44+
graphify-out/

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ shape = 512 // nranks, 256, 512
225225
a = nvmath.distributed.allocate_symmetric_memory(shape, cp, dtype=cp.complex128)
226226
# a is a cupy ndarray and can be operated on using in-place cupy operations.
227227
with cp.cuda.Device(device_id):
228-
a[:] = cp.random.rand(*shape, dtype=cp.float64) + 1j *
228+
a[:] = (
229229
cp.random.rand(*shape, dtype=cp.float64)
230+
+ 1j * cp.random.rand(*shape, dtype=cp.float64)
231+
)
230232

231233
# Forward FFT.
232234
# In this example, the forward FFT operand is distributed according

‎builder/utils.py‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ def detect_cuda_paths():
2020
# isolation is on, the build prefix is added to sys.path, but this is the only
2121
# implementation detail that we rely on.
2222
# TODO: move to cuda.pathfinder.
23-
potential_build_prefixes = (
24-
[os.path.join(p, "nvidia/cu13") for p in sys.path]
25-
# internal/bindings depends on cuda_bindings cydriver,
26-
# which introduces dependency on cudaProfiler.h
27-
+ [os.path.join(p, "nvidia/cuda_profiler_api") for p in sys.path]
28-
+ [os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME", "")), "/usr/local/cuda"]
29-
)
23+
potential_build_prefixes = [os.path.join(p, "nvidia/cu13") for p in sys.path] + [
24+
os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME", "")),
25+
"/usr/local/cuda",
26+
]
27+
# Filter out empty paths, e.g. when neither CUDA_PATH nor CUDA_HOME is set
28+
potential_build_prefixes = [p for p in potential_build_prefixes if p]
3029
cuda_paths = []
3130

3231
def check_path(header):
@@ -46,9 +45,6 @@ def check_path(header):
4645

4746
check_path("cuda.h")
4847
check_path("crt/host_defines.h")
49-
# internal/bindings depends on cuda_bindings cydriver,
50-
# which introduces dependency on cudaProfiler.h
51-
check_path("cudaProfiler.h")
5248
return cuda_paths
5349

5450

@@ -64,7 +60,6 @@ def decide_lib_name(ext_name):
6460
"curand",
6561
"nvpl",
6662
"nvshmem",
67-
"nccl",
6863
"mathdx",
6964
"cudss",
7065
"cutensor",

‎docs/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ clean:
1717
rm -rf ${SOURCEDIR}/bindings/generated/
1818
rm -rf ${SOURCEDIR}/host-apis/**/generated
1919
rm -rf ${SOURCEDIR}/device-apis/generated
20+
rm -rf ${SOURCEDIR}/distributed-apis/generated
2021
rm -rf ${SOURCEDIR}/distributed-apis/**/generated
2122

2223
html: Makefile

‎docs/sphinx/_static/nvmath_override.css‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* sphinx-tabs ships tabs.css for themes that set body[data-theme=...] (e.g. Furo).
3+
* PyData / NVIDIA Sphinx theme uses html[data-bs-theme=light|dark|auto] instead, so
4+
* those dark rules never match and tab panels / the active tab stay white in dark mode.
5+
* tabs.css may override generic rules, so we use .sphinx-tabs ... selectors for
6+
* higher specificity and Bootstrap surface tokens that track the color mode switcher.
7+
*/
8+
/* Tab row divider: keep separation line aligned with theme border color. */
9+
.sphinx-tabs [role="tablist"] {
10+
border-bottom: 1px solid var(--pst-color-border, #a0b3bf);
11+
}
12+
13+
/* Inactive tab labels: use theme link color and transparent background. */
14+
.sphinx-tabs .sphinx-tabs-tab {
15+
color: var(--pst-color-link, #1d5c87);
16+
background-color: transparent;
17+
}
18+
19+
/* Active tab: connect visually to panel and inherit theme surface/text colors. */
20+
.sphinx-tabs .sphinx-tabs-tab[aria-selected="true"] {
21+
font-weight: 700;
22+
border: 1px solid var(--pst-color-border, #a0b3bf);
23+
/* Match panel background to hide the seam between tab and panel. */
24+
border-bottom: 1px solid var(--pst-color-surface, #fff);
25+
/* Preserve sphinx-tabs geometry so the active tab overlaps panel border cleanly. */
26+
margin: -1px;
27+
background-color: var(--pst-color-surface, #fff);
28+
color: var(--pst-color-text-base, #212529);
29+
}
30+
31+
/* Tab panel container: theme-aware border/surface/text with original rounded geometry. */
32+
.sphinx-tabs .sphinx-tabs-panel {
33+
border: 1px solid var(--pst-color-border, #a0b3bf);
34+
margin: 0 -1px -1px -1px;
35+
border-radius: 0 0 5px 5px;
36+
border-top: 0;
37+
background-color: var(--pst-color-surface, #fff);
38+
color: var(--pst-color-text-base, #212529);
39+
}
40+
141
/* Make sidebar wider to accommodate our long module names. */
242
.bd-sidebar-primary {
343
flex-basis: 25%; /* default is 20% */

‎docs/sphinx/_static/switcher.json‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
[
22
{
33
"version": "latest",
4-
"url": "https://docs.nvidia.com/cuda/nvmath-python/latest"
4+
"url": "https://docs.nvidia.com/cuda/nvmath-python/latest/"
5+
},
6+
{
7+
"version": "0.9.0",
8+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.9.0/"
59
},
610
{
711
"version": "0.8.0",
8-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.8.0"
12+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.8.0/"
913
},
1014
{
1115
"version": "0.7.0",
12-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.7.0"
16+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.7.0/"
1317
},
1418
{
1519
"version": "0.6.0",
16-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.6.0"
20+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.6.0/"
1721
},
1822
{
1923
"version": "0.5.0",
20-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.5.0"
24+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.5.0/"
2125
},
2226
{
2327
"version": "0.4.0",
24-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.4.0"
28+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.4.0/"
2529
},
2630
{
2731
"version": "0.3.0",
28-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.3.0"
32+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.3.0/"
2933
},
3034
{
3135
"version": "0.2.1",
32-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.2.1"
36+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.2.1/"
3337
},
3438
{
3539
"version": "0.2.0",
36-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.2.0"
40+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.2.0/"
3741
},
3842
{
3943
"version": "0.1.0",
40-
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.1.0"
44+
"url": "https://docs.nvidia.com/cuda/nvmath-python/0.1.0/"
4145
}
4246
]
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1+
{# This template replaces the default autosummary Sphinx template
2+
3+
- The default template does not show all methods and attributes on one page.
4+
- Attributes are listed before methods
5+
- __init__ is skipped because the function signature is already shown
6+
#}
17
{{ fullname | escape | underline}}
28

39
.. currentmodule:: {{ module }}
410

511
.. autoclass:: {{ objname }}
612

7-
{% block methods %}
8-
{% if methods %}
9-
.. rubric:: {{ _('Methods') }}
13+
{% block attributes %}
14+
{% if attributes %}
15+
.. rubric:: {{ _('Attributes') }}
1016

11-
{% for item in methods %}
12-
.. automethod:: {{ item }}
17+
{% for item in attributes %}
18+
.. autoattribute:: {{ item }}
1319
{%- endfor %}
1420

1521
{% endif %}
1622
{% endblock %}
1723

18-
{% block attributes %}
19-
{% if attributes %}
20-
.. rubric:: {{ _('Attributes') }}
24+
{% block methods %}
25+
{% if methods %}
26+
.. rubric:: {{ _('Methods') }}
2127

22-
{% for item in attributes %}
23-
.. autoattribute:: {{ item }}
28+
{% for item in methods %}
29+
{% if item != '__init__' %}
30+
.. automethod:: {{ item }}
31+
{% endif %}
2432
{%- endfor %}
33+
2534
{% endif %}
2635
{% endblock %}

‎docs/sphinx/_templates/autosummary/dataclass.rst‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
.. autoclass:: {{ objname }}
66

77
{% block methods %}
8-
.. automethod:: __init__
98
{% endblock %}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{# Autosummary template for TorchUST.
2+
3+
- Only from_torch is documented because it is the primary public entry point;
4+
other inherited members are internal or covered elsewhere.
5+
#}
6+
{{ fullname | escape | underline}}
7+
8+
.. currentmodule:: {{ module }}
9+
10+
.. autoclass:: {{ objname }}
11+
:no-inherited-members:
12+
:members: from_torch

‎docs/sphinx/api_design.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
API Design and Usage Patterns
2+
*****************************
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
Stateful APIs <stateful_apis_guide.rst>
8+
Stream Semantics <stream_semantics.rst>

0 commit comments

Comments
 (0)