Skip to main content

Sparse point cloud convolution library for MLX

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 Distribution

mlx_lattice-0.1.7.tar.gz (56.1 kB view details)

Uploaded Source

Built Distributions

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

mlx_lattice-0.1.7-cp314-cp314-macosx_26_0_arm64.whl (141.0 kB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

mlx_lattice-0.1.7-cp314-cp314-macosx_15_0_arm64.whl (137.5 kB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

mlx_lattice-0.1.7-cp313-cp313-macosx_26_0_arm64.whl (141.0 kB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

mlx_lattice-0.1.7-cp313-cp313-macosx_15_0_arm64.whl (137.4 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mlx_lattice-0.1.7-cp312-cp312-macosx_26_0_arm64.whl (141.0 kB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

mlx_lattice-0.1.7-cp312-cp312-macosx_15_0_arm64.whl (137.4 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

Details for the file mlx_lattice-0.1.7.tar.gz.

File metadata

  • Download URL: mlx_lattice-0.1.7.tar.gz
  • Upload date:
  • Size: 56.1 kB
  • Tags: Source
  • 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-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a52329287bd7d05ec4aa02cdbcbaa16ebb031eab46764a2dd5762cabdc84ed8f
MD5 be82be3ccf85e3b6749f635277de4d75
BLAKE2b-256 81dd242eb9a2a5c1e8969c8d76cfcee6fdbbf0ff2a828590096a53691322f04c

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp314-cp314-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.0 kB
  • Tags: CPython 3.14, macOS 26.0+ ARM64
  • 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-0.1.7-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 82fda6f2204c558f35b5da8a9f2cd5f78dab71166e3ae634e4208dadd711d3b6
MD5 d7d15869267f9d66f3350c7650a2ebdf
BLAKE2b-256 7d7efc018bfe6fccb73da255c7362f1287d2d01ee4b52422b0d12aa7f3fac282

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp314-cp314-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.5 kB
  • Tags: CPython 3.14, macOS 15.0+ ARM64
  • 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-0.1.7-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 23627fd408057cd10ea9bc6b2b0b9d7fd6abb37ad3a3374cd0111e2dfd638b1d
MD5 b1fc456df14b19832165ad60dfbd6d74
BLAKE2b-256 ee06e5bd492c102ab78c5ec8077b3c90ad8796074d610999a14cb75b1416e0ee

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp313-cp313-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.0 kB
  • Tags: CPython 3.13, macOS 26.0+ ARM64
  • 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-0.1.7-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 d65d86f750b4c90cdb154a4bbea4bb8e9098b532456814cee4d162d40c7fd34e
MD5 64f0b0e1a524cfda9627e240182bdf18
BLAKE2b-256 e247082a9d63802f71e80227f8834212291354f4a891acbcce49af334f0d5050

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp313-cp313-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: CPython 3.13, macOS 15.0+ ARM64
  • 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-0.1.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 92ba85e223b6e442d481cb0e94c81e680d0076fef7e77bc91035a7aea10c7329
MD5 f1dc1827169ee765dc5b328b7ee6ed1d
BLAKE2b-256 542e1a4b0f3a28457798c00e4827997d470c3f3686b1271272c6e067d9a32c88

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp312-cp312-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.0 kB
  • Tags: CPython 3.12, macOS 26.0+ ARM64
  • 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-0.1.7-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 d942c7f1a8e56e72199f03e03e64880f3e7f26021f478862692022e4a98cdcc7
MD5 624fa8ac062338ad798dc31c92d7ca0e
BLAKE2b-256 84107739de21be8eed8277d22b95a9c90ba509e4ffc43efa79778b5f01d85a25

See more details on using hashes here.

File details

Details for the file mlx_lattice-0.1.7-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx_lattice-0.1.7-cp312-cp312-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: CPython 3.12, macOS 15.0+ ARM64
  • 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-0.1.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1a631414fa89ba87bf21bf41bac22ad3e3cc79bad7440811114b25d318623b90
MD5 7480ab43dd3b9e18cae019fce1b465ce
BLAKE2b-256 03fa3edeb9d3a7f88306921ed31968f2803a67b37d5e45cbca1c98a9fdcf2b85

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