Skip to content

Commit 1da0585

Browse files
committed
Merge branch 'docker_january_2025' into checkhealth
2 parents 85e0a16 + 745083b commit 1da0585

File tree

10 files changed

+58
-34
lines changed

10 files changed

+58
-34
lines changed

.cirrus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ task:
1313
name: Tests (macOS)
1414
macos_instance:
1515
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
16+
1617
script:
1718
- brew install libomp
1819
- brew install [email protected]
@@ -21,3 +22,4 @@ task:
2122
- pip install --upgrade pip
2223
- sh ./pytest.sh
2324

25+

.github/workflows/cuda_test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Launch test on a cuda machine
2+
name: Cuda test
3+
4+
on:
5+
push
6+
7+
jobs:
8+
test:
9+
runs-on: self-hosted
10+
steps:
11+
- name: Clone Repository
12+
uses: actions/checkout@v2
13+
- name: Test with pytest
14+
run: |
15+
sh ./pytest.sh

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# --tag getkeops/keops:2.1-geomloss0.2.5-cuda11.3-pytorch1.11-full \
1616
# --no-cache .
1717

18+
ARG NUMPY_VERSION=1.26.4
19+
1820
# KeOps version - the most important parameter:
1921
ARG KEOPS_VERSION=2.2
2022
# We also include all the libraries hosted on www.kernel-operations.io,
@@ -26,7 +28,7 @@ ARG GEOMLOSS_VERSION=0.2.5
2628

2729

2830
# Base OS:
29-
ARG BASE_IMAGE=ubuntu:22.04
31+
ARG BASE_IMAGE=ubuntu:24.04
3032
# Useful to test support across Python versions:
3133
ARG PYTHON_VERSION=3.10
3234

@@ -113,7 +115,7 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
113115
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} \
114116
conda-build \
115117
pyyaml \
116-
numpy \
118+
numpy=${NUMPY_VERSION} \
117119
ipython \
118120
matplotlib \
119121
ipykernel && \
@@ -188,11 +190,13 @@ RUN /opt/conda/bin/pip install -r doc-requirements.txt
188190

189191

190192
# Super-full environment with optional dependencies:
191-
FROM keops-doc as keops-full
193+
FROM keops-doc AS keops-full
192194
# PyTorch-scatter is a complex dependency:
193195
# it relies on binaries that often lag behind new PyTorch releases
194196
# by a few days/weeks.
195197
ARG PYTORCH_SCATTER_VERSION
196-
RUN /opt/conda/bin/conda install -y -c pyg \
197-
pytorch-scatter==${PYTORCH_SCATTER_VERSION} && \
198-
/opt/conda/bin/conda clean -ya
198+
RUN /opt/conda/bin/pip install torch-scatter -f ${PYTORCH_SCATTER_VERSION}
199+
200+
#RUN /opt/conda/bin/conda install -y -c pyg \
201+
# pytorch-scatter==${PYTORCH_SCATTER_VERSION} && \
202+
# /opt/conda/bin/conda clean -ya

docker-images.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@
55
# to clear the docker cache and make sure that the config works
66
# with the current version of e.g. the Ubuntu repositories.
77

8-
# Up to date as of Monday, Feb. 12th, 2024:
9-
PYTHON_VERSION=3.11
10-
KEOPS_VERSION=2.2.2
8+
# Up to date as of Monday, Jan. 7th, 2025:
9+
PYTHON_VERSION=3.12
10+
NUMPY_VERSION=2.2.1
11+
KEOPS_VERSION=2.2.3
1112
GEOMLOSS_VERSION=0.2.6
12-
CUDA_VERSION=12.1
13-
CUDA_CHANNEL=nvidia/label/cuda-12.1.1
14-
PYTORCH_VERSION=2.2.0
15-
TORCHVISION_VERSION=0.17.0
16-
TORCHAUDIO_VERSION=2.2.0
17-
PYTORCH_SCATTER_VERSION=2.1.2
18-
PYTEST_VERSION=8.0.0
19-
HYPOTHESIS_VERSION=6.98.4
20-
JAXTYPING_VERSION=0.2.25
21-
BEARTYPE_VERSION=0.17.1
22-
BLACK_VERSION=24.1.1
13+
CUDA_VERSION=12.4
14+
CUDA_CHANNEL=nvidia/label/cuda-12.4.1
15+
PYTORCH_VERSION=2.5.1
16+
TORCHVISION_VERSION=0.20.1
17+
TORCHAUDIO_VERSION=2.5.1
18+
PYTORCH_SCATTER_VERSION=https://data.pyg.org/whl/torch-2.5.1+cu124.html
19+
PYTEST_VERSION=8.3.4
20+
HYPOTHESIS_VERSION=6.123.7
21+
JAXTYPING_VERSION=0.2.36
22+
BEARTYPE_VERSION=0.19.0
23+
BLACK_VERSION=24.10.0
2324

2425
VERSION_TAG=${KEOPS_VERSION}-geomloss${GEOMLOSS_VERSION}-cuda${CUDA_VERSION}-pytorch${PYTORCH_VERSION}-python${PYTHON_VERSION}
2526

@@ -28,6 +29,7 @@ do
2829
docker build \
2930
--target ${TARGET} \
3031
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \
32+
--build-arg NUMPY_VERSION=${NUMPY_VERSION} \
3133
--build-arg KEOPS_VERSION=${KEOPS_VERSION} \
3234
--build-arg GEOMLOSS_VERSION=${GEOMLOSS_VERSION} \
3335
--build-arg CUDA_VERSION=${CUDA_VERSION} \

keopscore/keopscore/binders/nvrtc/keops_nvrtc.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,13 +635,18 @@ template <typename TYPE> class KeOps_module {
635635

636636
if (RR.tagRanges == 1) {
637637
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)lookup_d));
638+
// slices_x_d and ranges_y_d are always allocated in range_preprocess_from_host
639+
// if RR.tagRanges == 1, regardless of nbatchdims. So we always free them
640+
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)slices_x_d));
641+
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)ranges_y_d));
642+
643+
// offsets_d is only allocated if nbatchdims > 0, so free it with condition
638644
if (SS.nbatchdims > 0) {
639-
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)slices_x_d));
640-
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)ranges_y_d));
641-
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)offsets_d));
645+
CUDA_SAFE_CALL(cuMemFree((CUdeviceptr)offsets_d));
642646
}
643647
}
644648

649+
645650
// end_ = end = clock();
646651
////std::cout << " time for last part : " << double(//end_ - start_) /
647652
/// CLOCKS_PER_SEC << std::endl; /std::cout << "time for launch_keops inner

pykeops/pykeops/benchmarks/benchmark_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,15 @@ def bench_config(
340340

341341
except (TimeoutError, IndexError): # Thrown by Nloops.pop(0) if Nloops = []
342342
print("** Too slow!")
343-
not_recorded_times = (len(problem_sizes) - len(times)) * [np.Infinity]
343+
not_recorded_times = (len(problem_sizes) - len(times)) * [np.inf]
344344

345345
except NotImplementedError:
346346
print("** This metric is not supported!")
347-
not_recorded_times = (len(problem_sizes) - len(times)) * [np.Infinity]
347+
not_recorded_times = (len(problem_sizes) - len(times)) * [np.inf]
348348

349349
except ValueError as err:
350350
print(err)
351-
not_recorded_times = (len(problem_sizes) - len(times)) * [np.NINF]
351+
not_recorded_times = (len(problem_sizes) - len(times)) * [-np.inf]
352352

353353
except RuntimeError as err:
354354
print(err)

pykeops/pykeops/benchmarks/plot_benchmark_invkernel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
from scipy.sparse import diags
3939
from scipy.sparse.linalg import aslinearoperator, cg
40-
from scipy.sparse.linalg.interface import IdentityOperator
4140

4241
from pykeops.numpy import KernelSolve as KernelSolve_np, LazyTensor
4342
from pykeops.torch import KernelSolve

pykeops/pykeops/examples/numpy/plot_test_invkernel_numpy_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767

6868
from scipy.sparse import diags
6969
from scipy.sparse.linalg import aslinearoperator, cg
70-
from scipy.sparse.linalg.interface import IdentityOperator
7170

7271
print("Solving a Gaussian linear system, with {} points in dimension {}.".format(N, D))
7372
start = time.time()

pykeops/pykeops/tutorials/backends/plot_scipy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@
154154
# L_{\text{norm}}= \text{Id} - \text{diag}(D^{-1/2}) K \text{diag}(D^{-1/2}).
155155

156156

157-
from scipy.sparse.linalg.interface import IdentityOperator
158-
159157
D_2 = aslinearoperator(diags(1 / np.sqrt(D)))
160-
L_norm = IdentityOperator((N, N)) - D_2 @ K @ D_2
158+
L_norm = aslinearoperator(diags(np.ones_like(D))) - D_2 @ K @ D_2
161159
L_norm.dtype = np.dtype(
162160
dtype
163161
) # Scipy Bugfix: by default, "-" removes the dtype information...
@@ -373,7 +371,7 @@
373371

374372
D = K @ np.ones(N, dtype=dtype) # Sum along the lines of the adjacency matrix
375373
D_2 = aslinearoperator(diags(1 / np.sqrt(D)))
376-
L_norm = IdentityOperator((N, N)) - D_2 @ K @ D_2
374+
L_norm = aslinearoperator(diags(np.ones_like(D))) - D_2 @ K @ D_2
377375
L_norm.dtype = np.dtype(
378376
dtype
379377
) # Scipy Bugfix: by default, "-" removes the dtype information...

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<!-- [![Build status](https://ci.inria.fr/keops/buildStatus/icon?job=keops%2Fmain)](https://ci.inria.fr/keops/job/keops/job/main/) -->
66
[![PyPI version](https://img.shields.io/pypi/v/pykeops?color=blue)](https://pypi.org/project/pykeops/)
77
[![PyPI downloads](https://pepy.tech/badge/pykeops?color=green)](https://pypi.org/project/pykeops/)
8-
[![CRAN version](https://img.shields.io/cran/v/rkeops?color=yellowgreen)](https://cran.r-project.org/web/packages/rkeops/index.html)
9-
[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/rkeops?color=yellowgreen)](https://cran.r-project.org/web/packages/rkeops/index.html)
8+
<!-- [![CRAN version](https://img.shields.io/cran/v/rkeops?color=yellowgreen)](https://cran.r-project.org/web/packages/rkeops/index.html) -->
9+
<!-- [![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/rkeops?color=yellowgreen)](https://cran.r-project.org/web/packages/rkeops/index.html) -->
1010

1111

1212
Please visit our [website](https://www.kernel-operations.io/) for

0 commit comments

Comments
 (0)