$npx skillfedfor your agent

sparse-dot-topn

This package boosts a sparse matrix multiplication followed by selecting the top-n multiplication

Worth itPyPI MathematicsReleased Dec 2025262.3K downloads / mopermissive licensePlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — sparse_dot_topn-1.2.0-cp310-cp310-macosx_12_0_arm64.whl · sparse_dot_topn-1.2.0-cp310-cp310-macosx_12_0_x86_64.whl · sparse_dot_topn-1.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
v1.2.0 · released 2025-12-16 · Python >=3.9 · 3 runtime deps: numpy, scipy, psutil

Yes. The package solves a genuine performance and memory bottleneck in large-scale sparse matrix operations. It is actively maintained, has no known vulnerabilities, carries a permissive license, and provides convenient pre-built wheels. Install friction is moderate but manageable. Recommended for projects involving large sparse matrix similarity matching or top-n filtering.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • C++ extension is vendored with OpenMP for parallelization; if OpenMP issues arise, omit n_threads argument or see INSTALLATION.md.
  • Medium install friction due to C++ extension dependency, but wheels are pre-built for Python 3.9–3.12 on Windows, Linux, and macOS (x86 and ARM).

License · maintenance · safety

permissive license (permissive) — Licensed under Apache Software License (permissive), imposing no significant restrictions on use, modification, or distribution in most contexts.

last release 2025-12-16 (241 days) · last repo commit 2026-08-10 · 425 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 262,316 downloads/mo, #8,376 on PyPI

Verify before relying

pip install sparse_dot_topn

import scipy.sparse as sparse
from sparse_dot_topn import sp_matmul_topn

A = sparse.random(1000, 100, density=0.1, format="csr")
B = sparse.random(100, 2000, density=0.1, format="csr")
C = sp_matmul_topn(A, B, top_n=10)
  • Whether the 6× speedup claim on Apple M2 Pro generalizes to other hardware platforms and matrix sizes.
  • Performance characteristics when threshold and density parameters are tuned for specific use cases.
  • Behavior and performance with negative-valued sparse matrices beyond the stated default change.
Same gist for agents: .md · .json

What it is and what it does

sparse_dot_topn is a Python package that accelerates a common operation in large-scale similarity matching: multiplying two sparse matrices and keeping only the top-n results per row. It wraps a C++ extension (with vendored OpenMP) to perform this combined operation in a single pass, avoiding the memory overhead of computing the full product and then filtering. The package supports CSR, CSC, and COO sparse matrix formats with 32- and 64-bit integer and float data types, and can parallelize across multiple threads.

The main use case is comparing very large feature vectors (e.g., TF-IDF matrices) and selecting the best matches efficiently. It offers optional threshold filtering to discard low-scoring results and density hints to reduce pre-allocated memory. The package is actively maintained, supports modern Python versions (3.9–3.12), and provides pre-built wheels for common platforms, though source installation is possible for architecture-specific optimization.

Use it for

  • Find top-10 most similar documents in a corpus by multiplying TF-IDF matrices and retaining only the highest-scoring matches per row.
  • Distribute large-scale matrix multiplication across a cluster by splitting matrices into chunks, computing top-n products per chunk, and re-zipping results.
  • Reduce memory footprint when comparing high-dimensional embeddings by filtering to top-n results during multiplication rather than storing the full product.
  • Parallelize sparse matrix operations across multiple CPU cores to speed up similarity computations on multi-core systems.
  • Apply threshold-based filtering during multiplication to discard low-confidence matches and further reduce output size.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package solves a genuine performance and memory bottleneck in large-scale sparse matrix operations. It is actively maintained, has no known vulnerabilities, carries a permissive license, and provides convenient pre-built wheels. Install friction is moderate but manageable. Recommended for projects involving large sparse matrix similarity matching or top-n filtering.

Install

sparse-dot-topn on PyPI

Before you install

Medium install friction due to C++ extension dependency, but wheels are pre-built for Python 3.9–3.12 on Windows, Linux, and macOS (x86 and ARM). Maintenance is active with recent releases and a healthy repository. Installation from wheels is straightforward; source builds require a C++17 compiler.

Requires Python 3.9 or later. C++ extension is vendored with OpenMP for parallelization; if OpenMP issues arise, omit n_threads argument or see INSTALLATION.md.

License in practice

Licensed under Apache Software License (permissive), imposing no significant restrictions on use, modification, or distribution in most contexts.

Quickstart

pip install sparse_dot_topn

import scipy.sparse as sparse
from sparse_dot_topn import sp_matmul_topn

A = sparse.random(1000, 100, density=0.1, format="csr")
B = sparse.random(100, 2000, density=0.1, format="csr")
C = sp_matmul_topn(A, B, top_n=10)

Verify before relying

  • Whether the 6× speedup claim on Apple M2 Pro generalizes to other hardware platforms and matrix sizes.
  • Performance characteristics when threshold and density parameters are tuned for specific use cases.
  • Behavior and performance with negative-valued sparse matrices beyond the stated default change.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.9
Install frictionMedium. Platform-specific wheel
Runtime dependencies
3 packages
numpyscipypsutil
MaintenanceActively maintained 241 days since the last release
Last repo commit
First released
Downloads262,316 / month, #8,376 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Evidence: sparse_dot_topn-1.2.0-cp310-cp310-macosx_12_0_arm64.whl; sparse_dot_topn-1.2.0-cp310-cp310-macosx_12_0_x86_64.whl; sparse_dot_topn-1.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; sparse_dot_topn-1.2.0-cp310-cp310-win_amd64.whl; sparse_dot_topn-1.2.0-cp311-cp311-macosx_12_0_arm64.whl; sparse_dot_topn-1.2.0-cp311-cp311-macosx_12_0_x86_64.whl; sparse_dot_topn-1.2.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; sparse_dot_topn-1.2.0-cp311-cp311-win_amd64.whl; sparse_dot_topn-1.2.0-cp312-abi3-macosx_12_0_arm64.whl; sparse_dot_topn-1.2.0-cp312-abi3-macosx_12_0_x86_64.whl; sparse_dot_topn-1.2.0-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; sparse_dot_topn-1.2.0-cp312-abi3-win_amd64.whl; sparse_dot_topn-1.2.0-cp39-cp39-macosx_12_0_arm64.whl; sparse_dot_topn-1.2.0-cp39-cp39-macosx_12_0_x86_64.whl; sparse_dot_topn-1.2.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; sparse_dot_topn-1.2.0-cp39-cp39-win_amd64.whl

Tags

Capabilities
sparse matrix multiplication top-nsparse dot product selectionlarge matrix similarity matchingefficient sparse matrix filteringparallel sparse matrix operationstop-n sparse resultsmemory-efficient matrix multiplication
Topics
sparse-matricessimilarity-matchinghigh-performance

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “sparse matrix multiplication top-n”

Give your agent the search over MCP, or paste the wish link into any chat.

More Mathematics packages

networkx Worth it
PyPI · Python Modules · released Dec 2025

NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.

BSD-3-Clausepure Python
290.9Mdownloads / mo
kiwisolver Worth it
PyPI · Mathematics · released Mar 2026

kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.

Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.

BSD-3-Clausecompiled wheel · 3.10+
205.5Mdownloads / mo
sympy Worth it
PyPI · Scientific/Engineering · released Apr 2025

SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.

BSD-3-Clausepure Python · 3.9+
196.4Mdownloads / mo
contourpy Worth it
PyPI · Information Analysis · released Jul 2025

ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.

BSD-3-Clausecompiled wheel · 3.11+
191.2Mdownloads / mo
torch With conditions
PyPI · Software Development · released Jul 2026

PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.

Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND MITcompiled wheel · 3.10+
102.5Mdownloads / mo
onnxruntime Worth it
PyPI · Software Development · released Jul 2026

onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.

Install it if you have ONNX models to run in production or development.

MITcompiled wheel · 3.11+
89.3Mdownloads / mo

See also nvidia-cusparselt-cu12 · nvidia-cusparselt-cu13 · tabmat · bytesparse · nvidia-cusparse · nvidia-cusparse-cu12 · spglm · qdldl · anndata · fast-array-utils