Skip to content

Commit

Permalink
v23.03.00
Browse files Browse the repository at this point in the history
v23.03.00
  • Loading branch information
marcinz authored Mar 9, 2023
2 parents 2455b55 + 9cc2afe commit 9ac887b
Show file tree
Hide file tree
Showing 410 changed files with 4,661 additions and 2,619 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/require-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Delay checking labels if PR is just created
if: ${{ github.event.action == 'opened' }}
run: sleep 300s
shell: bash
- name: Check Labels
uses: mheap/github-action-required-labels@v2
uses: mheap/github-action-required-labels@v3
with:
mode: exactly
count: 1
labels: "category:new-feature, category:improvement, category:bug-fix, category:task"
labels: "category:new-feature, category:improvement, category:bug-fix, category:task, category:documentation"

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ core
*.bbl
*.blg
*.aux
*.json
*.dylib
legate_python
openblas
Expand All @@ -41,3 +40,4 @@ cunumeric/install_info.py
/dist
/_skbuild
/_cmake_test_compile
.ipynb_checkpoints
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991'
rev: 'v1.0.1'
hooks:
- id: mypy
language: system
pass_filenames: false
args: ['cunumeric']
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand All @@ -26,10 +26,10 @@ repos:
types_or: []
- repo: local
hooks:
- id: enforce-pytest-main
name: Enforce pytest.main
description: Make sure tests use sys.ext(pytest.main(...))
entry: python scripts/hooks/enforce_pytest_main.py
- id: enforce-boilerplate
name: Enforce boilerplate
description: Make sure tests include required boilerplate
entry: python scripts/hooks/enforce_boilerplate.py
language: python
pass_filenames: false

Expand Down
11 changes: 7 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ limitations under the License.
-->

# Basic build
(building-from-source)=
# Building from source

## Basic build

Users must have a working installation of the
[Legate Core](https://github.com/nv-legate/legate.core)
Expand All @@ -30,9 +33,9 @@ Once Legate Core is installed, you can simply invoke `./install.py` from the
cuNumeric top-level directory. The build will automatically pick up the
configuration used when building Legate Core (e.g. the CUDA Toolkit directory).

# Advanced topics
## Advanced topics

## Building through pip & cmake
### Building through pip & cmake

cuNumeric uses the same cmake/scikit-build-based build workflow as Legate Core.
See the
Expand Down Expand Up @@ -74,4 +77,4 @@ The Python source tree and CMake build tree are now available with the environme
for running cuNumeric programs. The diagram below illustrates the
complete workflow for building both Legate core and cuNumeric.

<img src="docs/figures/developer-build.png" alt="drawing" width="600"/>
<img src="https://raw.githubusercontent.com/nv-legate/cunumeric/branch-23.03/docs/figures/developer-build.png" alt="drawing" width="600"/>
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ endif()
# - Download and initialize RAPIDS CMake helpers -----------------------------

if(NOT EXISTS ${CMAKE_BINARY_DIR}/RAPIDS.cmake)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.08/RAPIDS.cmake
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.02/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
endif()
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
Expand All @@ -47,7 +47,7 @@ include(rapids-cuda)
include(rapids-export)
include(rapids-find)

set(cunumeric_version 22.12.00)
set(cunumeric_version 23.03.00)

# For now we want the optimization flags to match on both normal make and cmake
# builds so we override the cmake defaults here for release, this changes
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ that aims to provide a distributed and accelerated drop-in replacement for the
[NumPy API](https://numpy.org/doc/stable/reference/) on top of the
[Legion](https://legion.stanford.edu) runtime. Using cuNumeric you do things like run
[the final example of the Python CFD course](https://github.com/barbagroup/CFDPython/blob/master/lessons/15_Step_12.ipynb)
completely unmodified on 2048 A100 GPUs in a [DGX SuperPOD](https://github.com/barbagroup/CFDPython/blob/master/lessons/15_Step_12.ipynb) and achieve good weak scaling.
completely unmodified on 2048 A100 GPUs in a [DGX SuperPOD](https://www.nvidia.com/en-us/data-center/dgx-superpod/) and achieve good weak scaling.

<img src="docs/figures/cfd-demo.png" alt="drawing" width="500"/>

Expand All @@ -43,8 +43,12 @@ cuNumeric is available [on conda](https://anaconda.org/legate/cunumeric):
conda install -c nvidia -c conda-forge -c legate cunumeric
```

The conda package is compatible with CUDA >= 11.4 (CUDA driver version >= r470),
and Volta or later GPU architectures.
Only linux-64 packages are available at the moment.

The default package contains GPU support, and is compatible with CUDA >= 11.4
(CUDA driver version >= r470), and Volta or later GPU architectures. There are
also CPU-only packages available, and will be automatically selected by `conda`
when installing on a machine without GPUs.

See [BUILD.md](BUILD.md) for instructions on building cuNumeric from source.

Expand Down Expand Up @@ -76,8 +80,9 @@ users can supply the `--nodes` option. For execution with GPUs, users can use th
to familiarize themselves with these resource flags as described in the Legate Core
documentation or simply by passing `--help` to the `legate` driver script.

You can use `test.py` to run the test suite. This script will invoke the `legate`
driver script automatically. Check out `test.py --help` for further options.
You can use `test.py` to run the test suite. Invoke the script directly or through
standard `python`; the script will invoke the `legate` driver script internally.
Check out `test.py --help` for further options.

## Supported and Planned Features

Expand All @@ -100,8 +105,8 @@ installing legate.core with a larger `--max-dim`.

## Documentation

A complete list of available features can is provided in the [API
reference](https://nv-legate.github.io/cunumeric/api/index.html).
The cuNumeric documentation can be found
[here](https://nv-legate.github.io/cunumeric).

## Future Directions

Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/cuda_arch_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function(set_cuda_arch_from_names)
if(CMAKE_CUDA_ARCHITECTURES MATCHES "ampere")
list(APPEND cuda_archs 80)
endif()
if(CMAKE_CUDA_ARCHITECTURES MATCHES "hopper")
list(APPEND cuda_archs 90)
endif()

if(cuda_archs)
list(LENGTH cuda_archs num_archs)
Expand Down Expand Up @@ -83,6 +86,7 @@ function(add_cuda_architecture_defines defs)
add_def_if_arch_enabled("70" "VOLTA_ARCH")
add_def_if_arch_enabled("75" "TURING_ARCH")
add_def_if_arch_enabled("80" "AMPERE_ARCH")
add_def_if_arch_enabled("90" "HOPPER_ARCH")

set(${defs} ${_defs} PARENT_SCOPE)
endfunction()
53 changes: 41 additions & 12 deletions cmake/thirdparty/get_legate_core.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright 2022 NVIDIA Corporation
# Copyright 2022-2023 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,18 @@ function(find_or_configure_legate_core)
include("${rapids-cmake-dir}/export/detail/parse_version.cmake")
rapids_export_parse_version(${PKG_VERSION} legate_core PKG_VERSION)

include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(legate_core version git_repo git_branch shallow exclude_from_all)

set(version ${PKG_VERSION})
set(exclude_from_all ${PKG_EXCLUDE_FROM_ALL})
if(PKG_BRANCH)
set(git_branch "${PKG_BRANCH}")
endif()
if(PKG_REPOSITORY)
set(git_repo "${PKG_REPOSITORY}")
endif()

set(FIND_PKG_ARGS
GLOBAL_TARGETS legate::core
BUILD_EXPORT_SET cunumeric-exports
Expand All @@ -35,18 +47,24 @@ function(find_or_configure_legate_core)
if(legate_core_DIR OR legate_core_ROOT)
set(_find_mode REQUIRED)
endif()
rapids_find_package(legate_core ${PKG_VERSION} EXACT CONFIG ${_find_mode} ${FIND_PKG_ARGS})
rapids_find_package(legate_core ${version} EXACT CONFIG ${_find_mode} ${FIND_PKG_ARGS})

if(legate_core_FOUND)
message(STATUS "CPM: using local package legate_core@${PKG_VERSION}")
message(STATUS "CPM: using local package legate_core@${version}")
else()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/cpm_helpers.cmake)
get_cpm_git_args(legate_core_cpm_git_args REPOSITORY ${PKG_REPOSITORY} BRANCH ${PKG_BRANCH})
rapids_cpm_find(legate_core ${PKG_VERSION} ${FIND_PKG_ARGS}
get_cpm_git_args(legate_core_cpm_git_args REPOSITORY ${git_repo} BRANCH ${git_branch})

message(VERBOSE "cunumeric: legate.core version: ${version}")
message(VERBOSE "cunumeric: legate.core git_repo: ${git_repo}")
message(VERBOSE "cunumeric: legate.core git_branch: ${git_branch}")
message(VERBOSE "cunumeric: legate.core exclude_from_all: ${exclude_from_all}")

rapids_cpm_find(legate_core ${version} ${FIND_PKG_ARGS}
CPM_ARGS
${legate_core_cpm_git_args}
FIND_PACKAGE_ARGUMENTS EXACT
EXCLUDE_FROM_ALL ${PKG_EXCLUDE_FROM_ALL}
EXCLUDE_FROM_ALL ${exclude_from_all}
)
endif()

Expand All @@ -59,15 +77,26 @@ function(find_or_configure_legate_core)
message(VERBOSE "Legion_BOUNDS_CHECKS=${Legion_BOUNDS_CHECKS}")
endfunction()

if(NOT DEFINED cunumeric_LEGATE_CORE_BRANCH)
set(cunumeric_LEGATE_CORE_BRANCH branch-22.10)
endif()
foreach(_var IN ITEMS "cunumeric_LEGATE_CORE_VERSION"
"cunumeric_LEGATE_CORE_BRANCH"
"cunumeric_LEGATE_CORE_REPOSITORY"
"cunumeric_EXCLUDE_LEGATE_CORE_FROM_ALL")
if(DEFINED ${_var})
# Create a cunumeric_LEGATE_CORE_BRANCH variable in the current scope either from the existing
# current-scope variable, or the cache variable.
set(${_var} "${${_var}}")
# Remove cunumeric_LEGATE_CORE_BRANCH from the CMakeCache.txt. This ensures reconfiguring the same
# build dir without passing `-Dcunumeric_LEGATE_CORE_BRANCH=` reverts to the value in versions.json
# instead of reusing the previous `-Dcunumeric_LEGATE_CORE_BRANCH=` value.
unset(${_var} CACHE)
endif()
endforeach()

if(NOT DEFINED cunumeric_LEGATE_CORE_REPOSITORY)
set(cunumeric_LEGATE_CORE_REPOSITORY https://github.com/nv-legate/legate.core.git)
if(NOT DEFINED cunumeric_LEGATE_CORE_VERSION)
set(cunumeric_LEGATE_CORE_VERSION "${cunumeric_VERSION}")
endif()

find_or_configure_legate_core(VERSION ${cunumeric_VERSION}
find_or_configure_legate_core(VERSION ${cunumeric_LEGATE_CORE_VERSION}
REPOSITORY ${cunumeric_LEGATE_CORE_REPOSITORY}
BRANCH ${cunumeric_LEGATE_CORE_BRANCH}
EXCLUDE_FROM_ALL ${cunumeric_EXCLUDE_LEGATE_CORE_FROM_ALL}
Expand Down
8 changes: 8 additions & 0 deletions cmake/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages" : {
"legate_core" : {
"git_url" : "https://github.com/nv-legate/legate.core.git",
"git_tag" : "37596159b1f8f06439fdc95d6090bbc4315c302c"
}
}
}
5 changes: 3 additions & 2 deletions conda/conda-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ if [ -z "$CPU_ONLY" ]; then
# cutensor, relying on the conda cutensor package
CMAKE_ARGS+="
-Dcutensor_DIR=$PREFIX
-DCMAKE_CUDA_ARCHITECTURES:LIST=60-real;70-real;75-real;80-real;86
-DCMAKE_CUDA_ARCHITECTURES:LIST=60-real;70-real;75-real;80-real;90
-DBUILD_MARCH=haswell
"
else
# When we build without cuda, we need to provide the location of curand
Expand All @@ -32,7 +33,7 @@ export CUDAHOSTCXX=${CXX}

echo "Build starting on $(date)"

cmake -S . -B build ${CMAKE_ARGS}
cmake -S . -B build ${CMAKE_ARGS} -DCMAKE_BUILD_PARALLEL_LEVEL=$CPU_COUNT
cmake --build build -j$CPU_COUNT
cmake --install build

Expand Down
4 changes: 2 additions & 2 deletions conda/conda-build/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ gpu_enabled:
- false

python:
- 3.8
- 3.9
- "3.9,!=3.9.7"
- 3.10
- 3.11

numpy_version:
- ">=1.22"
Expand Down
6 changes: 1 addition & 5 deletions conda/conda-build/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ requirements:
# the nvcc requirement is necessary because it contains crt/host_config.h used by cuda runtime. This is a packaging bug that has been reported.
- cuda-nvcc ={{ cuda_version }}
# libcurand is used both in CPU and GPU builds
# temporarily pin curand until problems are resolved
- libcurand-dev =10.3.0.86
# the following line is only necessary for pinning curand
- libcurand =10.3.0.86
- libcurand-dev
# cudart needed for CPU and GPU builds because of curand
- cuda-cudart-dev ={{ cuda_version }}
- python
Expand Down Expand Up @@ -140,7 +137,6 @@ requirements:
{% else %}
- legate-core ={{ core_version }}
- cuda-cudart >={{ cuda_version }}
# - libcutensor >=1.3
- cutensor >=1.3 =*_*
- libcublas
- libcusolver =11.4.1.48-0
Expand Down
7 changes: 5 additions & 2 deletions cunumeric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@
"""
from __future__ import annotations

import os

import numpy as _np

from cunumeric import linalg, random, fft
from cunumeric.array import ndarray
from cunumeric.array import maybe_convert_to_np_ndarray, ndarray
from cunumeric.bits import packbits, unpackbits
from cunumeric.module import *
from cunumeric._ufunc import *
from cunumeric.logic import *
from cunumeric.window import bartlett, blackman, hamming, hanning, kaiser
from cunumeric.coverage import clone_module

clone_module(_np, globals())
clone_module(_np, globals(), maybe_convert_to_np_ndarray)

del maybe_convert_to_np_ndarray
del clone_module
del _np

Expand Down
1 change: 0 additions & 1 deletion cunumeric/_sphinxext/comparison_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@


class ComparisonTable(CunumericDirective):

has_content = False
required_arguments = 0
optional_arguments = 1
Expand Down
2 changes: 0 additions & 2 deletions cunumeric/_sphinxext/implemented_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ def _filter(x: Any) -> bool:


class ImplementedIndex(CunumericDirective):

has_content = False
required_arguments = 0
optional_arguments = 0

def run(self) -> nodes.Node:

refs: list[str] = []
for ns in namespaces:
refs += [
Expand Down
1 change: 0 additions & 1 deletion cunumeric/_sphinxext/missing_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@


class MissingRefs(SphinxPostTransform):

default_priority = 5

def run(self, **kwargs: Any) -> None:
Expand Down
1 change: 0 additions & 1 deletion cunumeric/_ufunc/ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def to_dtypes(chars: str) -> tuple[np.dtype[Any], ...]:


class ufunc:

_types: Dict[Any, str]
_nin: int
_nout: int
Expand Down
Loading

0 comments on commit 9ac887b

Please sign in to comment.