Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

mlx-cluster

Latest version: v0.1.4

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: kheims, vinayp
7 Stars
0 Forks
5 Versions
1.3K Downloads
C++ Repo language

Scan summary

mlx-cluster was last scanned on 23 Nov 2026 at version 0.1.4. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions; the latest 2 were published within 2 days (22 and 23 Nov 2026).
  • Findings: No rules fired in version 0.1.4.
  • Downloads: 1,274 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.4 LATEST 23 Nov 2026 No rules fired
0.1.3 22 Nov 2026 No rules fired
0.1.2 15 Nov 2026 No rules fired
0.1.1 9 Nov 2026 Not shown
0.1.0 30 Oct 2026 Not shown

No rules fired in 0.1.4

Findings

Findings for v0.1.4. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.4; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

MLX-Cluster

High-performance graph algorithms optimized for Apple's MLX framework, featuring random walks, biased random walks, neighbor sampling, and fused sparse × dense matrix multiplication (SpMM) for GNN message passing.

PyPI version License: MIT Python 3.10+

Documentation | Quickstart |

Features

  • MLX Optimized: Built specifically for Apple's MLX framework with GPU acceleration
  • High Performance: Optimized C++ implementations with Metal shaders for Apple Silicon
  • Graph Algorithms:
    • Uniform random walks
    • Biased random walks (Node2Vec style with p/q parameters)
    • Multi-hop neighbor sampling (GraphSAGE style)
    • Sparse × dense matrix multiplication (SpMM) for message passing: sum, mean, max, min, with gradients (COO and CSR, Metal kernels)
    • Multi-head attention scores per edge (edge_scores) for graph attention / transformer layers, with gradients

Installation

From PyPI (Recommended)
pip install mlx-cluster
From Source
git clone https://github.com/vinayhpandya/mlx_cluster.git
cd mlx_cluster
pip install -e .
Development Installation
git clone https://github.com/vinayhpandya/mlx_cluster.git
cd mlx_cluster
pip install -e . --verbose
Dependencies

Required:

  • Python 3.10+
  • MLX framework
  • NumPy

Optional (for examples and testing):

  • MLX-Graphs
  • PyTorch (for dataset utilities)
  • pytest

Quick Start

Random Walks
import mlx.core as mx
import numpy as np
from mlx_cluster import random_walk
from mlx_graphs.datasets import PlanetoidDataset
from mlx_graphs.utils.sorting import sort_edge_index

# Load dataset
cora = PlanetoidDataset(name="cora")
edge_index = cora.graphs[0].edge_index.astype(mx.int64)

# Convert to CSR format
sorted_edge_index = sort_edge_index(edge_index=edge_index)
row = sorted_edge_index[0][0]
col = sorted_edge_index[0][1]
_, counts = np.unique(np.array(row, copy=False), return_counts=True)
row_ptr = mx.concatenate([mx.array([0]), mx.array(counts.cumsum())])

# Generate random walks
num_walks = 1000
walk_length = 10
start_nodes = mx.array(np.random.randint(0, cora.graphs[0].num_nodes, num_walks))
rand_values = mx.random.uniform(shape=[num_walks, walk_length])

mx.eval(rowptr,col, start_nodes, rand_values)
# Perform walks
node_sequences, edge_sequences = random_walk(
    row_ptr, col, start_nodes, rand_values, walk_length, stream=mx.gpu
)

print(f"Generated {num_walks} walks of length {walk_length + 1}")
print(f"Shape: {node_sequences.shape}")
Biased Random Walks (Node2Vec)
from mlx_cluster import rejection_sampling

# Biased random walks with p/q parameters
node_sequences, edge_sequences = rejection_sampling(
    row_ptr, col, start_nodes, walk_length,
    p=1.0,  # Return parameter
    q=2.0,  # In-out parameter
    stream=mx.gpu
)
Neighbor Sampling
from mlx_cluster import neighbor_sample

# Convert to CSC format (required for neighbor sampling)
def create_csc_format(edge_index, num_nodes):
    sources, targets = edge_index[0].tolist(), edge_index[1].tolist()
    edges = sorted(zip(sources, targets), key=lambda x: x[1])

    colptr = np.zeros(num_nodes + 1, dtype=np.int64)
    for _, target in edges:
        colptr[target + 1] += 1
    colptr = np.cumsum(colptr)

    sorted_sources = [source for source, _ in edges]
    return mx.array(colptr), mx.array(sorted_sources, dtype=mx.int64)

colptr, row = create_csc_format(edge_index, cora.graphs[0].num_nodes)

# Multi-hop neighbor sampling
input_nodes = mx.array([0, 1, 2], dtype=mx.int64)
num_neighbors = [10, 5]  # 10 neighbors in first hop, 5 in second
mx.eval(colptr, row, input_nodes)
samples, rows, cols, edges = neighbor_sample(
    colptr, row, input_nodes, num_neighbors,
    replace=True, directed=True
)

print(f"Sampled {len(samples)} nodes and {len(edges)} edges")
Sparse Matrix Multiplication (message passing)

Aggregates neighbour features as A @ X without materialising a [num_edges, features] message array, in both the forward and backward pass.

import mlx.core as mx
from mlx_cluster import coo_to_csr, spmm_coo, spmm_csr

edge_index = mx.array([[0, 1, 2, 2], [1, 2, 0, 1]])   # [src, dst]
src, dst = edge_index[0], edge_index[1]
x = mx.random.normal((3, 64))

# COO: works on the edge list directly
out = spmm_coo(dst, src, x, reduce="sum")             # also "mean", "max", "min"

# CSR: sort once per graph and reuse; deterministic and fastest on larger graphs
csr = coo_to_csr(dst, src, num_rows=3)
out = spmm_csr(csr.rowptr, csr.col, x, reduce="mean",
               long_rows=csr.long_rows, transpose=csr.transpose)

grad = mx.grad(lambda x: spmm_csr(csr.rowptr, csr.col, x,
                                  transpose=csr.transpose).sum())(x)

On an Apple M4 Pro, a GCN training step on a 1M-edge graph (256 features) is about 4x faster and uses about 4.6x less memory than gather-scatter. mlx-graphs uses these kernels automatically via @fused_message_passing. See the SpMM guide for conventions (empty rows, ties) and details.

For attention layers, edge_scores computes one dot-product score per edge and head (e.g. query · key) without copying the node features per edge, forward or backward:

from mlx_cluster import edge_scores

q = mx.random.normal((3, 4, 16))   # [num_nodes, heads, channels]
k = mx.random.normal((3, 4, 16))
scores = edge_scores(dst, src, q, k, scale=0.25)   # [num_edges, heads]

Documentation

For comprehensive documentation, examples, and API reference, visit: Documentation

Testing

Run the test suite:

# Install test dependencies
pip install pytest mlx-graphs torch

# Run tests
pytest -s -v

Performance

MLX-Cluster is optimized for Apple Silicon and shows significant speedups:

  • Apple M1/M2/M3: 2-5x faster than CPU-only implementations
  • GPU Acceleration: Automatic optimization for Metal Performance Shaders
  • Memory Efficient: Optimized sparse graph representations
  • Batch Processing: Efficient handling of thousands of concurrent walks

Contributing

We welcome contributions!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new algorithm')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request For installation and test intructions please visit the documentation

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

Citation

If you use MLX-Cluster in your research, please cite:

@software{mlx_cluster,
  author = {Vinay Pandya},
  title = {MLX-Cluster: High-Performance Graph Algorithms for Apple MLX},
  url = {https://github.com/vinayhpandya/mlx_cluster},
  version = {0.0.6},
  year = {2025}
}

Related Projects


OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases mlx-cluster

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229