Skip to content

Optimize Tanimoto similarity for skinny queries - #284

Merged
scal444 merged 2 commits into
NVIDIA-BioNeMo:mainfrom
scal444:perf/issue268-transposed-tanimoto
Sep 10, 2026
Merged

Optimize Tanimoto similarity for skinny queries#284
scal444 merged 2 commits into
NVIDIA-BioNeMo:mainfrom
scal444:perf/issue268-transposed-tanimoto

Conversation

@scal444

@scal444 scal444 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Optimizes small dimension queries by transposing the small dim and using optimal matrix dimensions. N=1 is still inefficient, but much less so.

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no actionable correctness, security, or repository-rule violations identified.

Summary

  • Adds specialized tensor-kernel launch configurations for query sizes up to 8, 16, and 32 rows.
  • Corrects the shared-memory output stride to use the tile’s X dimension.
  • Adds boundary-shape and empty-fingerprint tests for the optimized path.
  • Adds a compile-time check that the reused shared-memory allocation can contain each output tile.

Reviews (2) · Last reviewed commit: "Guard tensor tile shared-memory capacity"

@scal444
scal444 requested a review from moradza September 1, 2026 19:18
@scal444
scal444 requested a review from evasnow1992 September 9, 2026 17:49
Comment thread src/similarity_kernels.cu

@evasnow1992 evasnow1992 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. One comment on whether it would be worth adding back a tile-size check in the new kernel launcher.

@scal444
scal444 merged commit 0e4364e into NVIDIA-BioNeMo:main Sep 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants