用GPU加速高维数据降维,苹果芯片上快13倍
mlx-vis: GPU-Native Dimensionality Reduction on Apple Silicon
- 全栈GPU实现7种降维算法和邻居图构建
- 70万数据点仅需2.1至4.6秒,提速3到13倍
- 适合需要快速可视化海量数据的科研与工程人员
降维是可视化高维数据的基础工具,但现有主流实现多依赖CPU上的Python包,未能利用苹果芯片上的Metal GPU。我们提出mlx-vis,用纯MLX重写七种常用降维方法及最近邻图构建,从PCA预处理到嵌入优化再到圆点渲染,全程在GPU上执行。在Fashion-MNIST 70K数据集上,M3 Ultra芯片上所有方法耗时2.1至4.6秒,相比CPU基线提速3至13倍,且依赖项简化为MLX和NumPy。同一流程可扩展至单机十亿点规模。代码见https://github.com/hanxiao/mlx-vis。
原文摘要 · Abstract (English)
Dimensionality reduction is a foundational tool for visualizing high-dimensional data, yet its reference implementations span a fragmented stack of CPU-bound Python packages that leaves the Metal GPU on Apple Silicon entirely unused. We present mlx-vis, a library that reimplements seven widely used dimensionality reduction methods and k-nearest neighbor graph construction in pure MLX, with every stage -- from PCA preprocessing through embedding optimization to a circle-splatting renderer -- executing on GPU. On Fashion-MNIST 70K, all seven methods embed in 2.1--4.6 s on an M3 Ultra, achieving 3--13x speedups over CPU baselines while reducing the entire dependency stack to MLX and NumPy. The same pipeline scales to ten million points on a single workstation. Code at https://github.com/hanxiao/mlx-vis
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。