Skip to main content

CUDA 13 backend for mlx-lattice

Project description

MLX Lattice

Sparse point cloud convolution library for Apple MLX.

[!CAUTION] Currently, the CUDA side is only compilable, the functionality is still not fully tested, and the only version supported here is CUDA 13.x.

[!WARNING] We're working on the proofing of math correctness between those operators in different backends. Currently, only the Metal operators have the identical math property, while the CUDA operators still need to be verified.

Operations

Currently, the following operations are supported:

  • Tensor: SparseTensor, sparse_collate, cat, prune, topk_rows
  • Coordinates: downsample, build_kernel_map, build_generative_map, build_transposed_kernel_map, union_coords, intersection_coords, lookup_coords, contains_coords, inverse_map
  • Features: linear, relu, sigmoid
  • Sparse convolution: conv3d with stride, padding, and dilation; conv_transpose3d; generative_conv_transpose3d; optional explicit kernel_map reuse
  • Sparse pooling: pool3d, max_pool3d, avg_pool3d, global_pool, global_sum_pool, global_avg_pool, global_max_pool; optional explicit kernel_map reuse for local pooling
  • Modules: Linear, Conv3d, ConvTranspose3d, GenerativeConvTranspose3d, SumPool3d, MaxPool3d, AvgPool3d, GlobalPool, GlobalSumPool, GlobalAvgPool, GlobalMaxPool, BatchNorm, ReLU, Sigmoid

Usage

import mlx.core as mx
import mlx_lattice as ml
import mlx_lattice.nn as mln

coords = mx.array(
    [[0, 0, 0, 0], [0, 1, 0, 0], [0, 2, 0, 0]],
    dtype=mx.int32,
)
feats = mx.array([[1.0, 0.0], [0.5, 1.0], [0.0, 2.0]], dtype=mx.float32)
x = ml.SparseTensor(coords, feats)

conv = mln.Conv3d(2, 8, kernel_size=3, bias=True)
pool = mln.SumPool3d(kernel_size=2, stride=2)

y = pool(conv(x))
mx.eval(y.feats)

Coordinates follow the sparse point convention (batch, x, y, z). The module weight layout follows MLX convolution modules: (out_channels, kx, ky, kz, in_channels).

Development

uv sync
uv run ruff check .
uv run ty check
uv build --wheel

The native extension is built with CMake, scikit-build-core, nanobind, and the MLX C++ backend toolchain. Metal builds are enabled on macOS; CUDA kernels are enabled on non-Apple hosts when CMake finds a CUDA compiler and toolkit.

For native editor indexing:

uv run cmake --preset clangd

Install and run hooks with:

prek install
prek run --all-files

License

Copyright © 2026 Yu

Open sourced under MIT license

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mlx_lattice_cuda13-0.1.11-cp314-cp314-manylinux_2_35_x86_64.whl (169.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.11-cp313-cp313-manylinux_2_35_x86_64.whl (169.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.11-cp312-cp312-manylinux_2_35_x86_64.whl (169.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

File details

Details for the file mlx_lattice_cuda13-0.1.11-cp314-cp314-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.11-cp314-cp314-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 169.9 kB
  • Tags: CPython 3.14, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mlx_lattice_cuda13-0.1.11-cp314-cp314-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 028688bd461c4cc7abafd10e0709cd20a34f0c4b50a5e3650c013c3f188701ac
MD5 45e5a4aac4ff0e9d63a0e40ff71b0863
BLAKE2b-256 f8b48a0b983e2ce6e5fb5fc3779b6770b8d49bb85d470ef4a0dc842bf3972b2d

See more details on using hashes here.

File details

Details for the file mlx_lattice_cuda13-0.1.11-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.11-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 169.8 kB
  • Tags: CPython 3.13, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mlx_lattice_cuda13-0.1.11-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 e0a5d1eed38c216a9181ec5f897e223122a1cc8a4267d683a9e3bc75ed66afbc
MD5 af5359b3ff74473557bbcd36230198a8
BLAKE2b-256 bd32e3dcb14122918cbbb1ac3f1b4893fb7d04d592a26980ab5f4671d861a3d4

See more details on using hashes here.

File details

Details for the file mlx_lattice_cuda13-0.1.11-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.11-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 169.9 kB
  • Tags: CPython 3.12, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mlx_lattice_cuda13-0.1.11-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 4509798283a10907089773a9eba4f9875bad5f85a185a4bf9e7707e579f6bc43
MD5 c93b0aee953a5ac053845e5ef5096671
BLAKE2b-256 7b143e1909015987dc8144d42c6de0feae491ab19dc2e6851c66e8928e61daed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page