Skip to content

Commit 0a642e8

Browse files
authored
Merge pull request #392 from nv-legate/branch-22.05
Release v22.05.00
2 parents 5e0e6b3 + 3a0e83e commit 0a642e8

File tree

579 files changed

+20257
-13922
lines changed

Some content is hidden

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

579 files changed

+20257
-13922
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
fail-fast: false
7070
matrix:
7171
include:
72-
- {name: 1 CPU test, options: --cpus 1, log: cpu}
72+
- {name: 1 CPU test, options: --cpus 1 --unit, log: cpu}
7373
- {name: 2 CPUs test, options: --cpus 2, log: cpus}
7474
- {name: GPU test, options: --use cuda --gpus 1, log: gpu}
7575
- {name: 2 GPUs test, options: --use cuda --gpus 2, log: gpus}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ repos:
44
hooks:
55
- id: isort
66
- repo: https://github.com/psf/black
7-
rev: 22.1.0
7+
rev: 22.3.0
88
hooks:
99
- id: black
1010
- repo: https://github.com/PyCQA/flake8
1111
rev: 4.0.1
1212
hooks:
1313
- id: flake8
1414
- repo: https://github.com/pre-commit/mirrors-clang-format
15-
rev: 'v13.0.1' # Use the sha / tag you want to point at
15+
rev: 'v14.0.3' # Use the sha / tag you want to point at
1616
hooks:
1717
- id: clang-format
1818
files: \.(cu|cuh|h|cc|inl)$

LICENSES_bundled.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
The cuNumeric repository and source distributions bundle several libraries that are
2+
compatibly licensed. We list these here.
3+
4+
5+
Name: Cephes
6+
Files: src/cunumeric/cephes/*
7+
License: 3-clause BSD
8+
Distributed under 3-clause BSD license with permission from the author,
9+
see https://lists.debian.org/debian-legal/2004/12/msg00295.html
10+
11+
Cephes Math Library Release 2.8: June, 2000
12+
Copyright 1984, 1995, 2000 by Stephen L. Moshier
13+
14+
This software is derived from the Cephes Math Library and is
15+
incorporated herein by permission of the author.
16+
17+
All rights reserved.
18+
19+
Redistribution and use in source and binary forms, with or without
20+
modification, are permitted provided that the following conditions are met:
21+
* Redistributions of source code must retain the above copyright
22+
notice, this list of conditions and the following disclaimer.
23+
* Redistributions in binary form must reproduce the above copyright
24+
notice, this list of conditions and the following disclaimer in the
25+
documentation and/or other materials provided with the distribution.
26+
* Neither the name of the <organization> nor the
27+
names of its contributors may be used to endorse or promote products
28+
derived from this software without specific prior written permission.
29+
30+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
31+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
34+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ cuNumeric is available [on conda](https://anaconda.org/legate/cunumeric):
5353
```
5454
conda install -c nvidia -c conda-forge -c legate cunumeric
5555
```
56+
The conda package is compatible with CUDA >= 11.4 (CUDA driver version >= r470),
57+
and Volta or later GPU architectures.
5658

57-
Pre-built docker images containing all Legate libraries, as well as specialized
58-
install scripts for supported clusters are available on the
59+
Docker image build scripts, as well as specialized install scripts for
60+
supported clusters are available on the
5961
[quickstart](https://github.com/nv-legate/quickstart) repo.
6062

6163
Read on for general instructions on building cuNumeric from source.
@@ -68,17 +70,25 @@ library prior to installing cuNumeric.
6870

6971
cuNumeric requires the following:
7072

71-
- Python >= 3.7
72-
- [CUDA](https://developer.nvidia.com/cuda-downloads) >= 8.0
73+
- Python >= 3.8
74+
- [CUDA](https://developer.nvidia.com/cuda-downloads) >= 10.2
7375
- GNU Make
74-
- C++14 compatible compiler (g++, clang, or nvc++)
76+
- C++17 compatible compiler (g++, clang, or nvc++)
7577
- Fortran compiler (for building OpenBLAS; not necessary if you provide a pre-built version of OpenBLAS)
76-
- the Python packages listed in `conda/cunumeric_dev.yml`
78+
- the Python packages listed in any one of the conda environment files:
79+
- `conda/environment-test-3.8.yml`
80+
- `conda/environment-test-3.9.yml`
81+
- `conda/environment-test-3.10.yml`
7782

7883
See the [corresponding section](https://github.com/nv-legate/legate.core#dependencies)
7984
on the Legate Core instructions for help on installing the required Python packages
8085
using conda.
8186

87+
cuNumeric is tested and guaranteed to be compatible with Volta and later GPU
88+
architectures. You can use cuNumeric with Pascal GPUs as well, but there could
89+
be issues due to lack of independent thread scheduling. Please report any such
90+
issues on GitHub.
91+
8292
## Building from Source
8393

8494
Installation of cuNumeric is done with either `setup.py` for simple
@@ -92,22 +102,30 @@ python setup.py --with-core <path-to-legate-core-installation>
92102
This will build cuNumeric against the Legate Core installation and then
93103
install cuNumeric into the same location.
94104

95-
Note that after the first invocation of `setup.py` this repository will remember
96-
which Legate Core installation to use and the `--with-core` option can be
97-
omitted unless the user wants to change it.
98-
99-
Advanced users can also invoke `install.py --help` to see options for
100-
configuring cuNumeric by invoking the `install.py` script directly.
105+
If Legate Core has been installed with CUDA support, a working cuTENSOR
106+
installation must also be provided to the installation command with the
107+
`--with-cutensor` option:
108+
```
109+
python setup.py --with-core <path-to-legate-core-installation> --with-cutensor <path-to-cutensor-installation>
110+
```
101111

102-
Of particular interest to cuNumeric users will likely be the option for
103-
specifying an installation of [OpenBLAS](https://www.openblas.net/) to use.
104-
If you already have an installation of OpenBLAS on your machine you can
105-
inform the `install.py` script about its location using the `--with-openblas` flag:
112+
You can also specify an installation of [OpenBLAS](https://www.openblas.net/)
113+
to use for the build. If you already have an installation of OpenBLAS on your
114+
machine, you can inform the installation script using the `--with-openblas`
115+
option:
106116

107117
```
108-
python setup.py --with-openblas /path/to/open/blas/
118+
python setup.py --with-openblas <path-to-OpenBLAS>
109119
```
110120

121+
Advanced users can also invoke `install.py --help` to see options for
122+
configuring cuNumeric by invoking the `install.py` script directly.
123+
124+
Note that after the first invocation of `setup.py` or `install.py` this
125+
repository will remember the paths you provided with the installation options
126+
and they can be omitted in subsequent invocations unless you want to change
127+
them.
128+
111129
## Usage and Execution
112130

113131
Using cuNumeric as a replacement for NumPy is easy. Users only need
@@ -131,7 +149,7 @@ legate cunumeric_program.py
131149
```
132150

133151
For execution with multiple nodes (assuming Legate Core is installed with GASNet support)
134-
users can supply the `--nodes` flag. For execution with GPUs, users can use the
152+
users can supply the `--nodes` option. For execution with GPUs, users can use the
135153
`--gpus` flags to specify the number of GPUs to use per node. We encourage all users
136154
to familiarize themselves with these resource flags as described in the Legate Core
137155
documentation or simply by passing `--help` to the `legate` driver script.

conda/conda-build/build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
install_args=()
2+
3+
# We rely on an environment variable to determine if we need to build cpu-only bits
4+
if [ -z "$CPU_ONLY" ]; then
5+
# cutensor, relying on the conda cutensor package
6+
install_args+=("--with-cutensor" "$PREFIX")
7+
fi
8+
9+
# location of legate-core
10+
install_args+=("--with-core" "$PREFIX")
11+
12+
# location of openblas, relying on the conda openblas package
13+
install_args+=("--with-openblas" "$PREFIX")
14+
15+
# Verbose mode
16+
install_args+=("-v")
17+
18+
# Move the stub library into the lib package to make the install think it's pointing at a live installation
19+
if [ -z "$CPU_ONLY" ]; then
20+
cp $PREFIX/lib/stubs/libcuda.so $PREFIX/lib/libcuda.so
21+
ln -s $PREFIX/lib $PREFIX/lib64
22+
fi
23+
24+
echo "Install command: $PYTHON install.py ${install_args[@]}"
25+
$PYTHON install.py "${install_args[@]}"
26+
27+
# Remove the stub library and linking
28+
if [ -z "$CPU_ONLY" ]; then
29+
rm $PREFIX/lib/libcuda.so
30+
rm $PREFIX/lib64
31+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gpu_enabled:
2+
- true
3+
- false
4+
python:
5+
- 3.8
6+
- 3.9
7+
- 3.10

conda/conda-build/meta.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{% set name = "cunumeric" %}
2+
{% if gpu_enabled == "true" %}
3+
{% set gpu_enabled_bool = true %}
4+
{% elif gpu_enabled == "false" %}
5+
{% set gpu_enabled_bool = false %}
6+
{% else %}
7+
{# We need to have a default value for the initial pass over the recipe #}
8+
{% set gpu_enabled_bool = false %}
9+
{% endif %}
10+
## The placeholder version is strictly for making two-pass conda build process.
11+
## It should not be used for any other purpose, and this is not a default version.
12+
{% set placeholder_version = '0.0.0.dev' %}
13+
{% set default_cuda_version = '11.5' %}
14+
{% set cuda_version='.'.join(environ.get('CUDA', default_cuda_version).split('.')[:2]) %}
15+
{% set cuda_major=cuda_version.split('.')[0] %}
16+
{% set py_version=environ.get('CONDA_PY', '') %}
17+
{% if build_number is defined %}
18+
{# do nothing if defined #}
19+
{% else %}
20+
{% set build_number = environ.get('GIT_DESCRIBE_NUMBER', '0') %}
21+
{% endif %}
22+
{% if package_version is defined %}
23+
{% set version = package_version %}
24+
{% set core_version = version %}
25+
## The tag must be in one of the two formats (where N is a digit):
26+
## vNN.NN.NN
27+
## vNN.NN.NN.dev
28+
29+
## Note: default values are only given to make conda build work. They should not be necessary in principle.
30+
{% elif 'dev' in environ.get('GIT_DESCRIBE_TAG', placeholder_version) %}
31+
{% set version = (environ.get('GIT_DESCRIBE_TAG', placeholder_version) ~ environ.get('GIT_DESCRIBE_NUMBER', '')).lstrip('v') %}
32+
{% set core_version = (version.rsplit('.',1)[0] ~ ".dev" ~ "|>=" ~ version.rsplit('.',1)[0]) %}
33+
{% else %}
34+
{% set version = environ.get('GIT_DESCRIBE_TAG', placeholder_version).lstrip('v') %}
35+
{% set core_version = version %}
36+
{% endif %}
37+
38+
package:
39+
name: {{ name|lower }}
40+
version: {{ version }}
41+
42+
source:
43+
{% if package_tar is defined %}
44+
url: {{ package_tar }}
45+
{% else %}
46+
git_url: ../../
47+
{% endif %}
48+
49+
build:
50+
skip: true # [not linux]
51+
number: {{ build_number }}
52+
missing_dso_whitelist:
53+
- '*libcuda.so*'
54+
{% if not gpu_enabled_bool %}
55+
string: "cuda{{ cuda_major }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ PKG_BUILDNUM }}_cpu"
56+
{% else %}
57+
string: "cuda{{ cuda_major }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ PKG_BUILDNUM }}"
58+
{% endif %}
59+
{% if not gpu_enabled_bool %}
60+
track_features:
61+
- cpu_only
62+
script_env:
63+
- CPU_ONLY=1
64+
{% endif %}
65+
66+
requirements:
67+
build:
68+
- {{ compiler('c') }}
69+
- {{ compiler('cxx') }}
70+
- make
71+
{% if gpu_enabled_bool %}
72+
- cuda-nvcc ={{ cuda_version }}
73+
{% endif %}
74+
host:
75+
- python
76+
- openblas =* =*openmp*
77+
{% if not gpu_enabled_bool %}
78+
- legate-core >={{ core_version }} =*_cpu
79+
{% else %}
80+
- legate-core >={{ core_version }}
81+
- cuda-driver-dev ={{ cuda_version }}
82+
- cuda-cudart-dev ={{ cuda_version }}
83+
# - libcutensor-dev >=1.3
84+
- cutensor >=1.3
85+
- cuda-nvtx
86+
- libcublas-dev
87+
- libcusolver-dev
88+
- libcufft-dev
89+
- nccl
90+
{% endif %}
91+
92+
run:
93+
- numpy
94+
- libopenblas =* =*openmp*
95+
{% if gpu_enabled_bool %}
96+
# - libcutensor >=1.3
97+
- cutensor >=1.3
98+
- libcublas
99+
- libcusolver
100+
- libcufft
101+
{% endif %}
102+
- opt_einsum >=3.3
103+
- scipy
104+
- typing_extensions
105+
106+
run_constrained:
107+
{% if gpu_enabled_bool %}
108+
- __cuda >=11.4
109+
{% endif %}
110+
- __glibc >=2.17 # [linux]
111+
112+
about:
113+
home: https://github.com/nv-legate/cunumeric
114+
license: Apache-2.0
115+
license_file: LICENSE
116+
summary: 'Drop-in Replacment for NumPy'
117+
description: |
118+
cuNumeric is a Legate library that aims to provide
119+
a distributed and accelerated drop-in replacement
120+
for the NumPy API on top of the Legion runtime.
121+
doc_url: https://github.com/nv-legate/cunumeric
122+
dev_url: https://github.com/nv-legate/cunumeric
123+
124+
extra:
125+
recipe-maintainers:
126+
- m3vaz

conda/cunumeric_dev.yml

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

conda/environment-test-3.10.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: cunumeric-test
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.10
7+
8+
# build
9+
- cutensor>=1.3.3
10+
- nccl
11+
- setuptools>=60
12+
13+
# runtime
14+
- cffi
15+
- numpy>=1.22
16+
- opt_einsum
17+
- pyarrow>=5
18+
- scipy
19+
- typing_extensions
20+
21+
# tests
22+
- clang>=8
23+
- clang-tools>=8
24+
- coverage
25+
- mock
26+
- mypy>=0.942
27+
- pre-commit
28+
- pynvml
29+
- pytest
30+
- pytest-cov
31+
32+
# pip dependencies
33+
- pip
34+
- pip:
35+
# docs
36+
- jinja2
37+
- pydata-sphinx-theme
38+
- recommonmark
39+
- sphinx>=4.4.0
40+
- sphinx-copybutton
41+
- sphinx-markdown-tables
42+
43+
# examples
44+
- tifffile

0 commit comments

Comments
 (0)