Skip to main content

CUDA 13 backend for mlx-lattice

Project description

MLX Lattice

Sparse point cloud convolution library for Apple MLX.

[!CAUTION] 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
  • Features: linear, relu, sigmoid
  • Sparse convolution: conv3d with stride, padding, and dilation; conv_transpose3d; generative_conv_transpose3d
  • Sparse pooling: pool3d, max_pool3d, avg_pool3d, global_pool, global_sum_pool, global_avg_pool, global_max_pool
  • 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.10-cp314-cp314-manylinux_2_35_x86_64.whl (171.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.10-cp313-cp313-manylinux_2_35_x86_64.whl (171.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.10-cp312-cp312-manylinux_2_35_x86_64.whl (171.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.10-cp314-cp314-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 171.8 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.10-cp314-cp314-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0bc11896f794c6ea6adfa50aed6fd5876f87a7d9810a58a4dc5860de4c7bb519
MD5 eec28eaad4bdce61fdd06848dc64d116
BLAKE2b-256 2da20a43d4acbcf5dda78bf3a57123faeb373993fd76289114474da2966bef7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.10-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 171.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.10-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c7bfb078a48450295c11364e5126567a1a154e9784cdf96651478cd912d19427
MD5 31fbd13d27a86176ac06a1721f510b51
BLAKE2b-256 eaa5a35a9996ea55ae9ad06cbbcc1cbae950c7fc483d7c3b4a91983288a9e89b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.10-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 171.8 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.10-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 336c8ce04fee217c6da126ef097f852e3589afc8e495ede3300adcd15e21aab5
MD5 46252514082a9cd0a07d3f8aa3a9277a
BLAKE2b-256 e787ed7510fe66ad2d5ffd21913658cd78627aac21bd8b05ca6d444a0dc24b9b

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