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.9.tar.gz (62.4 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.9-cp314-cp314-manylinux_2_35_x86_64.whl (124.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.35+ x86-64

mlx_lattice-0.1.9-cp314-cp314-macosx_26_0_arm64.whl (141.2 kB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

mlx_lattice-0.1.9-cp314-cp314-macosx_15_0_arm64.whl (137.7 kB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

mlx_lattice-0.1.9-cp313-cp313-manylinux_2_35_x86_64.whl (124.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx_lattice-0.1.9-cp313-cp313-macosx_26_0_arm64.whl (141.2 kB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

mlx_lattice-0.1.9-cp313-cp313-macosx_15_0_arm64.whl (137.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mlx_lattice-0.1.9-cp312-cp312-manylinux_2_35_x86_64.whl (124.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

mlx_lattice-0.1.9-cp312-cp312-macosx_26_0_arm64.whl (141.2 kB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

mlx_lattice-0.1.9-cp312-cp312-macosx_15_0_arm64.whl (137.6 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9.tar.gz
  • Upload date:
  • Size: 62.4 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.9.tar.gz
Algorithm Hash digest
SHA256 89e4e3596558240b26b7df78c6efd2b58c9ad92e87a45d150ea78f15653279a8
MD5 00acfb45480283bbd189c292dd45cc10
BLAKE2b-256 44e00916709350c69545534204d99a3eb8c52019ba06bff7a4e7a8fcf518e2ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp314-cp314-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 124.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-0.1.9-cp314-cp314-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2dd8f388c7e57042ebb3fb38ef8ee5328feae3cd5c0555e965ff2555b315f0e0
MD5 aeab501ba89f6b0a9cce4f88313586b1
BLAKE2b-256 1ca86b9d6e04bb8456f85ce01cc1ae6e34bef61539ad359bfbcf8835f67736c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp314-cp314-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.2 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.9-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 45027b83f333ddc146794d6775e884230a810abf3adcdc53392a8ee74fbef419
MD5 2088421eb8584da69a4e5767a17b9e4e
BLAKE2b-256 013a14c7c0405dab28933aee72f218b8f27d6abc1907740f04c01afb8ccb0a40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp314-cp314-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.7 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.9-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 69c788d8303d50a5116af3e4740f33e9e0f1df5def432c9042818aeb2dd6bd2e
MD5 79f68076cb49f2b6fed072805ba2591c
BLAKE2b-256 40e8dfc9a8f273f86343d5f71a0b7649882554fc83269806e7f51cce6c100ad4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 124.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-0.1.9-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 415f328f4fb2b963d9d39d95dfe4fce8bd2f57f2117f8c1284f4a70d7f079fd9
MD5 a81e1f4df36e07026e7a8a50b878b399
BLAKE2b-256 9c3dc9cca64aad98f025a418fb7643fedc44e2ef5cb6e8b573ce92caa4744979

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp313-cp313-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.2 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.9-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 65efa514133e13b670483fa103baec14ea3850624f78c2786424d2f614128b01
MD5 eb1a4014cd8f81e6700dd4919ab3e3ad
BLAKE2b-256 d76e235cdbedc4b74a4ac693dd52c6cfecd1e0508fda850dffcd207d9febd13e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp313-cp313-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.6 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.9-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7069035b9bc03b92c3a2ee3170d8a9b621bc4ea397ce128a9f54c62ff405bd16
MD5 6cfedadf59585b58ab400f409d134fdb
BLAKE2b-256 729a5b3b7b2d634b45cdb4def54ba3afa6d3d18f1c52b594ffc280f91a60d7f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 124.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-0.1.9-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8017410dba0352c2ee5b0cbda2c068408e9b1c01d18c2ce5bed8ecb2135e7b1f
MD5 091c765ee88bbb9a20c054056b928e47
BLAKE2b-256 6c94d7b562f27bafba275153c171ebf2bf4f7c7dd984a98a17d8930d473300ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp312-cp312-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 141.2 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.9-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 b89ef8de51e2cda09802d3be964ad595e9edcbbaf40d48ecbe4ef25a98d22436
MD5 03ddd1dee4fe02a4cf380f222d508da7
BLAKE2b-256 ebbb93ee670ecac2b65b0b84d957ad9ec3449efdc9f79aab15823c6af1bf7555

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlx_lattice-0.1.9-cp312-cp312-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 137.6 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.9-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d56c1e707af305d045a0d3f0a1ea7d60acdfae9a81e4b3be3edf5c43165393c2
MD5 5020eaadb645a1a825944f3c5410bbaf
BLAKE2b-256 9a4ee5108e891e11d0c2b8c3babf95bebe80cf5b5bd3f10f81990165cb670589

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