Skip to content

Commit b0d0075

Browse files
merge/resolve
2 parents 623772f + a6ee40e commit b0d0075

File tree

139 files changed

+6385
-2241
lines changed

Some content is hidden

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

139 files changed

+6385
-2241
lines changed

.github/workflows/conda-python-tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ jobs:
113113
- name: Setup proxy cache
114114
uses: nv-gha-runners/setup-proxy-cache@main
115115
continue-on-error: true
116+
- name: Compute pixi environment name
117+
run: |
118+
set -euo pipefail
119+
PIXI_ENV="cu-$(cut -d. -f1-2 <<< "${{ matrix.CUDA_VER }}" | tr . -)"
120+
echo "PIXI_ENV=${PIXI_ENV}" >> "${GITHUB_ENV}"
121+
- name: Setup pixi
122+
uses: prefix-dev/setup-pixi@fef5c9568ca6c4ff7707bf840ab0692ba3f08293
123+
with:
124+
environments: ${{ env.PIXI_ENV }}
116125
- name: Python tests
117126
run: ${{ inputs.script }}
118127
env:

.github/workflows/pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- "pull-request/[0-9]+"
10+
- "main"
1011

1112
concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}

.github/workflows/simulator-test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ jobs:
101101
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
102102
- name: Setup proxy cache
103103
uses: nv-gha-runners/setup-proxy-cache@main
104+
- name: Compute pixi environment name
105+
run: |
106+
set -euo pipefail
107+
PIXI_ENV="cu-$(cut -d. -f1-2 <<< "${{ matrix.CUDA_VER }}" | tr . -)"
108+
echo "PIXI_ENV=${PIXI_ENV}" >> "${GITHUB_ENV}"
109+
- name: Setup pixi
110+
uses: prefix-dev/setup-pixi@fef5c9568ca6c4ff7707bf840ab0692ba3f08293
111+
with:
112+
environments: ${{ env.PIXI_ENV }}
104113
- name: Python tests
105114
run: ${{ inputs.script }}
106115
env:

ci/test_conda.sh

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44

55
set -euo pipefail
66

7-
. /opt/conda/etc/profile.d/conda.sh
8-
9-
CTK_PACKAGE_DEPENDENCIES=(
10-
"cuda-cccl"
11-
"cuda-nvcc-impl"
12-
"cuda-nvrtc"
13-
"libcurand-dev"
14-
"cuda-cuobjdump"
15-
)
16-
177
DISTRO=`cat /etc/os-release | grep "^ID=" | awk 'BEGIN {FS="="} { print $2 }'`
188

199
if [ "$DISTRO" = "ubuntu" ]; then
@@ -22,67 +12,30 @@ if [ "$DISTRO" = "ubuntu" ]; then
2212
apt remove --purge `dpkg --get-selections | grep cuda-nvrtc | awk '{print $1}'` -y
2313
fi
2414

25-
rapids-logger "Install testing dependencies"
26-
# TODO: Replace with rapids-dependency-file-generator
27-
DEPENDENCIES=(
28-
"c-compiler"
29-
"cxx-compiler"
30-
"${CTK_PACKAGE_DEPENDENCIES[@]}"
31-
"cuda-python"
32-
"cuda-version=${CUDA_VER%.*}"
33-
"make"
34-
"numba-cuda"
35-
"psutil"
36-
"pytest"
37-
"pytest-xdist"
38-
"pytest-benchmark"
39-
"cffi"
40-
"ml_dtypes"
41-
"python=${RAPIDS_PY_VERSION}"
42-
)
4315
# Constrain oldest supported dependencies for testing
4416
if [ "${RAPIDS_DEPENDENCIES:-}" = "oldest" ]; then
45-
DEPENDENCIES+=("numba==0.60.0")
17+
# add to the default environment's dependencies
18+
pixi add "numba=0.60.0"
4619
fi
4720

48-
rapids-mamba-retry create \
49-
-n test \
50-
--strict-channel-priority \
51-
--channel "`pwd`/conda-repo" \
52-
--channel conda-forge \
53-
"${DEPENDENCIES[@]}"
54-
55-
# Temporarily allow unbound variables for conda activation.
56-
set +u
57-
conda activate test
58-
set -u
59-
60-
pip install filecheck
61-
62-
rapids-print-env
63-
6421
rapids-logger "Check GPU usage"
6522
nvidia-smi
6623

67-
rapids-logger "Build test binaries"
68-
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
69-
pushd $NUMBA_CUDA_TEST_BIN_DIR
70-
make -j $(nproc)
71-
72-
rapids-logger "Show Numba system info"
73-
python -m numba --sysinfo
74-
7524
EXITCODE=0
7625
trap "EXITCODE=1" ERR
7726
set +e
7827

28+
rapids-logger "Show Numba system info"
29+
pixi run -e "${PIXI_ENV}" python -m numba --sysinfo
30+
7931
rapids-logger "Test importing numba.cuda"
80-
python -c "from numba import cuda"
32+
pixi run -e "${PIXI_ENV}" python -c "from numba import cuda"
8133

8234
rapids-logger "Run Tests"
83-
pytest -v
84-
85-
popd
35+
pixi run -e "${PIXI_ENV}" test -n auto \
36+
--dist loadscope \
37+
--loadscope-reorder \
38+
-v
8639

8740
rapids-logger "Test script exiting with value: $EXITCODE"
8841
exit ${EXITCODE}

ci/test_simulator.sh

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,21 @@
44

55
set -euo pipefail
66

7-
. /opt/conda/etc/profile.d/conda.sh
8-
9-
rapids-logger "Install testing dependencies"
10-
# TODO: Replace with rapids-dependency-file-generator
11-
DEPENDENCIES=(
12-
"psutil"
13-
"pytest"
14-
"pytest-xdist"
15-
"pytest-benchmark"
16-
"cffi"
17-
"ml_dtypes"
18-
"python=${RAPIDS_PY_VERSION}"
19-
"numba-cuda"
20-
)
21-
rapids-mamba-retry create \
22-
-n test \
23-
--strict-channel-priority \
24-
--channel "`pwd`/conda-repo" \
25-
--channel conda-forge \
26-
"${DEPENDENCIES[@]}"
27-
28-
# Temporarily allow unbound variables for conda activation.
29-
set +u
30-
conda activate test
31-
set -u
32-
33-
pip install filecheck
34-
35-
rapids-print-env
36-
37-
# The simulator doesn't actually use the test binaries, but we move into the
38-
# test binaries folder so that we're not in the root of the repo, and therefore
39-
# numba-cuda code from the installed package will be tested, instead of the
40-
# code in the source repo.
41-
rapids-logger "Move to test binaries folder"
42-
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
43-
pushd $NUMBA_CUDA_TEST_BIN_DIR
44-
45-
rapids-logger "Show Numba system info"
46-
python -m numba --sysinfo
47-
487
EXITCODE=0
498
trap "EXITCODE=1" ERR
509
set +e
5110

52-
rapids-logger "Run Tests"
53-
export NUMBA_ENABLE_CUDASIM=1
54-
pytest -v
11+
rapids-logger "Show Numba system info"
12+
pixi run -e "${PIXI_ENV}" python -m numba --sysinfo
13+
14+
rapids-logger "Test importing numba.cuda"
15+
pixi run -e "${PIXI_ENV}" python -c "from numba import cuda"
5516

56-
popd
17+
rapids-logger "Run Tests"
18+
pixi run -e "${PIXI_ENV}" simtest -n auto \
19+
--dist loadscope \
20+
--loadscope-reorder \
21+
-v
5722

5823
rapids-logger "Test script exiting with value: $EXITCODE"
5924
exit ${EXITCODE}

docs/source/user/cudapysupported.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ The following functions from the :mod:`math` module are supported:
225225
* :func:`math.log2`
226226
* :func:`math.log10`
227227
* :func:`math.log1p`
228+
* :func:`math.nextafter` (Excluding the ``steps`` keyword argument)
228229
* :func:`math.sqrt`
229230
* :func:`math.remainder`
230231
* :func:`math.pow`

numba_cuda/numba/cuda/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
import warnings
88
import sys
99

10+
1011
# Re-export types itself
1112
import numba.cuda.types as types
1213

1314
# Re-export all type names
1415
from numba.cuda.types import *
1516

17+
HAS_NUMBA = importlib.util.find_spec("numba") is not None
1618

1719
# Require NVIDIA CUDA bindings at import time
1820
if not (

numba_cuda/numba/cuda/_internal/cuda_bf16.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
uint64,
6161
void,
6262
)
63-
from numba.cuda.ext_types import bfloat16
63+
from numba.cuda.types.ext_types import bfloat16
6464

6565
float32x2 = vector_types["float32x2"]
6666
__half = float16

numba_cuda/numba/cuda/cg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from numba.cuda.typing import signature
77
from numba.cuda import nvvmutils
88
from numba.cuda.extending import intrinsic
9-
from numba.cuda.ext_types import grid_group, GridGroup as GridGroupClass
9+
from numba.cuda.types.ext_types import grid_group, GridGroup as GridGroupClass
1010

1111

1212
class GridGroup:

numba_cuda/numba/cuda/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from numba.cuda.core import bytecode
1111
from numba.cuda import types
1212
from numba.cuda.core.options import ParallelOptions
13-
from numba.core.compiler_lock import global_compiler_lock
13+
from numba.cuda.core.compiler_lock import global_compiler_lock
1414
from numba.cuda.core.errors import NumbaWarning, NumbaInvalidConfigWarning
1515
from numba.cuda.core.interpreter import Interpreter
1616

@@ -446,7 +446,7 @@ def run_pass(self, state):
446446
@register_pass(mutates_CFG=True, analysis_only=False)
447447
class CUDANativeLowering(BaseNativeLowering):
448448
"""Lowering pass for a CUDA native function IR described solely in terms of
449-
Numba's standard `numba.core.ir` nodes."""
449+
Numba's standard `numba.cuda.core.ir` nodes."""
450450

451451
_name = "cuda_native_lowering"
452452

0 commit comments

Comments
 (0)