Skip to main content

remblais

remblais logo

remblais computes geometric losses between measures on NVIDIA (CUDA), AMD (ROCm/HIP) and Intel (SYCL) GPUs: Sinkhorn divergences (entropic optimal transport), kernel norms (MMD) and Hausdorff divergences between point clouds, images and volumes. It is a drop-in replacement for GeomLoss 0.3.1, built on kernox instead of PyKeOps: write import remblais as geomloss and your code runs unchanged.

Why remblais

  • Same API as GeomLoss. SamplesLoss, sinkhorn_divergence, ImagesBarycenter and the ot module have the GeomLoss 0.3.1 signatures, calling conventions and output shapes. With backend="tensorized", values and gradients match GeomLoss bit for bit, apart from the documented fixes.
  • Faster. Every softmin is one fused kernox reduction, compiled once and reused for all values of ε; the debiased Sinkhorn loop fuses its four softmins into two reductions per iteration.
  • NVIDIA, AMD and Intel GPUs. The online and multiscale backends, which GeomLoss runs through PyKeOps on NVIDIA GPUs only, run here on CUDA, ROCm/HIP and SYCL through kernox. remblais's own test suite runs on NVIDIA and Intel GPUs; on AMD GPUs it relies on kernox's tested HIP backend.
  • Fixes, not surprises. A few GeomLoss bugs are fixed (the gradient of unbalanced transport, "hausdorff" without a kernel, ...). Every difference is listed in Coming from GeomLoss.

Installation

remblais needs Python 3.10 or later, PyTorch and kernox. Install PyTorch for your platform, then kernox with the extra that matches your GPU, then remblais, both from PyPI. For an NVIDIA GPU:

pip install torch --index-url https://download.pytorch.org/whl/cu126
pip install "kernox[cuda]"
pip install remblais

For AMD and Intel GPUs, install PyTorch from the rocm or xpu index and kernox with the rocm or xpu extra. Intel GPUs also need a SYCL runtime matching the host icpx compiler, see Intel GPUs. The details are in the kernox installation guide and in Getting started.

Performance

The goal of remblais is to be at least as fast as GeomLoss wherever GeomLoss runs. In the cases measured so far, it is already faster.

Sinkhorn divergence, p = 2, FP32, forward and backward passes, on an RTX 2080 Ti; remblais with fast_math, its default setting, against GeomLoss 0.3.1 in its best configuration (each PyKeOps kernel compiled alone in a fresh process). Time ratios remblais / GeomLoss, lower than 1 when remblais is faster:

Case N = 10⁴ N = 10⁵ N = 10⁶
multiscale, D = 2 ×0.45 ×0.40 ×0.79
multiscale, D = 3 ×0.26 ×0.92 ×0.96
online, D = 2 ×0.33 ×0.84 ×0.89
online, D = 3 ×0.31 ×0.85 ×0.90
online, D = 64 ×0.45 ×0.54 not measured

For small clouds (N = 10³ to 3·10⁴), the online backend runs at ×0.31 to ×0.61 of the GeomLoss time in D = 2 and 3, and at ×0.17 to ×0.45 in D = 64.

These figures cover only the cases listed; they are not a general claim of superiority over GeomLoss on every workload or card. The full tables and the protocol are on the Performance page.

In 1781, Gaspard Monge asked how to move a pile of earth, the déblais, into a hole of the same volume, the remblais, at the lowest cost: the founding problem of optimal transport. remblais is where the mass ends up. The logo shows the ox of symox and kernox, harnessed this time to a scraper, carrying the déblais to the remblais: Monge's optimal transport.

License

At your option, MIT or Apache-2.0. Code derived from GeomLoss stays under the MIT license of GeomLoss; its provenance and notice are in THIRD_PARTY.md.

Metadata

Release files for remblais 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for remblais 2.0.0
File Size Uploaded Provenance Actions
remblais-2.0.0.tar.gz 85.4 kB With provenance Details for remblais-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for remblais 2.0.0
File Interpreter ABI Platform Actions
remblais-2.0.0-py3-none-any.whl Python 3 none any Details for remblais-2.0.0-py3-none-any.whl

Total release size: 180.0 kB

Release files / remblais-2.0.0.tar.gz

Download URL remblais-2.0.0.tar.gz
Size 85.4 kB
Tags Source
SHA-256 checksum
How to use checksums
29e4234b679156c36d462d67b56f12ad35689adf5ae02453e3734557b47d2c2b
BLAKE2b-256 checksum
How to use checksums
116645e253da408048eca47e2b90d3f316285124aaf440108929f7c62629ef94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / remblais-2.0.0-py3-none-any.whl

Download URL remblais-2.0.0-py3-none-any.whl
Size 94.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
511a526b62d8078d576ce35c5dc44f73d82891950023ae6b374eeacae7b68be8
BLAKE2b-256 checksum
How to use checksums
b0db8c281af9efd48911d75827b5b14168cb443bb2f84235a902320a2fdac7fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for remblais 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for remblais-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page