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.9-cp314-cp314-manylinux_2_35_x86_64.whl (167.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.9-cp313-cp313-manylinux_2_35_x86_64.whl (167.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx_lattice_cuda13-0.1.9-cp312-cp312-manylinux_2_35_x86_64.whl (167.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.9-cp314-cp314-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 167.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.9-cp314-cp314-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c9399478a285b85c02586d8a67452a7120721cae3db90717a84f7d1b7aa55637
MD5 b273049fa32a33d7acacd835072f2cb8
BLAKE2b-256 a8704e04cfeac789826a225ef8fac27816a4a2eb6b1962f0d6ed352278a6ba1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.9-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 167.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.9-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 aaf199baa5173db07fa7ae54e873dd56800ad269f2aeb38c7aa30bace9130add
MD5 f56ba630dc40df724104ab4049c3a7d1
BLAKE2b-256 a83873c029a7a3108cc638921c865dc8fe7ab5cbafc92b6bbf67ed664fa60c56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice_cuda13-0.1.9-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 167.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.9-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 5569fd87061c03d55bff0323c16683e2523f4512310d742c660c13bdd07de621
MD5 cf25b8ca636aceb8dc20ad5eb3f1f9a3
BLAKE2b-256 4c658b89f153299a48feade5f4fbc7d949d18e701a8bf8077958b4b1792cd36e

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